Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [nsa:b4/dev-adp5589-fw 7/21] drivers/mfd/adp5585.c:160:21: warning: cast to smaller integer type 'enum adp5585_variant' from 'const void *'
@ 2025-05-19 19:32 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-19 19:32 UTC (permalink / raw)
  To: Nuno Sá; +Cc: llvm, oe-kbuild-all, Nuno Sa

tree:   https://github.com/nunojsa/linux b4/dev-adp5589-fw
head:   0e85f43105aa62dc12515e1cd861a56e63b26e5d
commit: 856adcbce38d0b06ff00f64778d1094bf2521ea1 [7/21] mfd: adp5585: refactor how regmap defaults are handled
config: powerpc64-randconfig-001-20250520 (https://download.01.org/0day-ci/archive/20250520/202505200334.H4lCtBr0-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250520/202505200334.H4lCtBr0-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/202505200334.H4lCtBr0-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/mfd/adp5585.c:160:21: warning: cast to smaller integer type 'enum adp5585_variant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
     160 |         adp5585->variant = (enum adp5585_variant)i2c_get_match_data(i2c);
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +160 drivers/mfd/adp5585.c

   146	
   147	static int adp5585_i2c_probe(struct i2c_client *i2c)
   148	{
   149		struct regmap_config regmap_config;
   150		struct adp5585_dev *adp5585;
   151		unsigned int id;
   152		int ret;
   153	
   154		adp5585 = devm_kzalloc(&i2c->dev, sizeof(*adp5585), GFP_KERNEL);
   155		if (!adp5585)
   156			return -ENOMEM;
   157	
   158		i2c_set_clientdata(i2c, adp5585);
   159	
 > 160		adp5585->variant = (enum adp5585_variant)i2c_get_match_data(i2c);
   161		if (!adp5585->variant)
   162			return -ENODEV;
   163	
   164		adp5585_fill_regmap_config(adp5585, &regmap_config);
   165	
   166		adp5585->regmap = devm_regmap_init_i2c(i2c, &regmap_config);
   167		if (IS_ERR(adp5585->regmap))
   168			return dev_err_probe(&i2c->dev, PTR_ERR(adp5585->regmap),
   169					     "Failed to initialize register map\n");
   170	
   171		ret = regmap_read(adp5585->regmap, ADP5585_ID, &id);
   172		if (ret)
   173			return dev_err_probe(&i2c->dev, ret,
   174					     "Failed to read device ID\n");
   175	
   176		if ((id & ADP5585_MAN_ID_MASK) != ADP5585_MAN_ID_VALUE)
   177			return dev_err_probe(&i2c->dev, -ENODEV,
   178					     "Invalid device ID 0x%02x\n", id);
   179	
   180		/*
   181		 * Enable the internal oscillator, as it's shared between multiple
   182		 * functions.
   183		 *
   184		 * As a future improvement, power consumption could possibly be
   185		 * decreased in some use cases by enabling and disabling the oscillator
   186		 * dynamically based on the needs of the child drivers.
   187		 */
   188		ret = regmap_set_bits(adp5585->regmap, ADP5585_GENERAL_CFG, ADP5585_OSC_EN);
   189		if (ret)
   190			return ret;
   191	
   192		ret = devm_add_action_or_reset(&i2c->dev, adp5585_osc_disable, adp5585);
   193		if (ret)
   194			return ret;
   195	
   196		return adp5585_add_devices(&i2c->dev);
   197	}
   198	

-- 
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:[~2025-05-19 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 19:32 [nsa:b4/dev-adp5589-fw 7/21] drivers/mfd/adp5585.c:160:21: warning: cast to smaller integer type 'enum adp5585_variant' from 'const void *' 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