Re: [PATCH v4] hwmon/pmbus: use simple i2c probe function

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

 



Hi Stephen,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bcf876870b95592b52519ed4aafcf9d95999bc9c]

url:    https://github.com/0day-ci/linux/commits/Stephen-Kitt/hwmon-pmbus-use-simple-i2c-probe-function/20200809-025818
base:    bcf876870b95592b52519ed4aafcf9d95999bc9c
config: x86_64-randconfig-a006-20200809 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 0b90a08f7722980f6074c6eada8022242408cdb4)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/hwmon/pmbus/ltc2978.c:678:5: warning: format specifies type 'int' but the argument has type 'kernel_ulong_t' (aka 'unsigned long') [-Wformat]
                            id->driver_data,
                            ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:106:33: note: expanded from macro 'dev_warn'
           _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                  ~~~     ^~~~~~~~~~~
   1 warning generated.

vim +678 drivers/hwmon/pmbus/ltc2978.c

   651	
   652	static int ltc2978_probe(struct i2c_client *client)
   653	{
   654		int i, chip_id;
   655		struct ltc2978_data *data;
   656		struct pmbus_driver_info *info;
   657		const struct i2c_device_id *id;
   658	
   659		if (!i2c_check_functionality(client->adapter,
   660					     I2C_FUNC_SMBUS_READ_WORD_DATA))
   661			return -ENODEV;
   662	
   663		data = devm_kzalloc(&client->dev, sizeof(struct ltc2978_data),
   664				    GFP_KERNEL);
   665		if (!data)
   666			return -ENOMEM;
   667	
   668		chip_id = ltc2978_get_id(client);
   669		if (chip_id < 0)
   670			return chip_id;
   671	
   672		data->id = chip_id;
   673		id = i2c_match_id(ltc2978_id, client);
   674		if (data->id != id->driver_data)
   675			dev_warn(&client->dev,
   676				 "Device mismatch: Configured %s (%d), detected %d\n",
   677				 id->name,
 > 678				 id->driver_data,
   679				 chip_id);
   680	
   681		info = &data->info;
   682		info->write_word_data = ltc2978_write_word_data;
   683		info->write_byte = ltc_write_byte;
   684		info->read_word_data = ltc_read_word_data;
   685		info->read_byte_data = ltc_read_byte_data;
   686	
   687		data->vin_min = 0x7bff;
   688		data->vin_max = 0x7c00;
   689		for (i = 0; i < ARRAY_SIZE(data->vout_min); i++)
   690			data->vout_min[i] = 0xffff;
   691		for (i = 0; i < ARRAY_SIZE(data->iout_min); i++)
   692			data->iout_min[i] = 0xfbff;
   693		for (i = 0; i < ARRAY_SIZE(data->iout_max); i++)
   694			data->iout_max[i] = 0x7c00;
   695		for (i = 0; i < ARRAY_SIZE(data->temp_min); i++)
   696			data->temp_min[i] = 0x7bff;
   697		for (i = 0; i < ARRAY_SIZE(data->temp_max); i++)
   698			data->temp_max[i] = 0x7c00;
   699		data->temp2_max = 0x7c00;
   700	
   701		switch (data->id) {
   702		case ltc2972:
   703			info->read_word_data = ltc2975_read_word_data;
   704			info->pages = LTC2972_NUM_PAGES;
   705			info->func[0] = PMBUS_HAVE_IIN | PMBUS_HAVE_PIN
   706			  | PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
   707			  | PMBUS_HAVE_TEMP2;
   708			for (i = 0; i < info->pages; i++) {
   709				info->func[i] |= PMBUS_HAVE_VOUT
   710				  | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_POUT
   711				  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
   712				  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
   713			}
   714			break;
   715		case ltc2974:
   716			info->read_word_data = ltc2974_read_word_data;
   717			info->pages = LTC2974_NUM_PAGES;
   718			info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
   719			  | PMBUS_HAVE_TEMP2;
   720			for (i = 0; i < info->pages; i++) {
   721				info->func[i] |= PMBUS_HAVE_VOUT
   722				  | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_POUT
   723				  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
   724				  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
   725			}
   726			break;
   727		case ltc2975:
   728			info->read_word_data = ltc2975_read_word_data;
   729			info->pages = LTC2974_NUM_PAGES;
   730			info->func[0] = PMBUS_HAVE_IIN | PMBUS_HAVE_PIN
   731			  | PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
   732			  | PMBUS_HAVE_TEMP2;
   733			for (i = 0; i < info->pages; i++) {
   734				info->func[i] |= PMBUS_HAVE_VOUT
   735				  | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_POUT
   736				  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP
   737				  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
   738			}
   739			break;
   740	
   741		case ltc2977:
   742		case ltc2978:
   743		case ltc2979:
   744		case ltc2980:
   745		case ltm2987:
   746			info->read_word_data = ltc2978_read_word_data;
   747			info->pages = LTC2978_NUM_PAGES;
   748			info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
   749			  | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   750			  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
   751			for (i = 1; i < LTC2978_NUM_PAGES; i++) {
   752				info->func[i] = PMBUS_HAVE_VOUT
   753				  | PMBUS_HAVE_STATUS_VOUT;
   754			}
   755			break;
   756		case ltc3880:
   757		case ltc3887:
   758		case ltm4675:
   759		case ltm4676:
   760		case ltm4677:
   761		case ltm4686:
   762			data->features |= FEAT_CLEAR_PEAKS | FEAT_NEEDS_POLLING;
   763			info->read_word_data = ltc3880_read_word_data;
   764			info->pages = LTC3880_NUM_PAGES;
   765			info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
   766			  | PMBUS_HAVE_STATUS_INPUT
   767			  | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   768			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   769			  | PMBUS_HAVE_POUT | PMBUS_HAVE_TEMP
   770			  | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP;
   771			info->func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   772			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   773			  | PMBUS_HAVE_POUT
   774			  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
   775			break;
   776		case ltc3882:
   777			data->features |= FEAT_CLEAR_PEAKS | FEAT_NEEDS_POLLING;
   778			info->read_word_data = ltc3880_read_word_data;
   779			info->pages = LTC3880_NUM_PAGES;
   780			info->func[0] = PMBUS_HAVE_VIN
   781			  | PMBUS_HAVE_STATUS_INPUT
   782			  | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   783			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   784			  | PMBUS_HAVE_POUT | PMBUS_HAVE_TEMP
   785			  | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP;
   786			info->func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   787			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   788			  | PMBUS_HAVE_POUT
   789			  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
   790			break;
   791		case ltc3883:
   792			data->features |= FEAT_CLEAR_PEAKS | FEAT_NEEDS_POLLING;
   793			info->read_word_data = ltc3883_read_word_data;
   794			info->pages = LTC3883_NUM_PAGES;
   795			info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
   796			  | PMBUS_HAVE_STATUS_INPUT
   797			  | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   798			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   799			  | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT | PMBUS_HAVE_TEMP
   800			  | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP;
   801			break;
   802		case ltc3884:
   803		case ltc3886:
   804		case ltc3889:
   805		case ltc7880:
   806		case ltm4664:
   807		case ltm4678:
   808		case ltm4680:
   809		case ltm4700:
   810			data->features |= FEAT_CLEAR_PEAKS | FEAT_NEEDS_POLLING;
   811			info->read_word_data = ltc3883_read_word_data;
   812			info->pages = LTC3880_NUM_PAGES;
   813			info->func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN
   814			  | PMBUS_HAVE_STATUS_INPUT
   815			  | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   816			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   817			  | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT | PMBUS_HAVE_TEMP
   818			  | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_STATUS_TEMP;
   819			info->func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
   820			  | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
   821			  | PMBUS_HAVE_POUT
   822			  | PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
   823			break;
   824		default:
   825			return -ENODEV;
   826		}
   827	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux