Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5043742imu; Sat, 1 Dec 2018 08:04:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/UhxzWuCyTM0nLwlyNJHc/P8WzBbscNrr6uReS6IhtllkMJaN0ABrmr3UNOo7iC4C4I6bVQ X-Received: by 2002:a17:902:654a:: with SMTP id d10mr9572446pln.324.1543680255994; Sat, 01 Dec 2018 08:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543680255; cv=none; d=google.com; s=arc-20160816; b=rjAE0ludlmc9svxBTmn0iRn6KUP1s4P1yd686qr8EbU7S6q3NTrEljLlpDEPVQP9L8 mce967/Xhpkeqxy36dURZ24RB5jMb+7Gwfw/JJAqBgE9MUf2GvEl9q8TVQV5hM17uqPb sbtALH02GmDRAQKO6huyH4ervWMy6uql0f2kuyTF1Tp6fD3nGjGqE7EpCKKkv4EPzwhV gQ9bBB1vu0NZV1qqWDeZYxVg2hME7ZVz2H63t4CwWxOui7DtI0gCvdm4vy3IvmrxHeME xhvs+0VW3/p9KBd3tcZ4qVl/GvLF8ktisgHlNOnFPElrFh0r7a/1Iqg3DqtpWvsOJczu s/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=5cTivHogs5KdJOlo2w29HvHFYhxW/B+3y8HlZmOyaak=; b=yaBx5aid2coCM2iAA/OthpeOdzdr4j9Wzg6cRY6LDP4VBhbTB+W/jnHdmH+YkW85rD Yh9bISZqr3T6kerSe4EpvGlizT3/bv3AgXZPU1J0hZIfbW2MOEaW5shzBrDTZf/fuEpP UE7G3301WC12/oM3+k6+nr3/T7mbl6VK1H5c0SKfTvbYR9k7ilJ7rOc4OeH7dU9kgxJl 85tdDIfIkixBPQWZ19qymJGuwL5MnmjRKVfJ6FJLEoYdmbE05uPObqF5RO+u8phDg1ND VIWBnNIWFVmIFFxXoT+ebXonUor06oXvDy6SFwPlALcs/LquBe3oN+5clOYi7Ng3mLzz SJVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si6827210pgh.251.2018.12.01.08.04.00; Sat, 01 Dec 2018 08:04:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbeLBDO4 (ORCPT + 99 others); Sat, 1 Dec 2018 22:14:56 -0500 Received: from saturn.retrosnub.co.uk ([46.235.226.198]:47362 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbeLBDO4 (ORCPT ); Sat, 1 Dec 2018 22:14:56 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) by saturn.retrosnub.co.uk (Postfix; Retrosnub mail submission) with ESMTPSA id 076119E749D; Sat, 1 Dec 2018 16:02:04 +0000 (GMT) Date: Sat, 1 Dec 2018 16:02:03 +0000 From: Jonathan Cameron To: Tomasz Duszynski Cc: Himanshu Jha , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 2/3] iio: chemical: add support for Sensirion SPS30 sensor Message-ID: <20181201160203.0b26e393@archlinux> In-Reply-To: <20181126204803.GA19277@arch> References: <20181124221415.10081-1-tduszyns@gmail.com> <20181124221415.10081-3-tduszyns@gmail.com> <20181125104434.GA19309@himanshu-Vostro-3559> <20181126204803.GA19277@arch> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Nov 2018 21:48:07 +0100 Tomasz Duszynski wrote: > On Sun, Nov 25, 2018 at 04:14:34PM +0530, Himanshu Jha wrote: > > On Sat, Nov 24, 2018 at 11:14:14PM +0100, Tomasz Duszynski wrote: > > > Add support for Sensirion SPS30 particulate matter sensor. > > > > > > Signed-off-by: Tomasz Duszynski > > > --- > > > drivers/iio/chemical/Kconfig | 11 ++ > > > drivers/iio/chemical/Makefile | 1 + > > > drivers/iio/chemical/sps30.c | 359 ++++++++++++++++++++++++++++++++++ > > > 3 files changed, 371 insertions(+) > > > create mode 100644 drivers/iio/chemical/sps30.c > > > > [] > > > > > +#define pr_fmt(fmt) "sps30: " fmt > > > > I don't see its usage ? > > > > Hint: checkout how dev_err() is defined. > > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#define SPS30_CRC8_POLYNOMIAL 0x31 > > > + > > > +/* SPS30 commands */ > > > +#define SPS30_START_MEAS 0x0010 > > > +#define SPS30_STOP_MEAS 0x0104 > > > +#define SPS30_RESET 0xd304 > > > +#define SPS30_READ_DATA_READY_FLAG 0x0202 > > > +#define SPS30_READ_DATA 0x0300 > > > +#define SPS30_READ_SERIAL 0xD033 > > > > Could you please put a tab and align these macros. > > > > #define SPS30_START_MEAS 0x0010 > > #define SPS30_STOP_MEAS 0x0104 > > > > In my opinion this sort of alignment does not pay off in the long run. > Adding a new definition, a slightly longer one perhaps, can easily break > formatting. > > So I would stay with current one. Personally I agree with you on this one. I don't care enough to say either way though normally! > > > > > > +static int sps30_write_then_read(struct sps30_state *state, u8 *buf, > > > + int buf_size, u8 *data, int data_size) > > > +{ > > > + /* every two received data bytes are checksummed */ > > > + u8 tmp[data_size + data_size / 2]; > > > > No VLAs! > > > > https://lore.kernel.org/lkml/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com/ > > > > Looks like -Wvla is some fairly recent addition to KBUILD_CFLAGS. Yeah, that was only after a 'lot' of effort over years to get the number present down to a small number. I wrote plenty of them in the early days of IIO so got a lot of those patches as part of the move to introducing the warning :) Jonathan ...