]> git.baikalelectronics.ru Git - kernel.git/commit
igb: zero hwtstamp by default
authorTom Rix <trix@redhat.com>
Sun, 13 Mar 2022 15:02:10 +0000 (08:02 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 17 Mar 2022 15:32:28 +0000 (08:32 -0700)
commit2f4e65a56e11c56365c40e1381c9ceff8e823d8e
treea6967892ff947663c35c2b328f6237042d1826df
parent26e46e805b70cd505ee4b605fbf376ae3ae4d7b7
igb: zero hwtstamp by default

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@redhat.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igb/igb_ptp.c