From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH net-next 08/14] net: enetc: add generic ntmp_add_entry_by_id() helper
Date: Sat, 05 Dec 2026 07:11:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-251204@kernel.org> (raw)
In-Reply-To: <20261204071410.692071-9-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net: enetc: ntmp_add_entry_by_id() drops const on entry
parameter
--
commit e300fa241d1465c5e37208357188a334c8cb8639
Author: Wei Fang <wei.fang@nxp.com>
net: enetc: add generic ntmp_add_entry_by_id() helper
This commit adds ntmp_add_entry_by_id() and ntmp_table_ops() to factor out
common logic for adding NTMP table entries with software-allocated entry
IDs, and converts the MAFT and ETT add paths to use it.
> diff --git a/drivers/net/ethernet/freescale/enetc/ntmp.c b/drivers/net/ethernet/freescale/enetc/ntmp.c
> index 07a9117273220..fec6c3fcfd2e4 100644
> --- a/drivers/net/ethernet/freescale/enetc/ntmp.c
> +++ b/drivers/net/ethernet/freescale/enetc/ntmp.c
> @@ -640,6 +640,76 @@ static const struct ntmp_tbl_ops *ntmp_get_bpt_ops(u8 version)
[ ... ]
> +static int ntmp_add_entry_by_id(struct ntmp_user *user, int tbl_id,
> + u32 entry_id, void *entry, u16 ua)
> +{
> + u8 version = user->tbl_ver[tbl_id];
> + const struct ntmp_tbl_ops *ops;
> + struct netc_swcbd swcbd;
> + struct netc_cbdr *cbdr;
> + union netc_cbd cbd;
> + void *buf;
> + int err;
> +
> + ops = ntmp_table_ops(tbl_id, version);
> + if (!ops)
> + return -EOPNOTSUPP;
> +
> + swcbd.size = ops->req_ua_len;
> + err = ntmp_alloc_data_mem(user->dev, &swcbd, &buf);
> + if (err)
> + return err;
> +
> + ntmp_fill_crd_eid(buf, version, 0, ua, entry_id);
> + ops->pack(entry, buf, NTMP_AM_ENTRY_ID);
[Severity: Low]
Can the entry parameter in ntmp_add_entry_by_id() be const void *?
ntmp_add_entry_by_id() only passes entry to ops->pack(), which already
takes const void *. Taking non-const void * forces ntmp_ett_add_entry()
to cast away const (triggering -Wcast-qual) and requires an unnecessary
(void *) cast in ntmp_maft_add_entry().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204071410.692071-1-wei.fang@oss.nxp.com?part=8
next prev parent reply other threads:[~2026-12-05 7:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 7:13 [PATCH net-next 00/14] net: enetc: refactor NTMP table handling and add generic helpers wei.fang
2026-12-04 7:13 ` [PATCH net-next 01/14] net: enetc: use an ID-indexed array to track NTMP table versions wei.fang
2026-12-04 7:13 ` [PATCH net-next 02/14] net: enetc: decouple MAFT logical config from hardware wire format wei.fang
2026-12-04 7:13 ` [PATCH net-next 03/14] net: enetc: decouple IPFT " wei.fang
2026-12-04 7:14 ` [PATCH net-next 04/14] net: enetc: decouple FDBT " wei.fang
2026-12-05 7:11 ` sashiko-bot
2026-12-04 7:14 ` [PATCH net-next 05/14] net: enetc: decouple VFT " wei.fang
2026-12-05 7:11 ` sashiko-bot
2026-12-04 7:14 ` [PATCH net-next 06/14] net: enetc: decouple ETT " wei.fang
2026-12-04 7:14 ` [PATCH net-next 07/14] net: enetc: decouple BPT " wei.fang
2026-12-05 7:11 ` sashiko-bot
2026-12-04 7:14 ` [PATCH net-next 08/14] net: enetc: add generic ntmp_add_entry_by_id() helper wei.fang
2026-12-05 7:11 ` sashiko-bot [this message]
2026-12-04 7:14 ` [PATCH net-next 09/14] net: enetc: simplify callers of ntmp_query_entry_by_id() wei.fang
2026-12-04 7:14 ` [PATCH net-next 10/14] net: enetc: add kernel-doc for ntmp_delete_entry_by_id() wei.fang
2026-12-04 7:14 ` [PATCH net-next 11/14] net: enetc: add a generic helper to update an NTMP entry by entry ID wei.fang
2026-12-05 7:11 ` sashiko-bot
2026-12-04 7:14 ` [PATCH net-next 12/14] net: enetc: convert ntmp_ect_update_entry() to the generic update helper wei.fang
2026-12-04 7:14 ` [PATCH net-next 13/14] net: enetc: add a generic helper to add an NTMP entry by key wei.fang
2026-12-05 7:11 ` sashiko-bot
2026-12-04 7:14 ` [PATCH net-next 14/14] net: enetc: convert the RSST to the generic NTMP entry helpers wei.fang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-251204@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wei.fang@oss.nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.