[groeck-staging:hwmon-next 20/26] drivers/hwmon/pmbus/mp2975.c:708:19: warning: cast to smaller integer type 'enum chips' from 'const void *'

[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:   72f5d19d9dc4c90107105e13c530854eea1aac15
commit: 6e990f130ea09ec77150e2bd0f5c8795cd739e4b [20/26] hwmon: (pmbus/mp2975) Prepare for MP2973 and MP2971
config: arm64-randconfig-r014-20230718 (https://download.01.org/0day-ci/archive/20230719/202307192338.wM4zBtXS-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230719/202307192338.wM4zBtXS-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307192338.wM4zBtXS-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/hwmon/pmbus/mp2975.c:708:19: warning: cast to smaller integer type 'enum chips' from 'const void *' [-Wvoid-pointer-to-enum-cast]
                   data->chip_id = (enum chips)of_device_get_match_data(&client->dev);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +708 drivers/hwmon/pmbus/mp2975.c

   695	
   696	static int mp2975_probe(struct i2c_client *client)
   697	{
   698		struct pmbus_driver_info *info;
   699		struct mp2975_data *data;
   700		int ret;
   701	
   702		data = devm_kzalloc(&client->dev, sizeof(struct mp2975_data),
   703				    GFP_KERNEL);
   704		if (!data)
   705			return -ENOMEM;
   706	
   707		if (client->dev.of_node)
 > 708			data->chip_id = (enum chips)of_device_get_match_data(&client->dev);
   709		else
   710			data->chip_id = i2c_match_id(mp2975_id, client)->driver_data;
   711	
   712		memcpy(&data->info, &mp2975_info, sizeof(*info));
   713		info = &data->info;
   714	
   715		/* Identify multiphase configuration for rail 2. */
   716		ret = mp2975_identify_multiphase_rail2(client);
   717		if (ret < 0)
   718			return ret;
   719	
   720		if (ret) {
   721			/* Two rails are connected. */
   722			data->info.pages = MP2975_PAGE_NUM;
   723			data->info.phases[1] = ret;
   724			data->info.func[1] = MP2975_RAIL2_FUNC;
   725		}
   726	
   727		/* Identify multiphase configuration. */
   728		ret = mp2975_identify_multiphase(client, data, info);
   729		if (ret)
   730			return ret;
   731	
   732		/* Identify VID setting per rail. */
   733		ret = mp2975_identify_rails_vid(client, data, info);
   734		if (ret < 0)
   735			return ret;
   736	
   737		/* Obtain current sense gain of power stage. */
   738		ret = mp2975_current_sense_gain_get(client, data);
   739		if (ret)
   740			return ret;
   741	
   742		/* Obtain voltage reference values. */
   743		ret = mp2975_vref_get(client, data, info);
   744		if (ret)
   745			return ret;
   746	
   747		/* Obtain vout over-voltage scales. */
   748		ret = mp2975_vout_ov_scale_get(client, data, info);
   749		if (ret < 0)
   750			return ret;
   751	
   752		/* Obtain offsets, maximum and format for vout. */
   753		ret = mp2975_vout_per_rail_config_get(client, data, info);
   754		if (ret)
   755			return ret;
   756	
   757		return pmbus_do_probe(client, info);
   758	}
   759	

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



[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