Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Cc: kbuild-all@lists.01.org, linux-hwmon@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>
Subject: [groeck-staging:hwmon-next 77/79] drivers/hwmon/tps23861.c:159:19: sparse: sparse: cast to restricted __le16
Date: Thu, 21 Jul 2022 18:41:40 +0800	[thread overview]
Message-ID: <202207211843.3aLaNmh9-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   5668b5e6cffd975632ee6c32802d7d877b98e9a4
commit: 7024d59f146ea99d95b7f238e9991f32f31496b0 [77/79] hwmon: (tps23861) fix byte order in current and voltage registers
config: alpha-randconfig-s053-20220720 (https://download.01.org/0day-ci/archive/20220721/202207211843.3aLaNmh9-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?id=7024d59f146ea99d95b7f238e9991f32f31496b0
        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 7024d59f146ea99d95b7f238e9991f32f31496b0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash drivers/hwmon/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/hwmon/tps23861.c:159:19: sparse: sparse: cast to restricted __le16
   drivers/hwmon/tps23861.c:184:19: sparse: sparse: cast to restricted __le16

vim +159 drivers/hwmon/tps23861.c

   139	
   140	static int tps23861_read_voltage(struct tps23861_data *data, int channel,
   141					 long *val)
   142	{
   143		uint16_t regval;
   144		long raw_val;
   145		int err;
   146	
   147		if (channel < TPS23861_NUM_PORTS) {
   148			err = regmap_bulk_read(data->regmap,
   149					       PORT_1_VOLTAGE_LSB + channel * PORT_N_VOLTAGE_LSB_OFFSET,
   150					       &regval, 2);
   151		} else {
   152			err = regmap_bulk_read(data->regmap,
   153					       INPUT_VOLTAGE_LSB,
   154					       &regval, 2);
   155		}
   156		if (err < 0)
   157			return err;
   158	
 > 159		raw_val = le16_to_cpu(regval);
   160		*val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * VOLTAGE_LSB) / 1000;
   161	
   162		return 0;
   163	}
   164	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-07-21 10:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 10:41 kernel test robot [this message]
2022-07-21 22:03 ` [groeck-staging:hwmon-next 77/79] drivers/hwmon/tps23861.c:159:19: sparse: sparse: cast to restricted __le16 Alex G.
2022-07-22  0:01   ` Guenter Roeck

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=202207211843.3aLaNmh9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mr.nuke.me@gmail.com \
    /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