From: kernel test robot <lkp@intel.com>
To: Andreas Klinger <ak@it-klinger.de>,
devicetree@vger.kernel.org, linux-iio@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
Jonathan Cameron <jic23@kernel.org>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
Jiri Kosina <trivial@kernel.org>,
Guenter Roeck <linux@roeck-us.net>,
Chris Packham <chris.packham@alliedtelesis.co.nz>,
Slawomir Stepien <sst@poczta.fm>,
Krzysztof Kozlowski <krzk@kernel.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v2 2/2] iio: chemical: Add driver support for sgp40
Date: Thu, 5 Aug 2021 06:43:44 +0800 [thread overview]
Message-ID: <202108050605.ps8oB47t-lkp@intel.com> (raw)
In-Reply-To: <20210804154641.GA3237@arbad>
[-- Attachment #1: Type: text/plain, Size: 4741 bytes --]
Hi Andreas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on iio/togreg]
[also build test WARNING on robh/for-next linus/master v5.14-rc4 next-20210804]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Andreas-Klinger/iio-chemical-Add-support-for-sgp40-gas-sensor/20210804-234955
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-buildonly-randconfig-r001-20210804 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 4f71f59bf3d9914188a11d0c41bedbb339d36ff5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c122fa429b69b2cf1d2546043c4ba21c715fa3cb
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andreas-Klinger/iio-chemical-Add-support-for-sgp40-gas-sensor/20210804-234955
git checkout c122fa429b69b2cf1d2546043c4ba21c715fa3cb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/iio/chemical/sgp40.c:186:68: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
~~ ^~~~~~~~~~
%lu
include/linux/dev_printk.h:114:33: note: expanded from macro 'dev_warn'
_dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
drivers/iio/chemical/sgp40.c:195:68: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(tgres));
~~ ^~~~~~~~~~~~~
%lu
include/linux/dev_printk.h:114:33: note: expanded from macro 'dev_warn'
_dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
2 warnings generated.
vim +186 drivers/iio/chemical/sgp40.c
159
160 static int sgp40_measure_resistance_raw(struct sgp40_data *data, u16 *resistance_raw)
161 {
162 int ret;
163 struct i2c_client *client = data->client;
164 u32 ticks;
165 u16 ticks16;
166 u8 crc;
167 struct sgp40_tg_measure tg = {.command = {0x26, 0x0F}};
168 struct sgp40_tg_result tgres;
169
170 mutex_lock(&data->lock);
171
172 ticks = (data->rht / 10) * 65535 / 10000;
173 ticks16 = (u16)clamp(ticks, 0u, 65535u); /* clamp between 0 .. 100 %rH */
174 tg.rht_ticks = cpu_to_be16(ticks16);
175 tg.rht_crc = crc8(sgp40_crc8_table, (u8 *)&tg.rht_ticks, 2, SGP40_CRC8_INIT);
176
177 ticks = ((data->temp + 45000) / 10 ) * 65535 / 17500;
178 ticks16 = (u16)clamp(ticks, 0u, 65535u); /* clamp between -45 .. +130 °C */
179 tg.temp_ticks = cpu_to_be16(ticks16);
180 tg.temp_crc = crc8(sgp40_crc8_table, (u8 *)&tg.temp_ticks, 2, SGP40_CRC8_INIT);
181
182 mutex_unlock(&data->lock);
183
184 ret = i2c_master_send(client, (const char *)&tg, sizeof(tg));
185 if (ret != sizeof(tg)) {
> 186 dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
187 return -EIO;
188 }
189 msleep(30);
190
191 ret = i2c_master_recv(client, (u8 *)&tgres, sizeof(tgres));
192 if (ret < 0)
193 return ret;
194 if (ret != sizeof(tgres)) {
195 dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(tgres));
196 return -EIO;
197 }
198
199 crc = crc8(sgp40_crc8_table, (u8 *)&tgres.res_ticks, 2, SGP40_CRC8_INIT);
200 if (crc != tgres.res_crc) {
201 dev_err(data->dev, "CRC error while measure-raw\n");
202 return -EIO;
203 }
204
205 *resistance_raw = be16_to_cpu(tgres.res_ticks);
206
207 return 0;
208 }
209
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47283 bytes --]
next prev parent reply other threads:[~2021-08-04 22:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 15:46 [PATCH v2 2/2] iio: chemical: Add driver support for sgp40 Andreas Klinger
2021-08-04 22:43 ` kernel test robot [this message]
2021-08-08 14:20 ` Jonathan Cameron
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=202108050605.ps8oB47t-lkp@intel.com \
--to=lkp@intel.com \
--cc=ak@it-klinger.de \
--cc=alexandre.belloni@bootlin.com \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=clang-built-linux@googlegroups.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=krzk@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
--cc=sst@poczta.fm \
--cc=trivial@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).