Re: [PATCH 1/2] drivers: hwmon: Add W83773G driver

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

 



Hi Lei,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on v4.14-rc7 next-20171103]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Lei-YU/Add-W83773G-hwmon-sensor-driver-and-doc/20171105-015016
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All warnings (new ones prefixed by >>):

   drivers//hwmon/w83773g.c: In function 'w83773_probe':
>> drivers//hwmon/w83773g.c:233:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      data->channels = (int)of_device_get_match_data(&client->dev);
                       ^

vim +233 drivers//hwmon/w83773g.c

   218	
   219	static int w83773_probe(struct i2c_client *client,
   220				const struct i2c_device_id *id)
   221	{
   222		struct device *dev = &client->dev;
   223		struct device *hwmon_dev;
   224		struct w83773_data *data;
   225		int i, err;
   226	
   227		data = devm_kzalloc(dev, sizeof(struct w83773_data), GFP_KERNEL);
   228		if (!data)
   229			return -ENOMEM;
   230	
   231		mutex_init(&data->update_lock);
   232		if (client->dev.of_node)
 > 233			data->channels = (int)of_device_get_match_data(&client->dev);
   234		else
   235			data->channels = id->driver_data;
   236		data->client = client;
   237	
   238		err = w83773_init_client(client);
   239		if (err)
   240			return err;
   241	
   242		for (i = 0; i < data->channels; i++)
   243			data->temp_config[i] = HWMON_T_INPUT | HWMON_T_FAULT;
   244	
   245		data->chip.ops = &w83773_ops;
   246		data->chip.info = data->info;
   247	
   248		data->info[0] = &data->temp_info;
   249	
   250		data->temp_info.type = hwmon_temp;
   251		data->temp_info.config = data->temp_config;
   252	
   253		hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
   254								 data,
   255								 &data->chip,
   256								 NULL);
   257		return PTR_ERR_OR_ZERO(hwmon_dev);
   258	}
   259	

---
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]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux