[PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver

Andy Shevchenko posted 2 patches 3 weeks, 5 days ago
[PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by Andy Shevchenko 3 weeks, 5 days ago
Use predefined HZ_PER_MHZ constant where it is appropriate.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-mlxbf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index 9f0048044112..6c1cfe9ec8ac 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -66,7 +66,7 @@
  * strongly dependent on the core clock frequency of the SMBus
  * Master. Default value is set to 400MHz.
  */
-#define MLXBF_I2C_TYU_PLL_OUT_FREQ  (400 * 1000 * 1000)
+#define MLXBF_I2C_TYU_PLL_OUT_FREQ  (400 * HZ_PER_MHZ)
 /* Reference clock for Bluefield - 156 MHz. */
 #define MLXBF_I2C_PLL_IN_FREQ       156250000ULL
 
-- 
2.50.1
Re: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by kernel test robot 3 weeks, 5 days ago
Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on andi-shyti/i2c/i2c-host]
[also build test ERROR on linus/master v6.19-rc5 next-20260109]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/i2c-mlxbf-Remove-unused-bus-speed-definitions/20260112-220605
base:   https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git i2c/i2c-host
patch link:    https://lore.kernel.org/r/20260112135603.4150952-3-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
config: i386-buildonly-randconfig-001-20260112 (https://download.01.org/0day-ci/archive/20260113/202601130414.VJyCNWzI-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/202601130414.VJyCNWzI-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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601130414.VJyCNWzI-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/i2c/busses/i2c-mlxbf.c: In function 'mlxbf_i2c_probe':
>> drivers/i2c/busses/i2c-mlxbf.c:68:44: error: 'HZ_PER_MHZ' undeclared (first use in this function)
      68 | #define MLXBF_I2C_TYU_PLL_OUT_FREQ  (400 * HZ_PER_MHZ)
         |                                            ^~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:173:41: note: in expansion of macro 'MLXBF_I2C_TYU_PLL_OUT_FREQ'
     173 | #define MLXBF_I2C_COREPLL_FREQ          MLXBF_I2C_TYU_PLL_OUT_FREQ
         |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:2325:35: note: in expansion of macro 'MLXBF_I2C_COREPLL_FREQ'
    2325 |                 priv->frequency = MLXBF_I2C_COREPLL_FREQ;
         |                                   ^~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:68:44: note: each undeclared identifier is reported only once for each function it appears in
      68 | #define MLXBF_I2C_TYU_PLL_OUT_FREQ  (400 * HZ_PER_MHZ)
         |                                            ^~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:173:41: note: in expansion of macro 'MLXBF_I2C_TYU_PLL_OUT_FREQ'
     173 | #define MLXBF_I2C_COREPLL_FREQ          MLXBF_I2C_TYU_PLL_OUT_FREQ
         |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/i2c/busses/i2c-mlxbf.c:2325:35: note: in expansion of macro 'MLXBF_I2C_COREPLL_FREQ'
    2325 |                 priv->frequency = MLXBF_I2C_COREPLL_FREQ;
         |                                   ^~~~~~~~~~~~~~~~~~~~~~


vim +/HZ_PER_MHZ +68 drivers/i2c/busses/i2c-mlxbf.c

    55	
    56	/*
    57	 * Note that the following SMBus, CAUSE, GPIO and PLL register addresses
    58	 * refer to their respective offsets relative to the corresponding
    59	 * memory-mapped region whose addresses are specified in either the DT or
    60	 * the ACPI tables or above.
    61	 */
    62	
    63	/*
    64	 * SMBus Master core clock frequency. Timing configurations are
    65	 * strongly dependent on the core clock frequency of the SMBus
    66	 * Master. Default value is set to 400MHz.
    67	 */
  > 68	#define MLXBF_I2C_TYU_PLL_OUT_FREQ  (400 * HZ_PER_MHZ)
    69	/* Reference clock for Bluefield - 156 MHz. */
    70	#define MLXBF_I2C_PLL_IN_FREQ       156250000ULL
    71	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by Andy Shevchenko 3 weeks, 5 days ago
On Tue, Jan 13, 2026 at 04:33:04AM +0800, kernel test robot wrote:
> Hi Andy,
> 
> kernel test robot noticed the following build errors:

Ah, okay, this needs to be based on the series that adds HZ_PER_GHZ as it
provides the needed header inclusion.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by Philip Li 3 weeks, 4 days ago
On Mon, Jan 12, 2026 at 10:36:49PM +0200, Andy Shevchenko wrote:
> On Tue, Jan 13, 2026 at 04:33:04AM +0800, kernel test robot wrote:
> > Hi Andy,
> > 
> > kernel test robot noticed the following build errors:
> 
> Ah, okay, this needs to be based on the series that adds HZ_PER_GHZ as it
> provides the needed header inclusion.

Thanks for the info, and sorry for the false report.

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 
>
Re: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by Andy Shevchenko 3 weeks, 4 days ago
On Tue, Jan 13, 2026 at 09:48:12PM +0800, Philip Li wrote:
> On Mon, Jan 12, 2026 at 10:36:49PM +0200, Andy Shevchenko wrote:
> > On Tue, Jan 13, 2026 at 04:33:04AM +0800, kernel test robot wrote:
> > > Hi Andy,
> > > 
> > > kernel test robot noticed the following build errors:
> > 
> > Ah, okay, this needs to be based on the series that adds HZ_PER_GHZ as it
> > provides the needed header inclusion.
> 
> Thanks for the info, and sorry for the false report.

No problem, can you remind the syntax on how I can mark the series that
LKP knows the dependency on another series (which is available only in
the mailing list)? I assume it needs message-id to the email thread?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by Philip Li 3 weeks, 4 days ago
On Tue, Jan 13, 2026 at 10:42:41PM +0200, Andy Shevchenko wrote:
> On Tue, Jan 13, 2026 at 09:48:12PM +0800, Philip Li wrote:
> > On Mon, Jan 12, 2026 at 10:36:49PM +0200, Andy Shevchenko wrote:
> > > On Tue, Jan 13, 2026 at 04:33:04AM +0800, kernel test robot wrote:
> > > > Hi Andy,
> > > > 
> > > > kernel test robot noticed the following build errors:
> > > 
> > > Ah, okay, this needs to be based on the series that adds HZ_PER_GHZ as it
> > > provides the needed header inclusion.
> > 
> > Thanks for the info, and sorry for the false report.
> 
> No problem, can you remind the syntax on how I can mark the series that
> LKP knows the dependency on another series (which is available only in
> the mailing list)? I assume it needs message-id to the email thread?

Currently to get dependency of another series is not supported yet, and
for now, we can only support the usage of '--base' option as documented
in [1] to avoid applying the patchset to wrong base.

Your suggestion is very helpful, probably we can check something like
base-message-id: (similar to base-commit:) to retrieve the dependency.

[1] https://git-scm.com/docs/git-format-patch#_base_tree_information

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
>
Re: [PATCH v1 2/2] i2c: mlxbf: Use HZ_PER_KHZ in the driver
Posted by Andy Shevchenko 3 weeks, 4 days ago
On Mon, Jan 12, 2026 at 10:36:54PM +0200, Andy Shevchenko wrote:
> On Tue, Jan 13, 2026 at 04:33:04AM +0800, kernel test robot wrote:
> > Hi Andy,
> > 
> > kernel test robot noticed the following build errors:
> 
> Ah, okay, this needs to be based on the series that adds HZ_PER_GHZ as it
> provides the needed header inclusion.

The series I mentioned is this one:
https://lore.kernel.org/r/20260112134900.4142954-1-andriy.shevchenko@linux.intel.com

-- 
With Best Regards,
Andy Shevchenko