[Intel-wired-lan] [PATCH] igb: zero hwtstamp by default
G, GurucharanX
gurucharanx.g at intel.com
Wed Mar 16 06:14:24 UTC 2022
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> trix at redhat.com
> Sent: Sunday, March 13, 2022 8:32 PM
> To: Brandeburg, Jesse <jesse.brandeburg at intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; davem at davemloft.net; kuba at kernel.org;
> nathan at kernel.org; ndesaulniers at google.com
> Cc: netdev at vger.kernel.org; llvm at lists.linux.dev; intel-wired-
> lan at lists.osuosl.org; linux-kernel at vger.kernel.org; Tom Rix
> <trix at redhat.com>
> Subject: [Intel-wired-lan] [PATCH] igb: zero hwtstamp by default
>
> From: Tom Rix <trix at redhat.com>
>
> 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 at redhat.com>
> ---
> drivers/net/ethernet/intel/igb/igb_ptp.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
Tested-by: Gurucharan <gurucharanx.g at intel.com> (A Contingent worker at Intel)
More information about the Intel-wired-lan
mailing list