[groeck-staging:hwmon-next 3/10] drivers/hwmon/oxp-sensors.c:299:10: warning: cast to smaller integer type 'enum oxp_board' from '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:   92613681c0090612f0368dcebdcc232af9d74ae8
commit: bfae15559531b4aacd626152ffea929c27304dd8 [3/10] hwmon: (oxp-sensors) Use less convoluted enum cast
config: x86_64-randconfig-a006-20230508 (https://download.01.org/0day-ci/archive/20230508/202305081625.IMCuQoxj-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?id=bfae15559531b4aacd626152ffea929c27304dd8
        git remote add groeck-staging https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
        git fetch --no-tags groeck-staging hwmon-next
        git checkout bfae15559531b4aacd626152ffea929c27304dd8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hwmon/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202305081625.IMCuQoxj-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/hwmon/oxp-sensors.c:299:10: warning: cast to smaller integer type 'enum oxp_board' from 'void *' [-Wvoid-pointer-to-enum-cast]
           board = (enum oxp_board)dmi_entry->driver_data;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +299 drivers/hwmon/oxp-sensors.c

   280	
   281	/* Initialization logic */
   282	static int oxp_platform_probe(struct platform_device *pdev)
   283	{
   284		const struct dmi_system_id *dmi_entry;
   285		struct device *dev = &pdev->dev;
   286		struct device *hwdev;
   287	
   288		/*
   289		 * Have to check for AMD processor here because DMI strings are the
   290		 * same between Intel and AMD boards, the only way to tell them apart
   291		 * is the CPU.
   292		 * Intel boards seem to have different EC registers and values to
   293		 * read/write.
   294		 */
   295		dmi_entry = dmi_first_match(dmi_table);
   296		if (!dmi_entry || boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
   297			return -ENODEV;
   298	
 > 299		board = (enum oxp_board)dmi_entry->driver_data;
   300	
   301		hwdev = devm_hwmon_device_register_with_info(dev, "oxpec", NULL,
   302							     &oxp_ec_chip_info, NULL);
   303	
   304		return PTR_ERR_OR_ZERO(hwdev);
   305	}
   306	

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



[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