public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Wolfram Sang <wsa-dev@sang-engineering.com>,
	Ray Jui <ray.jui@broadcom.com>
Subject: drivers/i2c/busses/i2c-bcm-iproc.c:871:3: warning: cast to smaller integer type 'enum bcm_iproc_i2c_type' from 'const void *'
Date: Tue, 25 Feb 2025 06:51:42 +0800	[thread overview]
Message-ID: <202502250655.7lohuY6f-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d082ecbc71e9e0bf49883ee4afd435a77a5101b6
commit: 9a1038728037521d177042522bd05c3c51e744a4 i2c: iproc: add NIC I2C support
date:   6 years ago
config: x86_64-buildonly-randconfig-006-20250127 (https://download.01.org/0day-ci/archive/20250225/202502250655.7lohuY6f-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250225/202502250655.7lohuY6f-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/202502250655.7lohuY6f-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/i2c/busses/i2c-bcm-iproc.c:871:3: warning: cast to smaller integer type 'enum bcm_iproc_i2c_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
     871 |                 (enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +871 drivers/i2c/busses/i2c-bcm-iproc.c

   855	
   856	static int bcm_iproc_i2c_probe(struct platform_device *pdev)
   857	{
   858		int irq, ret = 0;
   859		struct bcm_iproc_i2c_dev *iproc_i2c;
   860		struct i2c_adapter *adap;
   861		struct resource *res;
   862	
   863		iproc_i2c = devm_kzalloc(&pdev->dev, sizeof(*iproc_i2c),
   864					 GFP_KERNEL);
   865		if (!iproc_i2c)
   866			return -ENOMEM;
   867	
   868		platform_set_drvdata(pdev, iproc_i2c);
   869		iproc_i2c->device = &pdev->dev;
   870		iproc_i2c->type =
 > 871			(enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev);
   872		init_completion(&iproc_i2c->done);
   873	
   874		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   875		iproc_i2c->base = devm_ioremap_resource(iproc_i2c->device, res);
   876		if (IS_ERR(iproc_i2c->base))
   877			return PTR_ERR(iproc_i2c->base);
   878	
   879		if (iproc_i2c->type == IPROC_I2C_NIC) {
   880			res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
   881			iproc_i2c->idm_base = devm_ioremap_resource(iproc_i2c->device,
   882								    res);
   883			if (IS_ERR(iproc_i2c->idm_base))
   884				return PTR_ERR(iproc_i2c->idm_base);
   885	
   886			ret = of_property_read_u32(iproc_i2c->device->of_node,
   887						   "brcm,ape-hsls-addr-mask",
   888						   &iproc_i2c->ape_addr_mask);
   889			if (ret < 0) {
   890				dev_err(iproc_i2c->device,
   891					"'brcm,ape-hsls-addr-mask' missing\n");
   892				return -EINVAL;
   893			}
   894	
   895			spin_lock_init(&iproc_i2c->idm_lock);
   896	
   897			/* no slave support */
   898			bcm_iproc_algo.reg_slave = NULL;
   899			bcm_iproc_algo.unreg_slave = NULL;
   900		}
   901	
   902		ret = bcm_iproc_i2c_init(iproc_i2c);
   903		if (ret)
   904			return ret;
   905	
   906		ret = bcm_iproc_i2c_cfg_speed(iproc_i2c);
   907		if (ret)
   908			return ret;
   909	
   910		irq = platform_get_irq(pdev, 0);
   911		if (irq > 0) {
   912			ret = devm_request_irq(iproc_i2c->device, irq,
   913					       bcm_iproc_i2c_isr, 0, pdev->name,
   914					       iproc_i2c);
   915			if (ret < 0) {
   916				dev_err(iproc_i2c->device,
   917					"unable to request irq %i\n", irq);
   918				return ret;
   919			}
   920	
   921			iproc_i2c->irq = irq;
   922		} else {
   923			dev_warn(iproc_i2c->device,
   924				 "no irq resource, falling back to poll mode\n");
   925		}
   926	
   927		bcm_iproc_i2c_enable_disable(iproc_i2c, true);
   928	
   929		adap = &iproc_i2c->adapter;
   930		i2c_set_adapdata(adap, iproc_i2c);
   931		strlcpy(adap->name, "Broadcom iProc I2C adapter", sizeof(adap->name));
   932		adap->algo = &bcm_iproc_algo;
   933		adap->quirks = &bcm_iproc_i2c_quirks;
   934		adap->dev.parent = &pdev->dev;
   935		adap->dev.of_node = pdev->dev.of_node;
   936	
   937		return i2c_add_adapter(adap);
   938	}
   939	

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

                 reply	other threads:[~2025-02-24 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=202502250655.7lohuY6f-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ray.jui@broadcom.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=wsa-dev@sang-engineering.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