mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rob Herring <robh@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: drivers/regulator/da9121-regulator.c:1133:24: warning: cast to smaller integer type 'enum da9121_subvariant' from 'const void *'
Date: Tue, 3 Dec 2024 13:42:41 +0800	[thread overview]
Message-ID: <202412031346.i4MX8xOA-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cdd30ebb1b9f36159d66f088b61aee264e649d7a
commit: 46537a8676d6555141c4b98ec1bf5f3eea971128 regulator: da9121: Use i2c_get_match_data()
date:   1 year, 2 months ago
config: x86_64-randconfig-001-20240106 (https://download.01.org/0day-ci/archive/20241203/202412031346.i4MX8xOA-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241203/202412031346.i4MX8xOA-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/202412031346.i4MX8xOA-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/regulator/da9121-regulator.c:1133:24: warning: cast to smaller integer type 'enum da9121_subvariant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
    1133 |         chip->subvariant_id = (enum da9121_subvariant)i2c_get_match_data(i2c);
         |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +1133 drivers/regulator/da9121-regulator.c

  1119	
  1120	static int da9121_i2c_probe(struct i2c_client *i2c)
  1121	{
  1122		struct da9121 *chip;
  1123		const int mask_all[4] = { 0xFF, 0xFF, 0xFF, 0xFF };
  1124		int ret = 0;
  1125	
  1126		chip = devm_kzalloc(&i2c->dev, sizeof(struct da9121), GFP_KERNEL);
  1127		if (!chip) {
  1128			ret = -ENOMEM;
  1129			goto error;
  1130		}
  1131	
  1132		chip->pdata = i2c->dev.platform_data;
> 1133		chip->subvariant_id = (enum da9121_subvariant)i2c_get_match_data(i2c);
  1134	
  1135		ret = da9121_assign_chip_model(i2c, chip);
  1136		if (ret < 0)
  1137			goto error;
  1138	
  1139		ret = regmap_bulk_write(chip->regmap, DA9121_REG_SYS_MASK_0, mask_all, 4);
  1140		if (ret != 0) {
  1141			dev_err(chip->dev, "Failed to set IRQ masks: %d\n", ret);
  1142			goto error;
  1143		}
  1144	
  1145		ret = da9121_set_regulator_config(chip);
  1146		if (ret < 0)
  1147			goto error;
  1148	
  1149		ret = da9121_config_irq(i2c, chip);
  1150	
  1151	error:
  1152		return ret;
  1153	}
  1154	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-12-03  5:43 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=202412031346.i4MX8xOA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®