All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Sasha Finkelstein <k@chaosmail.tech>
Cc: oe-kbuild-all@lists.linux.dev, Janne Grunau <j@jannau.net>,
	Alyssa Milburn <amilburn@zall.org>
Subject: [asahilinux:bits/260-spmi-typec 12/15] drivers/usb/typec/tipd/spmi.c:176:26: warning: cast to smaller integer type 'enum tipd_hw_variant' from 'const void *'
Date: Sun, 08 Nov 2026 04:14:31 +0100	[thread overview]
Message-ID: <202611080428.AAVT8FvP-lkp@intel.com> (raw)

tree:   https://github.com/AsahiLinux/linux bits/260-spmi-typec
head:   c062a0671e439cd6cfa9df139ad50ce6d70222bf
commit: 182351610fe370f1017a17255f3e394f9ee062c4 [12/15] usb: typec: tipd: Add sn201202x support
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20261108/202611080428.AAVT8FvP-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261108/202611080428.AAVT8FvP-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/202611080428.AAVT8FvP-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-11-08  3:15 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=202611080428.AAVT8FvP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amilburn@zall.org \
    --cc=j@jannau.net \
    --cc=k@chaosmail.tech \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.