Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: "Alex G." <mr.nuke.me@gmail.com>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-hwmon@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [groeck-staging:hwmon-next 77/79] drivers/hwmon/tps23861.c:159:19: sparse: sparse: cast to restricted __le16
Date: Thu, 21 Jul 2022 17:03:02 -0500	[thread overview]
Message-ID: <50fbce6d-32a0-4751-dd2d-a3676b32be02@gmail.com> (raw)
In-Reply-To: <202207211843.3aLaNmh9-lkp@intel.com>

Hi Guenter,

On 7/21/22 05:41, kernel test robot wrote:
> 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

I'm sorry about this. These warnings caught me by surprise. I checked 
that changing the type from "uint16_t" to "__le16" silences sparse. It
feels like a false positive. Should I worry about this?

Alex

> 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	
> 

  reply	other threads:[~2022-07-21 22:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 10:41 [groeck-staging:hwmon-next 77/79] drivers/hwmon/tps23861.c:159:19: sparse: sparse: cast to restricted __le16 kernel test robot
2022-07-21 22:03 ` Alex G. [this message]
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=50fbce6d-32a0-4751-dd2d-a3676b32be02@gmail.com \
    --to=mr.nuke.me@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lkp@intel.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