llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yassine Oudjana <y.oudjana@protonmail.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Chanwoo Choi <cw00.choi@samsung.com>
Subject: [linux-next:master 2223/2463] drivers/extcon/extcon-usbc-tusb320.c:250:15: warning: cast to smaller integer type 'enum tusb320_type' from 'const void *'
Date: Thu, 16 Sep 2021 23:57:34 +0800	[thread overview]
Message-ID: <202109162332.tZTsTM76-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4222 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   368847b165bbfbdcf0bd4c96b167893dcdb13aba
commit: 2bd5f4798ae081e30e61668ae016ca473812acce [2223/2463] extcon: usbc-tusb320: Add support for TUSB320L
config: x86_64-randconfig-r034-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=2bd5f4798ae081e30e61668ae016ca473812acce
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 2bd5f4798ae081e30e61668ae016ca473812acce
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/extcon/extcon-usbc-tusb320.c:250:15: warning: cast to smaller integer type 'enum tusb320_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
           priv->type = (enum tusb320_type)match_data;
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +250 drivers/extcon/extcon-usbc-tusb320.c

   224	
   225	static int tusb320_extcon_probe(struct i2c_client *client,
   226					const struct i2c_device_id *id)
   227	{
   228		struct tusb320_priv *priv;
   229		const void *match_data;
   230		unsigned int revision;
   231		int ret;
   232	
   233		priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
   234		if (!priv)
   235			return -ENOMEM;
   236		priv->dev = &client->dev;
   237	
   238		priv->regmap = devm_regmap_init_i2c(client, &tusb320_regmap_config);
   239		if (IS_ERR(priv->regmap))
   240			return PTR_ERR(priv->regmap);
   241	
   242		ret = tusb320_check_signature(priv);
   243		if (ret)
   244			return ret;
   245	
   246		match_data = device_get_match_data(&client->dev);
   247		if (!match_data)
   248			return -EINVAL;
   249	
 > 250		priv->type = (enum tusb320_type)match_data;
   251	
   252		priv->edev = devm_extcon_dev_allocate(priv->dev, tusb320_extcon_cable);
   253		if (IS_ERR(priv->edev)) {
   254			dev_err(priv->dev, "failed to allocate extcon device\n");
   255			return PTR_ERR(priv->edev);
   256		}
   257	
   258		if (priv->type == TYPE_TUSB320L) {
   259			ret = regmap_read(priv->regmap, TUSB320L_REGA0_REVISION, &revision);
   260	
   261			if (ret)
   262				dev_warn(priv->dev,
   263					"failed to read revision register: %d\n", ret);
   264			else
   265				dev_info(priv->dev, "chip revision %d\n", revision);
   266		}
   267	
   268		ret = devm_extcon_dev_register(priv->dev, priv->edev);
   269		if (ret < 0) {
   270			dev_err(priv->dev, "failed to register extcon device\n");
   271			return ret;
   272		}
   273	
   274		extcon_set_property_capability(priv->edev, EXTCON_USB,
   275					       EXTCON_PROP_USB_TYPEC_POLARITY);
   276		extcon_set_property_capability(priv->edev, EXTCON_USB_HOST,
   277					       EXTCON_PROP_USB_TYPEC_POLARITY);
   278	
   279		/* update initial state */
   280		tusb320_irq_handler(client->irq, priv);
   281	
   282		/* Reset chip to its default state */
   283		ret = tusb320_reset(priv);
   284		if (ret)
   285			dev_warn(priv->dev, "failed to reset chip: %d\n", ret);
   286		else
   287			/*
   288			 * State and polarity might change after a reset, so update
   289			 * them again and make sure the interrupt status bit is cleared.
   290			 */
   291			tusb320_irq_handler(client->irq, priv);
   292	
   293		ret = devm_request_threaded_irq(priv->dev, client->irq, NULL,
   294						tusb320_irq_handler,
   295						IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
   296						client->name, priv);
   297	
   298		return ret;
   299	}
   300	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31365 bytes --]

             reply	other threads:[~2021-09-16 15:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210916155808epcas1p297ee826afd77e98bd9a28aabd151cee6@epcas1p2.samsung.com>
2021-09-16 15:57 ` kernel test robot [this message]
2021-09-23  1:44   ` [linux-next:master 2223/2463] drivers/extcon/extcon-usbc-tusb320.c:250:15: warning: cast to smaller integer type 'enum tusb320_type' from 'const void *' Chanwoo Choi

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=202109162332.tZTsTM76-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cw00.choi@samsung.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=y.oudjana@protonmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).