All of lore.kernel.org
 help / color / mirror / Atom feed
* [tnguy-next-queue:dev-queue 20/51] drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented
@ 2023-07-30  1:59 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2023-07-30  1:59 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
TO: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
CC: Tony Nguyen <anthony.l.nguyen@intel.com>
CC: Jacob Keller <jacob.e.keller@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
head:   79dc5308c824de000283d82a4496567bbedae5db
commit: a9c0311851c4ab40093e5c629881499f2639f229 [20/51] ice: prefix clock timer command enumeration values with ICE_PTP
:::::: branch date: 28 hours ago
:::::: commit date: 8 days ago
config: i386-randconfig-m021-20230728 (https://download.01.org/0day-ci/archive/20230730/202307300951.kWJSF1tX-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230730/202307300951.kWJSF1tX-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202307300951.kWJSF1tX-lkp@intel.com/

smatch warnings:
drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented

vim +2181 drivers/net/ethernet/intel/ice/ice_ptp_hw.c

a69f1cb62aeced Jacob Keller       2021-10-13  2154  
3a7496234d179a Jacob Keller       2021-10-13  2155  /**
3a7496234d179a Jacob Keller       2021-10-13  2156   * ice_read_phy_and_phc_time_e822 - Simultaneously capture PHC and PHY time
3a7496234d179a Jacob Keller       2021-10-13  2157   * @hw: pointer to the HW struct
3a7496234d179a Jacob Keller       2021-10-13  2158   * @port: the PHY port to read
3a7496234d179a Jacob Keller       2021-10-13  2159   * @phy_time: on return, the 64bit PHY timer value
3a7496234d179a Jacob Keller       2021-10-13  2160   * @phc_time: on return, the lower 64bits of PHC time
3a7496234d179a Jacob Keller       2021-10-13  2161   *
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2162   * Issue a ICE_PTP_READ_TIME timer command to simultaneously capture the PHY
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2163   * and PHC timer values.
3a7496234d179a Jacob Keller       2021-10-13  2164   */
3a7496234d179a Jacob Keller       2021-10-13  2165  static int
3a7496234d179a Jacob Keller       2021-10-13  2166  ice_read_phy_and_phc_time_e822(struct ice_hw *hw, u8 port, u64 *phy_time,
3a7496234d179a Jacob Keller       2021-10-13  2167  			       u64 *phc_time)
3a7496234d179a Jacob Keller       2021-10-13  2168  {
3a7496234d179a Jacob Keller       2021-10-13  2169  	u64 tx_time, rx_time;
3a7496234d179a Jacob Keller       2021-10-13  2170  	u32 zo, lo;
3a7496234d179a Jacob Keller       2021-10-13  2171  	u8 tmr_idx;
3a7496234d179a Jacob Keller       2021-10-13  2172  	int err;
3a7496234d179a Jacob Keller       2021-10-13  2173  
3a7496234d179a Jacob Keller       2021-10-13  2174  	tmr_idx = ice_get_ptp_src_clock_index(hw);
3a7496234d179a Jacob Keller       2021-10-13  2175  
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2176  	/* Prepare the PHC timer for a ICE_PTP_READ_TIME capture command */
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2177  	ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
3a7496234d179a Jacob Keller       2021-10-13  2178  
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2179  	/* Prepare the PHY timer for a ICE_PTP_READ_TIME capture command */
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2180  	err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_READ_TIME);
3a7496234d179a Jacob Keller       2021-10-13 @2181  	if (err)
3a7496234d179a Jacob Keller       2021-10-13  2182  
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2183  	/* Issue the sync to start the ICE_PTP_READ_TIME capture */
3a7496234d179a Jacob Keller       2021-10-13  2184  	ice_ptp_exec_tmr_cmd(hw);
3a7496234d179a Jacob Keller       2021-10-13  2185  
3a7496234d179a Jacob Keller       2021-10-13  2186  	/* Read the captured PHC time from the shadow time registers */
3a7496234d179a Jacob Keller       2021-10-13  2187  	zo = rd32(hw, GLTSYN_SHTIME_0(tmr_idx));
3a7496234d179a Jacob Keller       2021-10-13  2188  	lo = rd32(hw, GLTSYN_SHTIME_L(tmr_idx));
3a7496234d179a Jacob Keller       2021-10-13  2189  	*phc_time = (u64)lo << 32 | zo;
3a7496234d179a Jacob Keller       2021-10-13  2190  
3a7496234d179a Jacob Keller       2021-10-13  2191  	/* Read the captured PHY time from the PHY shadow registers */
3a7496234d179a Jacob Keller       2021-10-13  2192  	err = ice_ptp_read_port_capture(hw, port, &tx_time, &rx_time);
3a7496234d179a Jacob Keller       2021-10-13  2193  	if (err)
3a7496234d179a Jacob Keller       2021-10-13  2194  		return err;
3a7496234d179a Jacob Keller       2021-10-13  2195  
3a7496234d179a Jacob Keller       2021-10-13  2196  	/* If the PHY Tx and Rx timers don't match, log a warning message.
3a7496234d179a Jacob Keller       2021-10-13  2197  	 * Note that this should not happen in normal circumstances since the
3a7496234d179a Jacob Keller       2021-10-13  2198  	 * driver always programs them together.
3a7496234d179a Jacob Keller       2021-10-13  2199  	 */
3a7496234d179a Jacob Keller       2021-10-13  2200  	if (tx_time != rx_time)
3a7496234d179a Jacob Keller       2021-10-13  2201  		dev_warn(ice_hw_to_dev(hw),
3a7496234d179a Jacob Keller       2021-10-13  2202  			 "PHY port %u Tx and Rx timers do not match, tx_time 0x%016llX, rx_time 0x%016llX\n",
3a7496234d179a Jacob Keller       2021-10-13  2203  			 port, (unsigned long long)tx_time,
3a7496234d179a Jacob Keller       2021-10-13  2204  			 (unsigned long long)rx_time);
3a7496234d179a Jacob Keller       2021-10-13  2205  
3a7496234d179a Jacob Keller       2021-10-13  2206  	*phy_time = tx_time;
3a7496234d179a Jacob Keller       2021-10-13  2207  
3a7496234d179a Jacob Keller       2021-10-13  2208  	return 0;
3a7496234d179a Jacob Keller       2021-10-13  2209  }
3a7496234d179a Jacob Keller       2021-10-13  2210  

