RE: [Intel-wired-lan] [PATCH] igb: zero hwtstamp by default

From: G, GurucharanX
Date: Wed Mar 16 2022 - 02:14:44 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> trix@xxxxxxxxxx
> Sent: Sunday, March 13, 2022 8:32 PM
> To: Brandeburg, Jesse <jesse.brandeburg@xxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; davem@xxxxxxxxxxxxx; kuba@xxxxxxxxxx;
> nathan@xxxxxxxxxx; ndesaulniers@xxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx; llvm@xxxxxxxxxxxxxxx; intel-wired-
> lan@xxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Tom Rix
> <trix@xxxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH] igb: zero hwtstamp by default
>
> From: Tom Rix <trix@xxxxxxxxxx>
>
> Clang static analysis reports this representative issue
> igb_ptp.c:997:3: warning: The left operand of '+' is a
> garbage value
> ktime_add_ns(shhwtstamps.hwtstamp, adjust);
> ^ ~~~~~~~~~~~~~~~~~~~~
>
> shhwtstamps.hwtstamp is set by a call to igb_ptp_systim_to_hwtstamp(). In
> the switch-statement for the hw type, the hwtstamp is zeroed for matches
> but not the default case. Move the memset out of switch-statement. This
> degarbages the default case and reduces the size.
>
> Some whitespace cleanup of empty lines
>
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/igb/igb_ptp.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>

Tested-by: Gurucharan <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)