netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Himanshu Mittal <h-mittal1@ti.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	MD Danish Anwar <danishanwar@ti.com>,
	Meghana Malladi <m-malladi@ti.com>,
	Paolo Abeni <pabeni@redhat.com>,
	prajith@ti.com, Pratheesh Gangadhar <pratheesh@ti.com>,
	Sriramakrishnan <srk@ti.com>, Roger Quadros <rogerq@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH net v3] net: ti: icssg-prueth: Fix buffer allocation for ICSSG
Date: Fri, 18 Jul 2025 15:32:25 +0100	[thread overview]
Message-ID: <20250718143225.GE2459@horms.kernel.org> (raw)
In-Reply-To: <4c677fdb-e6d6-4961-b911-78aaa28130e6@web.de>

On Thu, Jul 17, 2025 at 02:56:15PM +0200, Markus Elfring wrote:
> …
> > +++ b/drivers/net/ethernet/ti/icssg/icssg_config.c
> > @@ -288,8 +288,12 @@ static int prueth_fw_offload_buffer_setup(struct prueth_emac *emac)
> >  	int i;
> >  
> >  	addr = lower_32_bits(prueth->msmcram.pa);
> > -	if (slice)
> > -		addr += PRUETH_NUM_BUF_POOLS * PRUETH_EMAC_BUF_POOL_SIZE;
> > +	if (slice) {
> > +		if (prueth->pdata.banked_ms_ram)
> > +			addr += MSMC_RAM_BANK_SIZE;
> > +		else
> > +			addr += PRUETH_SW_TOTAL_BUF_SIZE_PER_SLICE;
> > +	}
> …
> 
> Would you like to use the following code variant?
> 
> 	if (slice)
> 		addr += ( prueth->pdata.banked_ms_ram
> 			? MSMC_RAM_BANK_SIZE
> 			: PRUETH_SW_TOTAL_BUF_SIZE_PER_SLICE);
> 
> 
> Can the usage of the conditional operator be extended another bit
> (also for the function “prueth_emac_buffer_setup” for example)?

1. (Subjective) The current code seems fine to me
2. (Objective) Your suggestion features unnecessary parentheses, and
   incorrect indentation and whitespace

  reply	other threads:[~2025-07-18 14:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  9:42 [PATCH net v3] net: ti: icssg-prueth: Fix buffer allocation for ICSSG Himanshu Mittal
2025-07-17 12:56 ` Markus Elfring
2025-07-18 14:32   ` Simon Horman [this message]
2025-07-18 18:30     ` [v3] " Markus Elfring
2025-07-18 14:27 ` [PATCH net v3] " Simon Horman
2025-07-19  0:30 ` patchwork-bot+netdevbpf

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=20250718143225.GE2459@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=h-mittal1@ti.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-malladi@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=prajith@ti.com \
    --cc=pratheesh@ti.com \
    --cc=rogerq@kernel.org \
    --cc=srk@ti.com \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).