[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202311200432.ia1Xs5Jj-lkp@intel.com>
Date: Mon, 20 Nov 2023 04:37:31 +0800
From: kernel test robot <lkp@...el.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Michael Ellerman <mpe@...erman.id.au>
Subject: drivers/macintosh/windfarm_lm75_sensor.c:70:21: sparse: sparse: cast
to restricted __le16
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 037266a5f7239ead1530266f7d7af153d2a867fa
commit: 748ea32d2dbd813d3bd958117bde5191182f909a macintosh: windfarm: Use unsigned type for 1-bit bitfields
date: 9 months ago
config: powerpc64-randconfig-r121-20231119 (https://download.01.org/0day-ci/archive/20231120/202311200432.ia1Xs5Jj-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231120/202311200432.ia1Xs5Jj-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311200432.ia1Xs5Jj-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/macintosh/windfarm_lm75_sensor.c:70:21: sparse: sparse: cast to restricted __le16
vim +70 drivers/macintosh/windfarm_lm75_sensor.c
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 42
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 43 static int wf_lm75_get(struct wf_sensor *sr, s32 *value)
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 44 {
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 45 struct wf_lm75_sensor *lm = wf_to_lm75(sr);
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 46 s32 data;
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 47
351ca3e3119792 Jean Delvare 2009-06-15 48 if (lm->i2c == NULL)
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 49 return -ENODEV;
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 50
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 51 /* Init chip if necessary */
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 52 if (!lm->inited) {
351ca3e3119792 Jean Delvare 2009-06-15 53 u8 cfg_new, cfg = (u8)i2c_smbus_read_byte_data(lm->i2c, 1);
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 54
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 55 DBG("wf_lm75: Initializing %s, cfg was: %02x\n",
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 56 sr->name, cfg);
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 57
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 58 /* clear shutdown bit, keep other settings as left by
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 59 * the firmware for now
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 60 */
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 61 cfg_new = cfg & ~0x01;
351ca3e3119792 Jean Delvare 2009-06-15 62 i2c_smbus_write_byte_data(lm->i2c, 1, cfg_new);
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 63 lm->inited = 1;
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 64
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 65 /* If we just powered it up, let's wait 200 ms */
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 66 msleep(200);
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 67 }
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 68
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 69 /* Read temperature register */
351ca3e3119792 Jean Delvare 2009-06-15 @70 data = (s32)le16_to_cpu(i2c_smbus_read_word_data(lm->i2c, 0));
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 71 data <<= 8;
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 72 *value = data;
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 73
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 74 return 0;
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 75 }
75722d3992f573 Benjamin Herrenschmidt 2005-11-07 76
:::::: The code at line 70 was first introduced by commit
:::::: 351ca3e31197929535418f5affc761cd9fb07428 windfarm: Convert to new-style i2c drivers
:::::: TO: Jean Delvare <khali@...ux-fr.org>
:::::: CC: Jean Delvare <khali@...ux-fr.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists