Received: by 10.192.165.156 with SMTP id m28csp2905587imm; Sun, 15 Apr 2018 11:58:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx48zlRt/aP3cP+uKta5CSyNhOh+A6QJlgBuVG4cmA0mnbBzwxcYDPXK2LJWnpZMhQk1da4Yu X-Received: by 10.99.111.67 with SMTP id k64mr362346pgc.115.1523818732271; Sun, 15 Apr 2018 11:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523818732; cv=none; d=google.com; s=arc-20160816; b=0IIwcDirhs4V0BpN6zixwaL9MDgmFpylUqDewbva2dvMTo2nLaUyM/m//EtdIrMbls wxQwSRva7BxEP/8DuWRULny+d0ETjfFe7eOsgwuj1P2AaB9SxV5chI1kkZ3fFO6CEGgN oGmlOwyYI2rMMs2VB9qZJw5AKcwnuRhAFUqNSVUNKsqjNlrlwOlkJOtAhM8PWej4eKm4 WFPD/rKHdxTctsu7MK+4hYglaDhUozNazXc6+gqLuCsB4s6P9jeA+cA9K5zGhJxvH8Qu iDpp15dK2rpvTEq2IaKNR5zJaniq1j84JYZfsiC1fsomJKK1pdb62QhS1PFL8t5+IN0/ fdEw== 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:date:cc:to:from:subject:message-id :arc-authentication-results; bh=YiCMpNfulto5at13QTmbgxCtSA6c80E8qWVJw8+5Wxw=; b=XUHU5B7KYXB67nRcLHzrDzZ3mNsrPgexPGNT4WS7TqzPTCDwwr4GNh/7y6ml+1Um/k 0zMsQZfyCKJlZkG63NkRMyWKz8l0piFlAp6Lb7nnT84dNFKnCmOTUp023CChw378qXzP eydq8APkRWUE/oH8Xl6ubyymlxMrRfv66Y6PbpmJTiQ+fCLTmExnbqGgVe5UwmztkGti 8m6wQ7dfsNiJGdsDHtD7ma80qqAqDUdlcqxUdgkGO+L1crOaSMNz0X2wb8L0mg+Pdozm nOThdwNgth/YMwD+XSjHs6cDHgp/umPEFzqc98bW6qLV53eEW+Zh9EzTakZpiujErKlM mzHg== 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 k70si1486982pgc.648.2018.04.15.11.58.26; Sun, 15 Apr 2018 11:58:52 -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 S1752639AbeDOSqP (ORCPT + 99 others); Sun, 15 Apr 2018 14:46:15 -0400 Received: from smtprelay0107.hostedemail.com ([216.40.44.107]:49194 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752470AbeDOSqN (ORCPT ); Sun, 15 Apr 2018 14:46:13 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 1C679837F24D; Sun, 15 Apr 2018 18:46:12 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2538:2553:2559:2562:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3872:3874:4250:4321:5007:6117:6119:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12438:12740:12895:13161:13229:13439:13894:14181:14659:14721:21080:21324:21451:21627:30003:30025:30054:30067:30090:30091,0,RBL:47.151.150.235:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:20,LUA_SUMMARY:none X-HE-Tag: watch03_8d397e6ffeb28 X-Filterd-Recvd-Size: 3383 Received: from XPS-9350.home (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Sun, 15 Apr 2018 18:46:10 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 13/14] Move ad7746 out of staging From: Joe Perches To: Jonathan Cameron , =?ISO-8859-1?Q?Hern=E1n?= Gonzalez Cc: 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 Date: Sun, 15 Apr 2018 11:46:09 -0700 In-Reply-To: <20180415180451.4d538830@archlinux> References: <1523637411-8531-1-git-send-email-hernan@vanguardiasur.com.ar> <1523637411-8531-14-git-send-email-hernan@vanguardiasur.com.ar> <20180415180451.4d538830@archlinux> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.0-4 Mime-Version: 1.0 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, 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 > > +/* > > + * 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...