:::::: The code at line 2181 was first introduced by commit
:::::: 3a7496234d179a7dd6a7bb152f62422c3f38e15a ice: implement basic E822 PTP support

:::::: TO: Jacob Keller <jacob.e.keller@intel.com>
:::::: CC: Tony Nguyen <anthony.l.nguyen@intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tnguy-next-queue:dev-queue 20/51] drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented
@ 2023-07-31  5:40 Dan Carpenter
  2023-07-31 16:49 ` Tony Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-07-31  5:40 UTC (permalink / raw)
  To: oe-kbuild, Sergey Temerkhanov
  Cc: lkp, oe-kbuild-all, Intel Wired LAN, Tony Nguyen, Jacob Keller

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
head:   79dc5308c824de000283d82a4496567bbedae5db
commit: a9c0311851c4ab40093e5c629881499f2639f229 [20/51] ice: prefix clock timer command enumeration values with ICE_PTP
config: i386-randconfig-m021-20230728 (https://download.01.org/0day-ci/archive/20230730/202307300951.kWJSF1tX-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230730/202307300951.kWJSF1tX-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202307300951.kWJSF1tX-lkp@intel.com/

smatch warnings:
drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented

vim +2181 drivers/net/ethernet/intel/ice/ice_ptp_hw.c

3a7496234d179a Jacob Keller       2021-10-13  2165  static int
3a7496234d179a Jacob Keller       2021-10-13  2166  ice_read_phy_and_phc_time_e822(struct ice_hw *hw, u8 port, u64 *phy_time,
3a7496234d179a Jacob Keller       2021-10-13  2167  			       u64 *phc_time)
3a7496234d179a Jacob Keller       2021-10-13  2168  {
3a7496234d179a Jacob Keller       2021-10-13  2169  	u64 tx_time, rx_time;
3a7496234d179a Jacob Keller       2021-10-13  2170  	u32 zo, lo;
3a7496234d179a Jacob Keller       2021-10-13  2171  	u8 tmr_idx;
3a7496234d179a Jacob Keller       2021-10-13  2172  	int err;
3a7496234d179a Jacob Keller       2021-10-13  2173  
3a7496234d179a Jacob Keller       2021-10-13  2174  	tmr_idx = ice_get_ptp_src_clock_index(hw);
3a7496234d179a Jacob Keller       2021-10-13  2175  
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2176  	/* Prepare the PHC timer for a ICE_PTP_READ_TIME capture command */
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2177  	ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
3a7496234d179a Jacob Keller       2021-10-13  2178  
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2179  	/* Prepare the PHY timer for a ICE_PTP_READ_TIME capture command */
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2180  	err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_READ_TIME);
3a7496234d179a Jacob Keller       2021-10-13 @2181  	if (err)

return err; statement is somehow missing.

3a7496234d179a Jacob Keller       2021-10-13  2182  
a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2183  	/* Issue the sync to start the ICE_PTP_READ_TIME capture */
3a7496234d179a Jacob Keller       2021-10-13  2184  	ice_ptp_exec_tmr_cmd(hw);
3a7496234d179a Jacob Keller       2021-10-13  2185  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tnguy-next-queue:dev-queue 20/51] drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented
  2023-07-31  5:40 Dan Carpenter
@ 2023-07-31 16:49 ` Tony Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Nguyen @ 2023-07-31 16:49 UTC (permalink / raw)
  To: Dan Carpenter, oe-kbuild, Sergey Temerkhanov
  Cc: lkp, oe-kbuild-all, Intel Wired LAN, Jacob Keller

