On Wed, 25 Jun 2025 13:22:39 +0100
Simon Horman <[email protected]> wrote:

> On Tue, Jun 24, 2025 at 09:31:08PM +0200, Jacek Kowalski wrote:
> > Signed-off-by: Jacek Kowalski <[email protected]>
> > Suggested-by: Simon Horman <[email protected]>
> > ---
> >  drivers/net/ethernet/intel/igc/igc_nvm.c | 2 +-  
> 
> I think we should add this:
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c 
> b/drivers/net/ethernet/intel/igc/igc_nvm.c
> index c4fb35071636..a47b8d39238c 100644
> --- a/drivers/net/ethernet/intel/igc/igc_nvm.c
> +++ b/drivers/net/ethernet/intel/igc/igc_nvm.c
> @@ -155,7 +155,7 @@ s32 igc_update_nvm_checksum(struct igc_hw *hw)
>               }
>               checksum += nvm_data;
>       }
> -     checksum = (u16)NVM_SUM - checksum;
> +     checksum = NVM_SUM - checksum;

Indeed - especially as the '-' code is really:
        checksum = (int)(u16)NVM_SUM - checksum;

  David


>       ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum);
>       if (ret_val)
>               hw_dbg("NVM Write Error while updating checksum.\n");
> 

Reply via email to