[hwmon:hwmon-next 119/119] drivers/hwmon/max6650.c:798:10: warning: passing argument 2 of 'thermal_of_cooling_device_register' discards 'const' qualifier from pointer target type

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   11d9bd51ecfe00a422920854d9585417f153cf99
commit: 11d9bd51ecfe00a422920854d9585417f153cf99 [119/119] hwmon: (max6650) add thermal cooling device capability
config: x86_64-rhel (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 11d9bd51ecfe00a422920854d9585417f153cf99
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


All warnings (new ones prefixed by >>):

   drivers/hwmon/max6650.c: In function 'max6650_probe':
>> drivers/hwmon/max6650.c:798:10: warning: passing argument 2 of 'thermal_of_cooling_device_register' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
             id->name, data,
             ^~
   In file included from drivers/hwmon/max6650.c:43:0:
   include/linux/thermal.h:448:1: note: expected 'char *' but argument is of type 'const char *'
    thermal_of_cooling_device_register(struct device_node *np, char *, void *,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/i2c.h:30:0,
                    from drivers/hwmon/max6650.c:38:
>> drivers/hwmon/max6650.c:802:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
        "thermal cooling device register failed: %d\n",
        ^
   include/linux/device.h:1400:22: note: in definition of macro 'dev_fmt'
    #define dev_fmt(fmt) fmt
                         ^~~
>> drivers/hwmon/max6650.c:801:3: note: in expansion of macro 'dev_warn'
      dev_warn(&client->dev,
      ^~~~~~~~

vim +798 drivers/hwmon/max6650.c

   756	
   757	static int max6650_probe(struct i2c_client *client,
   758				 const struct i2c_device_id *id)
   759	{
   760		struct device *dev = &client->dev;
   761		const struct of_device_id *of_id =
   762			of_match_device(of_match_ptr(max6650_dt_match), dev);
   763		struct max6650_data *data;
   764		struct device *hwmon_dev;
   765		int err;
   766	
   767		data = devm_kzalloc(dev, sizeof(struct max6650_data), GFP_KERNEL);
   768		if (!data)
   769			return -ENOMEM;
   770	
   771		data->client = client;
   772		i2c_set_clientdata(client, data);
   773		mutex_init(&data->update_lock);
   774		data->nr_fans = of_id ? (int)(uintptr_t)of_id->data : id->driver_data;
   775	
   776		/*
   777		 * Initialize the max6650 chip
   778		 */
   779		err = max6650_init_client(data, client);
   780		if (err)
   781			return err;
   782	
   783		data->groups[0] = &max6650_group;
   784		/* 3 additional fan inputs for the MAX6651 */
   785		if (data->nr_fans == 4)
   786			data->groups[1] = &max6651_group;
   787	
   788		hwmon_dev = devm_hwmon_device_register_with_groups(dev,
   789								   client->name, data,
   790								   data->groups);
   791		err = PTR_ERR_OR_ZERO(hwmon_dev);
   792		if (err)
   793			return err;
   794	
   795	#if IS_ENABLED(CONFIG_THERMAL)
   796		data->cooling_dev =
   797			thermal_of_cooling_device_register(client->dev.of_node,
 > 798							   id->name, data,
   799							   &max6650_cooling_ops);
   800		if (IS_ERR(data->cooling_dev))
 > 801			dev_warn(&client->dev,
 > 802				 "thermal cooling device register failed: %d\n",
   803				 PTR_ERR(data->cooling_dev));
   804		else
   805			thermal_cdev_update(data->cooling_dev);
   806	#endif
   807		return 0;
   808	}
   809	

---
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