linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Tomasz Duszynski <tduszyns@gmail.com>
Cc: kbuild-all@01.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Tomasz Duszynski <tduszyns@gmail.com>
Subject: Re: [PATCH 3/3] iio: chemical: sps30: add device tree support
Date: Mon, 26 Nov 2018 12:11:18 +0800	[thread overview]
Message-ID: <201811261221.9rY6ethH%fengguang.wu@intel.com> (raw)
In-Reply-To: <20181124221415.10081-4-tduszyns@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4022 bytes --]

Hi Tomasz,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on v4.20-rc4 next-20181123]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Tomasz-Duszynski/add-support-for-Sensirion-SPS30-PM-sensor/20181125-172634
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

>> drivers/iio/chemical/sps30.c:69:26: warning: Variable length array is used.
   drivers/iio/chemical/sps30.c: In function 'sps30_read_raw':
   drivers/iio/chemical/sps30.c:237:7: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
       if (ret)
          ^

vim +69 drivers/iio/chemical/sps30.c

0e4f3167f Tomasz Duszynski 2018-11-24   64  
0e4f3167f Tomasz Duszynski 2018-11-24   65  static int sps30_write_then_read(struct sps30_state *state, u8 *buf,
0e4f3167f Tomasz Duszynski 2018-11-24   66  				 int buf_size, u8 *data, int data_size)
0e4f3167f Tomasz Duszynski 2018-11-24   67  {
0e4f3167f Tomasz Duszynski 2018-11-24   68  	/* every two received data bytes are checksummed */
0e4f3167f Tomasz Duszynski 2018-11-24  @69  	u8 tmp[data_size + data_size / 2];
0e4f3167f Tomasz Duszynski 2018-11-24   70  	int ret, i;
0e4f3167f Tomasz Duszynski 2018-11-24   71  
0e4f3167f Tomasz Duszynski 2018-11-24   72  	/*
0e4f3167f Tomasz Duszynski 2018-11-24   73  	 * Sensor does not support repeated start so instead of
0e4f3167f Tomasz Duszynski 2018-11-24   74  	 * sending two i2c messages in a row we just send one by one.
0e4f3167f Tomasz Duszynski 2018-11-24   75  	 */
0e4f3167f Tomasz Duszynski 2018-11-24   76  	ret = i2c_master_send(state->client, buf, buf_size);
0e4f3167f Tomasz Duszynski 2018-11-24   77  	if (ret != buf_size)
0e4f3167f Tomasz Duszynski 2018-11-24   78  		return ret < 0 ? ret : -EIO;
0e4f3167f Tomasz Duszynski 2018-11-24   79  
0e4f3167f Tomasz Duszynski 2018-11-24   80  	if (!data)
0e4f3167f Tomasz Duszynski 2018-11-24   81  		return 0;
0e4f3167f Tomasz Duszynski 2018-11-24   82  
0e4f3167f Tomasz Duszynski 2018-11-24   83  	ret = i2c_master_recv(state->client, tmp, sizeof(tmp));
0e4f3167f Tomasz Duszynski 2018-11-24   84  	if (ret != sizeof(tmp))
0e4f3167f Tomasz Duszynski 2018-11-24   85  		return ret < 0 ? ret : -EIO;
0e4f3167f Tomasz Duszynski 2018-11-24   86  
0e4f3167f Tomasz Duszynski 2018-11-24   87  	for (i = 0; i < sizeof(tmp); i += 3) {
0e4f3167f Tomasz Duszynski 2018-11-24   88  		u8 crc = crc8(sps30_crc8_table, &tmp[i], 2, CRC8_INIT_VALUE);
0e4f3167f Tomasz Duszynski 2018-11-24   89  
0e4f3167f Tomasz Duszynski 2018-11-24   90  		if (crc != tmp[i + 2]) {
0e4f3167f Tomasz Duszynski 2018-11-24   91  			dev_err(&state->client->dev,
0e4f3167f Tomasz Duszynski 2018-11-24   92  				"data integrity check failed\n");
0e4f3167f Tomasz Duszynski 2018-11-24   93  			return -EIO;
0e4f3167f Tomasz Duszynski 2018-11-24   94  		}
0e4f3167f Tomasz Duszynski 2018-11-24   95  
0e4f3167f Tomasz Duszynski 2018-11-24   96  		*data++ = tmp[i];
0e4f3167f Tomasz Duszynski 2018-11-24   97  		*data++ = tmp[i + 1];
0e4f3167f Tomasz Duszynski 2018-11-24   98  	}
0e4f3167f Tomasz Duszynski 2018-11-24   99  
0e4f3167f Tomasz Duszynski 2018-11-24  100  	return 0;
0e4f3167f Tomasz Duszynski 2018-11-24  101  }
0e4f3167f Tomasz Duszynski 2018-11-24  102  

:::::: The code at line 69 was first introduced by commit
:::::: 0e4f3167f739fa067d7e1ba672f0b46569d04d84 iio: chemical: add support for Sensirion SPS30 sensor

:::::: TO: Tomasz Duszynski <tduszyns@gmail.com>
:::::: CC: 0day robot <lkp@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

      parent reply	other threads:[~2018-11-26 15:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-24 22:14 [PATCH 0/3] add support for Sensirion SPS30 PM sensor Tomasz Duszynski
2018-11-24 22:14 ` [PATCH 1/3] iio: add IIO_MASSCONCENTRATION channel type Tomasz Duszynski
2018-11-25  8:35   ` Jonathan Cameron
2018-11-25 15:19     ` Tomasz Duszynski
2018-11-25 13:51   ` Matt Ranostay
2018-11-25 14:03     ` Jonathan Cameron
2018-11-25 14:14       ` Matt Ranostay
2018-11-25 15:44         ` Tomasz Duszynski
2018-12-01 15:48           ` Jonathan Cameron
2018-12-02 11:32             ` Matt Ranostay
2018-11-25 15:35       ` Tomasz Duszynski
2018-11-24 22:14 ` [PATCH 2/3] iio: chemical: add support for Sensirion SPS30 sensor Tomasz Duszynski
2018-11-25  8:56   ` Jonathan Cameron
2018-11-25 19:05     ` Tomasz Duszynski
2018-12-01 15:58       ` Jonathan Cameron
2018-12-03 10:30         ` Andreas Brauchli
2018-12-04 18:47           ` Tomasz Duszynski
2018-11-25 10:44   ` Himanshu Jha
2018-11-26 20:48     ` Tomasz Duszynski
2018-12-01 16:02       ` Jonathan Cameron
2018-11-24 22:14 ` [PATCH 3/3] iio: chemical: sps30: add device tree support Tomasz Duszynski
2018-11-25  8:59   ` Jonathan Cameron
2018-12-02 18:29     ` Tomasz Duszynski
2018-12-03 13:10       ` Jonathan Cameron
2018-11-26  4:11   ` kbuild test robot [this message]

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=201811261221.9rY6ethH%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kbuild-all@01.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tduszyns@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;
as well as URLs for NNTP newsgroup(s).