lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250718143225.GE2459@horms.kernel.org>
Date: Fri, 18 Jul 2025 15:32:25 +0100
From: Simon Horman <horms@...nel.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Himanshu Mittal <h-mittal1@...com>, netdev@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	MD Danish Anwar <danishanwar@...com>,
	Meghana Malladi <m-malladi@...com>, Paolo Abeni <pabeni@...hat.com>,
	prajith@...com, Pratheesh Gangadhar <pratheesh@...com>,
	Sriramakrishnan <srk@...com>, Roger Quadros <rogerq@...nel.org>,
	Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH net v3] net: ti: icssg-prueth: Fix buffer allocation for
 ICSSG

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