All of lore.kernel.org
 help / color / mirror / Atom feed
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: 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 2/2] iio: chemical: Add driver support for sgp40
Date: Wed, 28 Jul 2021 07:30:56 +0800	[thread overview]
Message-ID: <202107280749.k4rLtrzk-lkp@intel.com> (raw)
In-Reply-To: <20210727163517.GA3468@arbad>

[-- Attachment #1: Type: text/plain, Size: 5976 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-rc3 next-20210727]
[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/20210728-003718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 10.3.0
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/6e2c78f8b661002ac418f2782ddc79352b6f04a3
        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/20210728-003718
        git checkout 6e2c78f8b661002ac418f2782ddc79352b6f04a3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=sparc 

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:67:5: warning: no previous prototype for 'sqp40_exp100' [-Wmissing-prototypes]
      67 | int sqp40_exp100(int n)
         |     ^~~~~~~~~~~~
   In file included from include/linux/device.h:15,
                    from include/linux/iio/iio.h:10,
                    from drivers/iio/chemical/sgp40.c:26:
   drivers/iio/chemical/sgp40.c: In function 'sgp40_measure_raw':
>> drivers/iio/chemical/sgp40.c:143:23: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
     143 |   dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/iio/chemical/sgp40.c:143:3: note: in expansion of macro 'dev_warn'
     143 |   dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
         |   ^~~~~~~~
   drivers/iio/chemical/sgp40.c:143:57: note: format string is defined here
     143 |   dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
         |                                                        ~^
         |                                                         |
         |                                                         int
         |                                                        %ld
   In file included from include/linux/device.h:15,
                    from include/linux/iio/iio.h:10,
                    from drivers/iio/chemical/sgp40.c:26:
   drivers/iio/chemical/sgp40.c:152:23: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
     152 |   dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/iio/chemical/sgp40.c:152:3: note: in expansion of macro 'dev_warn'
     152 |   dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
         |   ^~~~~~~~
   drivers/iio/chemical/sgp40.c:152:57: note: format string is defined here
     152 |   dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
         |                                                        ~^
         |                                                         |
         |                                                         int
         |                                                        %ld


vim +143 drivers/iio/chemical/sgp40.c

   118	
   119	static int sgp40_measure_raw(struct sgp40_data *data, u16 *raw)
   120	{
   121		int ret;
   122		struct i2c_client *client = data->client;
   123		u16 buf_be16;
   124		u8 buf[3];
   125		u8 tg[8];
   126		u32 ticks;
   127		u8 crc;
   128	
   129		memcpy(tg, sgp40_measure_raw_tg, 2);
   130	
   131		ticks = (data->rel_humidity / 10) * 65535 / 10000;
   132		buf_be16 = cpu_to_be16((u16)ticks);
   133		memcpy(&tg[2], &buf_be16, 2);
   134		tg[4] = crc8(sgp40_crc8_table, &tg[2], 2, SGP40_CRC8_INIT);
   135	
   136		ticks = ((data->temperature + 45000) / 10) * 65535 / 17500;
   137		buf_be16 = cpu_to_be16((u16)ticks);
   138		memcpy(&tg[5], &buf_be16, 2);
   139		tg[7] = crc8(sgp40_crc8_table, &tg[5], 2, SGP40_CRC8_INIT);
   140	
   141		ret = i2c_master_send(client, (const char *)tg, sizeof(tg));
   142		if (ret != sizeof(tg)) {
 > 143			dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
   144			return -EIO;
   145		}
   146		msleep(30);
   147	
   148		ret = i2c_master_recv(client, buf, sizeof(buf));
   149		if (ret < 0)
   150			return ret;
   151		if (ret != sizeof(buf)) {
   152			dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
   153			return -EIO;
   154		}
   155	
   156		crc = crc8(sgp40_crc8_table, buf, 2, SGP40_CRC8_INIT);
   157		if (crc != buf[2]) {
   158			dev_err(data->dev, "CRC error while measure-raw\n");
   159			return -EIO;
   160		}
   161	
   162		memcpy(&buf_be16, buf, sizeof(buf_be16));
   163		*raw = be16_to_cpu(buf_be16);
   164	
   165		return 0;
   166	}
   167	

---
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: 69614 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 2/2] iio: chemical: Add driver support for sgp40
Date: Wed, 28 Jul 2021 07:30:56 +0800	[thread overview]
Message-ID: <202107280749.k4rLtrzk-lkp@intel.com> (raw)
In-Reply-To: <20210727163517.GA3468@arbad>

[-- Attachment #1: Type: text/plain, Size: 6105 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-rc3 next-20210727]
[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/20210728-003718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 10.3.0
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/6e2c78f8b661002ac418f2782ddc79352b6f04a3
        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/20210728-003718
        git checkout 6e2c78f8b661002ac418f2782ddc79352b6f04a3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=sparc 

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:67:5: warning: no previous prototype for 'sqp40_exp100' [-Wmissing-prototypes]
      67 | int sqp40_exp100(int n)
         |     ^~~~~~~~~~~~
   In file included from include/linux/device.h:15,
                    from include/linux/iio/iio.h:10,
                    from drivers/iio/chemical/sgp40.c:26:
   drivers/iio/chemical/sgp40.c: In function 'sgp40_measure_raw':
>> drivers/iio/chemical/sgp40.c:143:23: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
     143 |   dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/iio/chemical/sgp40.c:143:3: note: in expansion of macro 'dev_warn'
     143 |   dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
         |   ^~~~~~~~
   drivers/iio/chemical/sgp40.c:143:57: note: format string is defined here
     143 |   dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
         |                                                        ~^
         |                                                         |
         |                                                         int
         |                                                        %ld
   In file included from include/linux/device.h:15,
                    from include/linux/iio/iio.h:10,
                    from drivers/iio/chemical/sgp40.c:26:
   drivers/iio/chemical/sgp40.c:152:23: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
     152 |   dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/iio/chemical/sgp40.c:152:3: note: in expansion of macro 'dev_warn'
     152 |   dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
         |   ^~~~~~~~
   drivers/iio/chemical/sgp40.c:152:57: note: format string is defined here
     152 |   dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
         |                                                        ~^
         |                                                         |
         |                                                         int
         |                                                        %ld


vim +143 drivers/iio/chemical/sgp40.c

   118	
   119	static int sgp40_measure_raw(struct sgp40_data *data, u16 *raw)
   120	{
   121		int ret;
   122		struct i2c_client *client = data->client;
   123		u16 buf_be16;
   124		u8 buf[3];
   125		u8 tg[8];
   126		u32 ticks;
   127		u8 crc;
   128	
   129		memcpy(tg, sgp40_measure_raw_tg, 2);
   130	
   131		ticks = (data->rel_humidity / 10) * 65535 / 10000;
   132		buf_be16 = cpu_to_be16((u16)ticks);
   133		memcpy(&tg[2], &buf_be16, 2);
   134		tg[4] = crc8(sgp40_crc8_table, &tg[2], 2, SGP40_CRC8_INIT);
   135	
   136		ticks = ((data->temperature + 45000) / 10) * 65535 / 17500;
   137		buf_be16 = cpu_to_be16((u16)ticks);
   138		memcpy(&tg[5], &buf_be16, 2);
   139		tg[7] = crc8(sgp40_crc8_table, &tg[5], 2, SGP40_CRC8_INIT);
   140	
   141		ret = i2c_master_send(client, (const char *)tg, sizeof(tg));
   142		if (ret != sizeof(tg)) {
 > 143			dev_warn(data->dev, "i2c_master_send ret: %d sizeof: %d\n", ret, sizeof(tg));
   144			return -EIO;
   145		}
   146		msleep(30);
   147	
   148		ret = i2c_master_recv(client, buf, sizeof(buf));
   149		if (ret < 0)
   150			return ret;
   151		if (ret != sizeof(buf)) {
   152			dev_warn(data->dev, "i2c_master_recv ret: %d sizeof: %d\n", ret, sizeof(buf));
   153			return -EIO;
   154		}
   155	
   156		crc = crc8(sgp40_crc8_table, buf, 2, SGP40_CRC8_INIT);
   157		if (crc != buf[2]) {
   158			dev_err(data->dev, "CRC error while measure-raw\n");
   159			return -EIO;
   160		}
   161	
   162		memcpy(&buf_be16, buf, sizeof(buf_be16));
   163		*raw = be16_to_cpu(buf_be16);
   164	
   165		return 0;
   166	}
   167	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 69614 bytes --]

  parent reply	other threads:[~2021-07-27 23:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 16:35 [PATCH 2/2] iio: chemical: Add driver support for sgp40 Andreas Klinger
2021-07-27 22:11 ` kernel test robot
2021-07-27 22:11   ` kernel test robot
2021-07-27 23:30 ` kernel test robot [this message]
2021-07-27 23:30   ` kernel test robot
2021-07-31 16:39 ` Jonathan Cameron
2021-07-31 18:06   ` Guenter Roeck
2021-08-01 17:01     ` 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=202107280749.k4rLtrzk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ak@it-klinger.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.