mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c:397 mlx5_ptp_freq_adj_real_time() warn: always true condition '(scaled_ppm <= (((~0) >> 1))) => (s32min-s32max <= s32max)'
@ 2024-12-30 13:35 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-12-30 13:35 UTC (permalink / raw)
  To: Rahul Rameshbabu
  Cc: oe-kbuild-all, linux-kernel, Saeed Mahameed, Tariq Toukan

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fc033cf25e612e840e545f8d5ad2edd6ba613ed5
commit: 78c1b26754d9df062c3c8e08f5d6427967e3ba4b net/mlx5: Convert scaled ppm values outside the s32 range for PHC frequency adjustments
date:   1 year, 2 months ago
config: xtensa-randconfig-r073-20241229 (https://download.01.org/0day-ci/archive/20241230/202412302112.rtTcbfVd-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 14.2.0

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412302112.rtTcbfVd-lkp@intel.com/

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c:397 mlx5_ptp_freq_adj_real_time() warn: always true condition '(scaled_ppm <= (((~0) >> 1))) => (s32min-s32max <= s32max)'
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c:397 mlx5_ptp_freq_adj_real_time() warn: always true condition '(scaled_ppm >= ((-(((~0) >> 1)) - 1))) => (s32min-s32max >= s32min)'

Old smatch warnings:
arch/xtensa/include/asm/thread_info.h:97 current_thread_info() warn: inconsistent indenting

vim +397 drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c

   389	
   390	static int mlx5_ptp_freq_adj_real_time(struct mlx5_core_dev *mdev, long scaled_ppm)
   391	{
   392		u32 in[MLX5_ST_SZ_DW(mtutc_reg)] = {};
   393	
   394		MLX5_SET(mtutc_reg, in, operation, MLX5_MTUTC_OPERATION_ADJUST_FREQ_UTC);
   395	
   396		if (MLX5_CAP_MCAM_FEATURE(mdev, mtutc_freq_adj_units) &&
 > 397		    scaled_ppm <= S32_MAX && scaled_ppm >= S32_MIN) {
   398			/* HW scaled_ppm support on mlx5 devices only supports a 32-bit value */
   399			MLX5_SET(mtutc_reg, in, freq_adj_units,
   400				 MLX5_MTUTC_FREQ_ADJ_UNITS_SCALED_PPM);
   401			MLX5_SET(mtutc_reg, in, freq_adjustment, (s32)scaled_ppm);
   402		} else {
   403			MLX5_SET(mtutc_reg, in, freq_adj_units, MLX5_MTUTC_FREQ_ADJ_UNITS_PPB);
   404			MLX5_SET(mtutc_reg, in, freq_adjustment, scaled_ppm_to_ppb(scaled_ppm));
   405		}
   406	
   407		return mlx5_set_mtutc(mdev, in, sizeof(in));
   408	}
   409	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-30 13:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-30 13:35 drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c:397 mlx5_ptp_freq_adj_real_time() warn: always true condition '(scaled_ppm <= (((~0) >> 1))) => (s32min-s32max <= s32max)' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome