[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4959a591-609d-6b94-69a6-ccb92246b0f0@roeck-us.net>
Date: Thu, 29 Jun 2023 11:05:12 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Dan Carpenter <dan.carpenter@...aro.org>,
oe-kbuild@...ts.linux.dev, Eddie James <eajames@...ux.ibm.com>,
linux-hwmon@...r.kernel.org
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org, jdelvare@...e.com,
lakshmiy@...ibm.com
Subject: Re: [PATCH] hwmon: (pmbus/acbel-fsg032) Add firmware version debugfs
attribute
On 6/28/23 23:53, Dan Carpenter wrote:
> Hi Eddie,
>
> kernel test robot noticed the following build warnings:
>
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Eddie-James/hwmon-pmbus-acbel-fsg032-Add-firmware-version-debugfs-attribute/20230628-030615
> base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
> patch link: https://lore.kernel.org/r/20230627184027.16343-1-eajames%40linux.ibm.com
> patch subject: [PATCH] hwmon: (pmbus/acbel-fsg032) Add firmware version debugfs attribute
> config: x86_64-randconfig-m001-20230627 (https://download.01.org/0day-ci/archive/20230628/202306281205.NFXmu7xb-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20230628/202306281205.NFXmu7xb-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>
> | Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> | Closes: https://lore.kernel.org/r/202306281205.NFXmu7xb-lkp@intel.com/
>
> smatch warnings:
> drivers/hwmon/pmbus/acbel-fsg032.c:36 acbel_fsg032_debugfs_read() warn: argument 4 to %02X specifier has type 'char'
>
> vim +/char +36 drivers/hwmon/pmbus/acbel-fsg032.c
>
> d2c6444389b625 Eddie James 2023-06-27 17 static ssize_t acbel_fsg032_debugfs_read(struct file *file, char __user *buf, size_t count,
> d2c6444389b625 Eddie James 2023-06-27 18 loff_t *ppos)
> d2c6444389b625 Eddie James 2023-06-27 19 {
> d2c6444389b625 Eddie James 2023-06-27 20 struct i2c_client *client = file->private_data;
> d2c6444389b625 Eddie James 2023-06-27 21 char data[I2C_SMBUS_BLOCK_MAX + 2] = { 0 };
>
> data should probably be a u8.
>
> d2c6444389b625 Eddie James 2023-06-27 22 char out[8];
> d2c6444389b625 Eddie James 2023-06-27 23 int rc;
> d2c6444389b625 Eddie James 2023-06-27 24 int i;
> d2c6444389b625 Eddie James 2023-06-27 25
> d2c6444389b625 Eddie James 2023-06-27 26 rc = pmbus_lock_interruptible(client);
> d2c6444389b625 Eddie James 2023-06-27 27 if (rc)
> d2c6444389b625 Eddie James 2023-06-27 28 return rc;
> d2c6444389b625 Eddie James 2023-06-27 29
> d2c6444389b625 Eddie James 2023-06-27 30 rc = i2c_smbus_read_block_data(client, ACBEL_MFR_FW_REVISION, data);
> d2c6444389b625 Eddie James 2023-06-27 31 pmbus_unlock(client);
> d2c6444389b625 Eddie James 2023-06-27 32 if (rc < 0)
> d2c6444389b625 Eddie James 2023-06-27 33 return rc;
> d2c6444389b625 Eddie James 2023-06-27 34
> d2c6444389b625 Eddie James 2023-06-27 35 for (i = 0; i < rc && i < 3; ++i)
> d2c6444389b625 Eddie James 2023-06-27 @36 snprintf(&out[i * 2], 3, "%02X", data[i]);
>
> If data[i] is negative this will print FFFFFFF1 etc. (This is an x86
> config... Did we ever merge that patch to make char signed by default?)
>
That makes me wonder what "%*phN\n" in the updated patch does, as it only passes
'data' as pointer argument.
Either case, no need to resend. I fixed this up when applying it by
declaring data[] as u8. I also dropped the unused variable.
Thanks,
Guenter
Powered by blists - more mailing lists