Skip to contentSkip to conversation

i2c: mlxbf: A couple of cleanups

PATCH Applied Andy Shevchenko 4 participants 11 messages Jan 12 – Jan 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover i2c: mlxbf: A couple of cleanups

Remove dead definitions and reuse HZ_PER_MHZ predefined constant. No functional changes.

Andy Shevchenko (2):
i2c: mlxbf: Remove unused bus speed definitions
i2c: mlxbf: Use HZ_PER_KHZ in the driver

 drivers/i2c/busses/i2c-mlxbf.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
Signature · 1 line
2.50.1
#1 lore raw

PATCH 1/2 i2c: mlxbf: Remove unused bus speed definitions

The driver had been converted to use standard constants for the bus speed a long time ago. Remove the leftover definitions.

---
 drivers/i2c/busses/i2c-mlxbf.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/i2c/busses/i2c-mlxbf.c +0 -6
index 746f65989138..9f0048044112 100644
@@ -324,12 +324,6 @@
 		.name = (str) \
 	}
 
-enum {
-	MLXBF_I2C_TIMING_100KHZ = 100000,
-	MLXBF_I2C_TIMING_400KHZ = 400000,
-	MLXBF_I2C_TIMING_1000KHZ = 1000000,
-};
-
 enum {
 	MLXBF_I2C_F_READ = BIT(0),
 	MLXBF_I2C_F_WRITE = BIT(1),
Signature · 1 line
2.50.1
#2 lore raw

PATCH 2/2 i2c: mlxbf: Use HZ_PER_KHZ in the driver

In reply to Andy Shevchenko

Use predefined HZ_PER_MHZ constant where it is appropriate.

---
 drivers/i2c/busses/i2c-mlxbf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mlxbf.c +1 -1
index 9f0048044112..6c1cfe9ec8ac 100644
@@ -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
 
Signature · 1 line
2.50.1
#3 lore raw

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

kernel test robot noticed the following build errors:

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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#4 lore raw

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

Quoted 3 lines · kernel test robot

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw

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

Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · kernel test robot

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/[email protected]

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

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

In reply to Andy Shevchenko
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · kernel test robot

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.

Quoted 7 lines
Signature · 3 lines
-- 
With Best Regards,
Andy Shevchenko
#7 lore raw

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

Quoted 10 lines · Philip Li
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · kernel test robot

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?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw

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

Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · Philip Li
Quoted 5 lines · Andy Shevchenko
Quoted 3 lines · kernel test robot

Hi Andy,

kernel test robot noticed the following build errors:

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

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

Quoted 6 lines
Signature · 3 lines
-- 
With Best Regards,
Andy Shevchenko
maintainer Applied
#9 lore raw
In reply to Andy Shevchenko

Hi Andy,

Quoted 3 lines

Andy Shevchenko (2):
i2c: mlxbf: Remove unused bus speed definitions
i2c: mlxbf: Use HZ_PER_KHZ in the driver

merged to i2c/i2c-host.

Thanks,
Andi

#10 lore raw
Quoted 7 lines · Andi Shyti

Hi Andy,

Quoted 3 lines

Andy Shevchenko (2):
i2c: mlxbf: Remove unused bus speed definitions
i2c: mlxbf: Use HZ_PER_KHZ in the driver

merged to i2c/i2c-host.

Thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko