From: kernel test robot <lkp@intel.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>
Subject: drivers/macintosh/windfarm_lm75_sensor.c:70:21: sparse: sparse: cast to restricted __le16
Date: Mon, 20 Nov 2023 04:37:31 +0800 [thread overview]
Message-ID: <202311200432.ia1Xs5Jj-lkp@intel.com> (raw)
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@intel.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@linux-fr.org>
:::::: CC: Jean Delvare <khali@linux-fr.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-11-19 20:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202311200432.ia1Xs5Jj-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=nathan@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®