Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Alyssa Milburn <amilburn@zall.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Janne Grunau <j@jannau.net>, Sasha Finkelstein <k@chaosmail.tech>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: [asahilinux:bits/260-spmi-typec 12/13] drivers/usb/typec/tipd/i2c.c:21:12: warning: cast to smaller integer type 'enum tipd_hw_variant' from 'const void *'
Date: Thu, 27 Aug 2026 06:51:25 +0800	[thread overview]
Message-ID: <202608270643.2aUXW1ea-lkp@intel.com> (raw)

tree:   https://github.com/AsahiLinux/linux bits/260-spmi-typec
head:   41abbd4a14cc0f4c24128042de99a658a83e1dde
commit: c11cad9077f1a6d06b63e14a9ed37a2e8734e2c5 [12/13] usb: typec: tipd: Factor out i2c specifics
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20260827/202608270643.2aUXW1ea-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 771bdfdab2d66a4eb85b8ea7673cfa30152718b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260827/202608270643.2aUXW1ea-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/202608270643.2aUXW1ea-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/usb/typec/tipd/i2c.c:21:12: warning: cast to smaller integer type 'enum tipd_hw_variant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
      21 |         variant = (enum tipd_hw_variant)i2c_get_match_data(client);
         |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +21 drivers/usb/typec/tipd/i2c.c

    13	
    14	static int tps6598x_probe_i2c(struct i2c_client *client)
    15	{
    16		enum tipd_hw_variant variant;
    17		const struct tipd_data *data;
    18		struct tps6598x *tps;
    19		int ret;
    20	
  > 21		variant = (enum tipd_hw_variant)i2c_get_match_data(client);
    22		if (!variant || variant >= TIPD_VARIANT_MAX)
    23			return -EINVAL;
    24		data = tipd_hw_variants[variant];
    25	
    26		tps = devm_kzalloc(&client->dev, data->tps_struct_size, GFP_KERNEL);
    27		if (!tps)
    28			return -ENOMEM;
    29	
    30		mutex_init(&tps->lock);
    31		tps->dev = &client->dev;
    32		tps->data = data;
    33		tps->irq = client->irq;
    34	
    35		tps->regmap = devm_regmap_init_i2c(client, &tps6598x_regmap_config);
    36		if (IS_ERR(tps->regmap))
    37			return PTR_ERR(tps->regmap);
    38	
    39		/*
    40		 * Checking can the adapter handle SMBus protocol. If it can not, the
    41		 * driver needs to take care of block reads separately.
    42		 */
    43		if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
    44			tps->i2c_protocol = true;
    45	
    46		ret = tipd_init(tps);
    47	
    48		if (ret == 0)
    49			i2c_set_clientdata(client, tps);
    50	
    51		return ret;
    52	}
    53	

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

                 reply	other threads:[~2026-08-26 22:52 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=202608270643.2aUXW1ea-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amilburn@zall.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=j@jannau.net \
    --cc=k@chaosmail.tech \
    --cc=llvm@lists.linux.dev \
    --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