Subject: Re: [PATCH iwl-next] i40e: Avoid unnecessary use of comma operator

From: Simon Horman <[email-masked]>
Date: Tue, 19 Dec 2023 10:05:23 +0000

On Mon, Dec 18, 2023 at 08:32:28AM -0800, Nick Desaulniers wrote:
> On Sun, Dec 17, 2023 at 1:45 AM Simon Horman <[email-masked]> wrote:
> >
> > Although it does not seem to have any untoward side-effects,
> > the use of ';' to separate to assignments seems more appropriate than ','.
> >
> > Flagged by clang-17 -Wcomma
> 
> Yikes! This kind of example is why I hate the comma operator!
> 
> Reviewed-by: Nick Desaulniers <[email-masked]>
> 
> (Is -Wcomma enabled by -Wall?)
> 
> Is there a fixes tag we can add?

Hi Nick,

I don't believe this resolves a user-visible bug,
so for Networking code a fixes tag isn't appropriate.

> 
> >
> > No functional change intended.
> > Compile tested only.
> >
> > Signed-off-by: Simon Horman <[email-masked]>
> > ---
> >  drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > index 812d04747bd0..f542f2671957 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > @@ -1917,7 +1917,7 @@ int i40e_get_eeprom(struct net_device *netdev,
> >                         len = eeprom->len - (I40E_NVM_SECTOR_SIZE * i);
> >                         last = true;
> >                 }
> > -               offset = eeprom->offset + (I40E_NVM_SECTOR_SIZE * i),
> > +               offset = eeprom->offset + (I40E_NVM_SECTOR_SIZE * i);
> >                 ret_val = i40e_aq_read_nvm(hw, 0x0, offset, len,
> >                                 (u8 *)eeprom_buff + (I40E_NVM_SECTOR_SIZE * i),
> >                                 last, NULL);
> >
> >
> 
> 
> -- 
> Thanks,
> ~Nick Desaulniers