From: Joe Damato <joe@dama.to>
To: Rosen Penev <rosenp@gmail.com>
Cc: netdev@vger.kernel.org, Sunil Goutham <sgoutham@marvell.com>,
Linu Cherian <lcherian@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
hariprasad <hkelam@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] octeontx2-af: CGX: use kzalloc_flex for name
Date: Fri, 13 Mar 2026 13:31:49 -0700 [thread overview]
Message-ID: <abR0NRpkL+3yPIIC@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <20260313003240.123975-1-rosenp@gmail.com>
On Thu, Mar 12, 2026 at 05:32:40PM -0700, Rosen Penev wrote:
> Don't bother allocating separately. There's no good reason to do so for
> a small string like this.
>
> Remove name kfrees as a result.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 13 +++----------
> .../net/ethernet/marvell/octeontx2/af/lmac_common.h | 2 +-
> 2 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> index 4f33a816bc7a..0750fb696c90 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> @@ -1725,14 +1725,10 @@ static int cgx_lmac_init(struct cgx *cgx)
> cgx->lmac_count = cgx->max_lmac_per_mac;
>
> for (i = 0; i < cgx->lmac_count; i++) {
> - lmac = kzalloc_obj(struct lmac);
> + lmac = kzalloc_flex(struct lmac, name, sizeof("cgx_fwi_xxx_yyy"));
Seems fine overall, I guess a minor nit is that I thought the typical style of
kzalloc_flex usage would be kzalloc_flex(*lmac, ....
idk if it's really worth a respin just for that, so:
Reviewed-by: Joe Damato <joe@dama.to>
next prev parent reply other threads:[~2026-03-13 20:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 0:32 [PATCH net-next] octeontx2-af: CGX: use kzalloc_flex for name Rosen Penev
2026-03-13 20:31 ` Joe Damato [this message]
2026-03-14 15:46 ` Jakub Kicinski
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=abR0NRpkL+3yPIIC@devvm20253.cco0.facebook.com \
--to=joe@dama.to \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rosenp@gmail.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.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.