[j.anaszewski-leds:for-5.2 5/5] drivers//leds/leds-pca9532.c:536:11: warning: cast from pointer to integer of different size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git for-5.2
head:   f83802616b58c9891152a6f414d37716bc224479
commit: f83802616b58c9891152a6f414d37716bc224479 [5/5] leds: fix a potential NULL pointer dereference
config: x86_64-randconfig-x015-201910 (attached as .config)
compiler: gcc-8 (Debian 8.2.0-21) 8.2.0
reproduce:
        git checkout f83802616b58c9891152a6f414d37716bc224479
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers//leds/leds-pca9532.c: In function 'pca9532_probe':
>> drivers//leds/leds-pca9532.c:536:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      devid = (int)of_id->data;
              ^

vim +536 drivers//leds/leds-pca9532.c

   511	
   512	static int pca9532_probe(struct i2c_client *client,
   513		const struct i2c_device_id *id)
   514	{
   515		int devid;
   516		const struct of_device_id *of_id;
   517		struct pca9532_data *data = i2c_get_clientdata(client);
   518		struct pca9532_platform_data *pca9532_pdata =
   519				dev_get_platdata(&client->dev);
   520		struct device_node *np = client->dev.of_node;
   521	
   522		if (!pca9532_pdata) {
   523			if (np) {
   524				pca9532_pdata =
   525					pca9532_of_populate_pdata(&client->dev, np);
   526				if (IS_ERR(pca9532_pdata))
   527					return PTR_ERR(pca9532_pdata);
   528			} else {
   529				dev_err(&client->dev, "no platform data\n");
   530				return -EINVAL;
   531			}
   532			of_id = of_match_device(of_pca9532_leds_match,
   533					&client->dev);
   534			if (unlikely(!of_id))
   535				return -EINVAL;
 > 536			devid = (int)of_id->data;
   537		} else {
   538			devid = id->driver_data;
   539		}
   540	
   541		if (!i2c_check_functionality(client->adapter,
   542			I2C_FUNC_SMBUS_BYTE_DATA))
   543			return -EIO;
   544	
   545		data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
   546		if (!data)
   547			return -ENOMEM;
   548	
   549		data->chip_info = &pca9532_chip_info_tbl[devid];
   550	
   551		dev_info(&client->dev, "setting platform data\n");
   552		i2c_set_clientdata(client, data);
   553		data->client = client;
   554		mutex_init(&data->update_lock);
   555	
   556		return pca9532_configure(client, data, pca9532_pdata);
   557	}
   558	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux