mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Saeed Mahameed <saeedm@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: 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)'
Date: Mon, 30 Dec 2024 21:35:28 +0800	[thread overview]
Message-ID: <202412302112.rtTcbfVd-lkp@intel.com> (raw)

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

                 reply	other threads:[~2024-12-30 13:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202412302112.rtTcbfVd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rrameshbabu@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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