Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Nuno Sa <noname.nuno@gmail.com>
Subject: [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 *'
Date: Tue, 20 May 2025 03:32:39 +0800	[thread overview]
Message-ID: <202505200334.H4lCtBr0-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-05-19 19:33 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=202505200334.H4lCtBr0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=noname.nuno@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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