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

tree:   https://github.com/AsahiLinux/linux bits/260-spmi-typec
head:   41abbd4a14cc0f4c24128042de99a658a83e1dde
commit: 41abbd4a14cc0f4c24128042de99a658a83e1dde [13/13] usb: typec: tipd: Add sn201202x support
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20260827/202608270849.G0CjUC7w-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/202608270849.G0CjUC7w-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/202608270849.G0CjUC7w-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/usb/typec/tipd/spmi.c:176:26: warning: cast to smaller integer type 'enum tipd_hw_variant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
     176 |         data = tipd_hw_variants[(enum tipd_hw_variant)match->data];
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +176 drivers/usb/typec/tipd/spmi.c

   163	
   164	static int sn201202x_probe(struct spmi_device *device)
   165	{
   166		const struct of_device_id *match;
   167		const struct tipd_data *data;
   168		struct sn201202x *sn;
   169		struct tps6598x *tps;
   170		int irq_select, irq_sleep, irq_wake;
   171		int ret;
   172	
   173		match = of_match_device(sn201202x_of_match, &device->dev);
   174		if (!match)
   175			return -EINVAL;
 > 176		data = tipd_hw_variants[(enum tipd_hw_variant)match->data];
   177	
   178		sn = devm_kzalloc(&device->dev, data->tps_struct_size, GFP_KERNEL);
   179		if (!sn)
   180			return -ENOMEM;
   181		sn->sdev = device;
   182		tps = &sn->cd.tps;
   183	
   184		mutex_init(&tps->lock);
   185		tps->dev = &device->dev;
   186		tps->data = data;
   187	
   188		tps->irq = of_irq_get_byname(device->dev.of_node, "irq");
   189		if (tps->irq < 0)
   190			return tps->irq;
   191		irq_select = of_irq_get_byname(device->dev.of_node, "select");
   192		if (irq_select < 0)
   193			return irq_select;
   194		irq_sleep = of_irq_get_byname(device->dev.of_node, "sleep");
   195		if (irq_sleep < 0)
   196			return irq_sleep;
   197		irq_wake = of_irq_get_byname(device->dev.of_node, "wake");
   198		if (irq_wake < 0)
   199			return irq_wake;
   200	
   201		init_completion(&sn->select_completion);
   202		init_completion(&sn->sleep_completion);
   203		init_completion(&sn->wake_completion);
   204	
   205		ret = devm_request_irq(&device->dev, irq_select, sn201202x_irq,
   206				       0, NULL, &sn->select_completion);
   207		if (ret)
   208			return ret;
   209		ret = devm_request_irq(&device->dev, irq_sleep, sn201202x_irq,
   210				       0, NULL, &sn->sleep_completion);
   211		if (ret)
   212			return ret;
   213		ret = devm_request_irq(&device->dev, irq_wake, sn201202x_irq,
   214				       0, NULL, &sn->wake_completion);
   215		if (ret)
   216			return ret;
   217	
   218		spmi_device_set_drvdata(device, tps);
   219		tps->regmap = devm_regmap_init_sn201202x(device, &tps6598x_regmap_config);
   220		if (IS_ERR(tps->regmap))
   221			return PTR_ERR(tps->regmap);
   222	
   223		ret = spmi_command_wakeup(device);
   224		if (ret)
   225			return ret;
   226		if (!wait_for_completion_timeout(&sn->wake_completion, msecs_to_jiffies(100)))
   227			return -ETIMEDOUT;
   228	
   229		ret = tipd_init(tps);
   230		if (ret)
   231			spmi_command_sleep(device);
   232		return ret;
   233	}
   234	

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

                 reply	other threads:[~2026-08-27  0:26 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=202608270849.G0CjUC7w-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amilburn@zall.org \
    --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