On 7/30/2023 10:40 PM, Dan Carpenter wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue.git dev-queue
> head:   79dc5308c824de000283d82a4496567bbedae5db
> commit: a9c0311851c4ab40093e5c629881499f2639f229 [20/51] ice: prefix clock timer command enumeration values with ICE_PTP
> config: i386-randconfig-m021-20230728 (https://download.01.org/0day-ci/archive/20230730/202307300951.kWJSF1tX-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20230730/202307300951.kWJSF1tX-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202307300951.kWJSF1tX-lkp@intel.com/
> 
> smatch warnings:
> drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented
> 
> vim +2181 drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> 
> 3a7496234d179a Jacob Keller       2021-10-13  2165  static int
> 3a7496234d179a Jacob Keller       2021-10-13  2166  ice_read_phy_and_phc_time_e822(struct ice_hw *hw, u8 port, u64 *phy_time,
> 3a7496234d179a Jacob Keller       2021-10-13  2167  			       u64 *phc_time)
> 3a7496234d179a Jacob Keller       2021-10-13  2168  {
> 3a7496234d179a Jacob Keller       2021-10-13  2169  	u64 tx_time, rx_time;
> 3a7496234d179a Jacob Keller       2021-10-13  2170  	u32 zo, lo;
> 3a7496234d179a Jacob Keller       2021-10-13  2171  	u8 tmr_idx;
> 3a7496234d179a Jacob Keller       2021-10-13  2172  	int err;
> 3a7496234d179a Jacob Keller       2021-10-13  2173
> 3a7496234d179a Jacob Keller       2021-10-13  2174  	tmr_idx = ice_get_ptp_src_clock_index(hw);
> 3a7496234d179a Jacob Keller       2021-10-13  2175
> a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2176  	/* Prepare the PHC timer for a ICE_PTP_READ_TIME capture command */
> a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2177  	ice_ptp_src_cmd(hw, ICE_PTP_READ_TIME);
> 3a7496234d179a Jacob Keller       2021-10-13  2178
> a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2179  	/* Prepare the PHY timer for a ICE_PTP_READ_TIME capture command */
> a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2180  	err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_READ_TIME);
> 3a7496234d179a Jacob Keller       2021-10-13 @2181  	if (err)
> 
> return err; statement is somehow missing.

Thanks for catching this Dan. Patch has been updated/fixed.

> 3a7496234d179a Jacob Keller       2021-10-13  2182
> a9c0311851c4ab Sergey Temerkhanov 2023-07-10  2183  	/* Issue the sync to start the ICE_PTP_READ_TIME capture */
> 3a7496234d179a Jacob Keller       2021-10-13  2184  	ice_ptp_exec_tmr_cmd(hw);
> 3a7496234d179a Jacob Keller       2021-10-13  2185
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-31 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-30  1:59 [tnguy-next-queue:dev-queue 20/51] drivers/net/ethernet/intel/ice/ice_ptp_hw.c:2181 ice_read_phy_and_phc_time_e822() warn: if statement not indented kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-07-31  5:40 Dan Carpenter
2023-07-31 16:49 ` Tony Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.