Received: by 10.192.165.156 with SMTP id m28csp2963518imm; Sun, 15 Apr 2018 13:32:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+VxPonqVSExzkS1zVRob1Hypc9NcSvldg0lWxBRYc4ilUOivJg4qkf6FSKjpymiV+X+vz/ X-Received: by 10.98.101.131 with SMTP id z125mr2317094pfb.208.1523824362542; Sun, 15 Apr 2018 13:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523824362; cv=none; d=google.com; s=arc-20160816; b=wJs9/5NWvflcoFFYvG25GzEQDXYqeS6UJSHoCRmtUehyH8+eGJp0O7IjHTKrHyTk+2 H6nf5zfHHzYZ91og3/bVCaHCnV8JR7bkYWehyVwGMCYEemnZqeRu4SATiKiFRVcD1A0o mTDI36RWfqzKTstlvoajGyZmkr6bdNoRCgN5o0VW+MSvfex3wr95UVfNMKHMWScKKzSt tR0ehaZa62RkuzAkLGmBGevHNFS0hVI0jh6mZEB5Dq3kM1oztCnQ+D3O+Rsp+8Qn5nG3 8d13a+GHaTTv5qbZ7ZY0XHtsTURx4UhCqyhbwIGUk4yXnKfrjpxVEgp3pEzwpyk/uh/F Y7Jw== 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 :dmarc-filter:arc-authentication-results; bh=SMxHJYpAmJxqNBWm0OWgjEVMRzks+kYlP2vw2QHlvtw=; b=jY2s+sJx3g5z2WwNfGT5I+oq4VMDWiz3zgcbEAqrso6qHoQQXab8MUZkusTEPRP1xN UXqECoAGM+WCCx128pzlxTrptpXo1P+xv2vkoFG6xp+muKjW1g6cfTKA03mzzh47VQ7K s4RTO3Tlupt8x7wIwPLLbW19vJHSxYmRfdR+y+FqVUzhPyg/hL75QmrQK5Kpa+BM+i01 axlvCMfXqN5s0J0i3tXvZRkhuYDFiq3aRnA0CfB53JP0sTmrVhYwhqUAH7CtBiSReWkh CmhjDSscmK6WulYFpzpQ4JkdAaRRpQh/RWDsqYTs1Ay84QdvCskll/0mlS7AlLhYcM8t z2mw== 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 f15si8359636pgu.563.2018.04.15.13.31.49; Sun, 15 Apr 2018 13:32:42 -0700 (PDT) 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 S1752783AbeDOTtC convert rfc822-to-8bit (ORCPT + 99 others); Sun, 15 Apr 2018 15:49:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:52476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752434AbeDOTtB (ORCPT ); Sun, 15 Apr 2018 15:49:01 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C44332176F; Sun, 15 Apr 2018 19:48:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C44332176F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sun, 15 Apr 2018 20:48:55 +0100 From: Jonathan Cameron To: Joe Perches Cc: =?UTF-8?B?SGVybsOhbg==?= Gonzalez , knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 13/14] Move ad7746 out of staging Message-ID: <20180415204855.4393fbd2@archlinux> In-Reply-To: References: <1523637411-8531-1-git-send-email-hernan@vanguardiasur.com.ar> <1523637411-8531-14-git-send-email-hernan@vanguardiasur.com.ar> <20180415180451.4d538830@archlinux> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 15 Apr 2018 11:46:09 -0700 Joe Perches wrote: > On Sun, 2018-04-15 at 18:04 +0100, Jonathan Cameron wrote: > > On Fri, 13 Apr 2018 13:36:50 -0300 > > Hernán Gonzalez wrote: > > > > > Signed-off-by: Hernán Gonzalez > > > > A few comments inline. > > And a trivial typo and other bits > > > > diff --git a/drivers/iio/cdc/Makefile b/drivers/iio/cdc/Makefile > [] > > > @@ -0,0 +1,5 @@ > > > +# > > > +#Makeefile for industrial I/O CDC drivers > > Makefile > > > > diff --git a/drivers/iio/cdc/ad7746.c b/drivers/iio/cdc/ad7746.c > [] > > > @@ -0,0 +1,855 @@ > > Perhaps use the SPDX tags There was some resistance around this so we dropped it from suggested changes before moving these drivers out of staging. Can sort it out later. > > > > +/* > > > + * AD7746 capacitive sensor driver supporting AD7745, AD7746 and AD7747 > > > + * > > > + * Copyright 2011 Analog Devices Inc. > > > + * > > > + * Licensed under the GPL-2. > > > + */ > > [] > > > > +static const struct iio_chan_spec ad7746_channels[] = { > > > + [VIN] = { > > > + .type = IIO_VOLTAGE, > > > + .indexed = 1, > > > + .channel = 0, > > > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), > > > + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | > > > + BIT(IIO_CHAN_INFO_SAMP_FREQ), > > > + .address = AD7746_REG_VT_DATA_HIGH << 8 | > > > + AD7746_VTSETUP_VTMD_EXT_VIN, > > > > Hmm. I never like to see a single location used to hold two different things. > > I would suggest perhaps having address be an enum then have have a lookup > > into an array of structures that have the two elements separately. > > (use the ad7746_chan enum again for this?) > > And perhaps it's nicer to align the multiple > BIT(identifier) uses like > > .info_mask_shared_by_type = (BIT(IIO_CHAN_INFO_SCALE) | > BIT(IIO_CHAN_INFO_SAMP_FREQ)), > > The extra unnecessary parentheses allow at least emacs > to align the BIT uses properly. > > [] > > > > + [CIN1] = { > > > + .type = IIO_CAPACITANCE, > > > + .indexed = 1, > > > + .channel = 0, > > > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | > > > + BIT(IIO_CHAN_INFO_CALIBSCALE) | BIT(IIO_CHAN_INFO_OFFSET), > > > + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_CALIBBIAS) | > > > + BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ), > > > + .address = AD7746_REG_CAP_DATA_HIGH << 8, > > > + }, > > So this one could be: > > .info_mask_shared_by_type = (BIT(IIO_CHAN_INFO_CALIBBIAS) | > BIT(IIO_CHAN_INFO_SCALE) | > BIT(IIO_CHAN_INFO_SAMP_FREQ)), > > etc... > >