From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EFBFC43441 for ; Fri, 9 Nov 2018 22:19:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB00D20818 for ; Fri, 9 Nov 2018 22:19:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=usp-br.20150623.gappssmtp.com header.i=@usp-br.20150623.gappssmtp.com header.b="WZNt3h+E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB00D20818 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=usp.br Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728453AbeKJIBp (ORCPT ); Sat, 10 Nov 2018 03:01:45 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:36881 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbeKJIBp (ORCPT ); Sat, 10 Nov 2018 03:01:45 -0500 Received: by mail-ot1-f65.google.com with SMTP id 40so3058582oth.4 for ; Fri, 09 Nov 2018 14:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp-br.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6zoiiHnPriBSOD/a0+N6SbcuOUfbsH25USCT3RPYLpE=; b=WZNt3h+Ead3Sm2e7VQ2iIKYkhnDZwdlCmod/q6ceHbLQHmyg3HqlixQs3DGWqpbELa r9Avidp5I6pL0oq5Lta8Sq7AbOYeRLSOw8l0wSkI6PX7p8T2HNCubiziHb4sBb3qfybP B6UEt6IC42xeElJatH2Lic+hxZu3NKNzSj643/aPCzwStv6WFB4astVyi0DHy9R1X5vf kTULuSijPP5bCHpurbXsIbPek2t0hVrLFMVPuP0tT8gB9IlHGsRlSywn7rWhDemqHIRo fDgtwkDsAMrTK02CQ+s7NTnVBbtbaoGUVbVsNKeV2za+G6wojUpuPI6qgioRK27Unl+x Pzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6zoiiHnPriBSOD/a0+N6SbcuOUfbsH25USCT3RPYLpE=; b=SWZ5lN/TqPQZj1vw4RYpDfmG+80JetODgHi0nIJaqskgYjgJVyGuMQTpj26LLe7Bnw ruEoV2dZl5O6d5PSCbRatg13nVmhbvTvaW89iCpOB9OqeluL5tx+IhySe4eP9O9fxhpI 3sWo+FdePKRSaqW4d/dF/0z9NA5iPz9IaI6Glh7YNoPK04XbWXUBil/CpWeCh5/z9FkI AAn4F+3JwyQtj11JyuHIfm0O80knlnX1fzWY4cPVak0fKTmyR4nVv4f5xqKR5T/ZkUOx k9cn34oO8MlcN6lwWputvJRQXIgSnScWiTINCQqiUQ03eRLTLxkDWg9dV6XmwA+xHM+U eJAg== X-Gm-Message-State: AGRZ1gKpvqu5m5hu06YP3UBAoOl9QolQHK8XhIQdYi0lQKPOFU8yDBIN kPYgtFBt62evqYGSKp5Op/Iueyis39yuWddcqjS9Vw== X-Google-Smtp-Source: AJdET5czbbnikuXN02KGzhnJiN/mf2vOlysni1CPDzwpxuUHklo2DDLMJ8WSztsFhhBahstmyCfp7/q7KXBuZJsjbc4= X-Received: by 2002:a9d:4282:: with SMTP id r2mr6808665ote.112.1541801950476; Fri, 09 Nov 2018 14:19:10 -0800 (PST) MIME-Version: 1.0 References: <43efc182fc7ab9aa1d2f1ca798e27d85c7132e1f.camel@analog.com> In-Reply-To: <43efc182fc7ab9aa1d2f1ca798e27d85c7132e1f.camel@analog.com> From: Giuliano Augusto Faulin Belinassi Date: Fri, 9 Nov 2018 20:18:58 -0200 Message-ID: Subject: Re: [PATCH v2 2/2] staging: iio: ad7780: generates pattern_mask from PAT bits To: alexandru.Ardelean@analog.com Cc: lars@metafoo.de, knaack.h@gmx.de, jic23@kernel.org, Michael.Hennerich@analog.com, Renato Geh , giuliano.belinassi@gmail.com, Peter Meerwald-Stadler , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, Kernel USP Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi >While I agree that it looks nicer to indent all these to the same level, >you also need to think about the fact that the kernel git repo is already >pretty big as-is, so it's a good idea if a patch adds as much code/semantic >value [as possible] with as little change [as possible] and with as good of >readability [as possible]. Understood. But can't someone else submit another patch fixing these indentation issues? That would be another commit and more stuff to the repository. On Thu, Nov 8, 2018 at 11:51 AM Ardelean, Alexandru wrote: > > On Thu, 2018-11-08 at 11:03 -0200, Giuliano Belinassi wrote: > > Previously, all pattern_masks and patterns in the chip_info table were > > hardcoded. Now they are generated using the PAT macros, as described in > > the datasheets. > > One comment about indentation/whitespace. > > Rest looks good. > > Alex > > > > > Signed-off-by: Giuliano Belinassi > > --- > > Changes in v2: > > - Added the PATTERN and PATTERN_MASK macros > > - Update BIT macros alignment to match with PATTERN > > - Generate pattern mask with PATTERN_MASK macros. > > > > drivers/staging/iio/adc/ad7780.c | 40 +++++++++++++++++++------------- > > 1 file changed, 24 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/staging/iio/adc/ad7780.c > > b/drivers/staging/iio/adc/ad7780.c > > index 9ec2b002539e..ff8e3b2d0efc 100644 > > --- a/drivers/staging/iio/adc/ad7780.c > > +++ b/drivers/staging/iio/adc/ad7780.c > > @@ -22,14 +22,22 @@ > > #include > > #include > > > > -#define AD7780_RDY BIT(7) > > -#define AD7780_FILTER BIT(6) > > -#define AD7780_ERR BIT(5) > > -#define AD7780_ID1 BIT(4) > > -#define AD7780_ID0 BIT(3) > > -#define AD7780_GAIN BIT(2) > > -#define AD7780_PAT1 BIT(1) > > -#define AD7780_PAT0 BIT(0) > > +#define AD7780_RDY BIT(7) > > +#define AD7780_FILTER BIT(6) > > +#define AD7780_ERR BIT(5) > > +#define AD7780_ID1 BIT(4) > > +#define AD7780_ID0 BIT(3) > > +#define AD7780_GAIN BIT(2) > > +#define AD7780_PAT1 BIT(1) > > +#define AD7780_PAT0 BIT(0) > > Changing indentation here doesn't add much value; it's mostly > patch/whitespace noise. > > While I agree that it looks nicer to indent all these to the same level, > you also need to think about the fact that the kernel git repo is already > pretty big as-is, so it's a good idea if a patch adds as much code/semantic > value [as possible] with as little change [as possible] and with as good of > readability [as possible]. > [ Kind of sounds like a balance act between the 3 things ]. > > > > + > > +#define AD7780_PATTERN (AD7780_PAT0) > > +#define AD7780_PATTERN_MASK (AD7780_PAT0 | AD7780_PAT1) > > + > > +#define AD7170_PAT2 BIT(2) > > + > > +#define AD7170_PATTERN (AD7780_PAT0 | AD7170_PAT2) > > +#define AD7170_PATTERN_MASK (AD7780_PAT0 | AD7780_PAT1 | AD7170_PAT2) > > > > struct ad7780_chip_info { > > struct iio_chan_spec channel; > > @@ -136,26 +144,26 @@ static const struct ad_sigma_delta_info > > ad7780_sigma_delta_info = { > > static const struct ad7780_chip_info ad7780_chip_info_tbl[] = { > > [ID_AD7170] = { > > .channel = AD7780_CHANNEL(12, 24), > > - .pattern = 0x5, > > - .pattern_mask = 0x7, > > + .pattern = AD7170_PATTERN, > > + .pattern_mask = AD7170_PATTERN_MASK, > > .is_ad778x = false, > > }, > > [ID_AD7171] = { > > .channel = AD7780_CHANNEL(16, 24), > > - .pattern = 0x5, > > - .pattern_mask = 0x7, > > + .pattern = AD7170_PATTERN, > > + .pattern_mask = AD7170_PATTERN_MASK, > > .is_ad778x = false, > > }, > > [ID_AD7780] = { > > .channel = AD7780_CHANNEL(24, 32), > > - .pattern = 0x1, > > - .pattern_mask = 0x3, > > + .pattern = AD7780_PATTERN, > > + .pattern_mask = AD7780_PATTERN_MASK, > > .is_ad778x = true, > > }, > > [ID_AD7781] = { > > .channel = AD7780_CHANNEL(20, 32), > > - .pattern = 0x1, > > - .pattern_mask = 0x3, > > + .pattern = AD7780_PATTERN, > > + .pattern_mask = AD7780_PATTERN_MASK, > > .is_ad778x = true, > > }, > > }; > > -- > You received this message because you are subscribed to the Google Groups "Kernel USP" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-usp+unsubscribe@googlegroups.com. > To post to this group, send email to kernel-usp@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kernel-usp/43efc182fc7ab9aa1d2f1ca798e27d85c7132e1f.camel%40analog.com. > For more options, visit https://groups.google.com/d/optout.