Received: by 10.213.65.68 with SMTP id h4csp330089imn; Fri, 23 Mar 2018 05:42:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELuO06xPjEzPWrA2XLTKyfVUIKWsx3hUk3sB8v7+RXI/vdrv6rTfcRMsaJ7L+1223SgMlQdD X-Received: by 2002:a17:902:1e5:: with SMTP id b92-v6mr17824403plb.78.1521808925233; Fri, 23 Mar 2018 05:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521808925; cv=none; d=google.com; s=arc-20160816; b=lRWCu8Ahm2B0nFnmoqn028xEfFEdLoHLe8/4OVTrAcGzgOzNBUfgg44EwnU+xHJ7XY vaD5beSnUfe7hrLx1Lg6D0RO3CK7nklBiNy7tscBg0oFaO1No3o3Gpmxq57HDSCPWLgE lxbJky/3+Xzh8DdeqPNwR0VELfV5BO9Bks1jyZdulUt2iMosTAoVK5kSXui5VdPqQDnc 079F91CRB3hM6gvZGPLsJ7OgqmFzLzx7aUAUEiY/+l7B+XYPsf+FR2GJIDKbUDLWqyHS 3u8ucH+dAW+UClAy0qD1pB38R3Zj1ZvZA3N6p/0TGDTYAFdR68FypBdEv54z+miUCZDa EtdQ== 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 :arc-authentication-results; bh=rjOZjMsSGayJWOW2PCzGgAnjQ/wQ6/Lt5QcC77o+sb0=; b=KokdqUq0dCYKZlMlKl3agIPQoX5Wq9nxQKNZf0Ldm+VI55KKOfY3pxsHeyGa43a0sX o8pXO2bWs7u6xk763QVBMV4u3pytQJJhnxw4MsNsAcD3wqiALETHsesCtSD0xt2EAPWL s34p3198I7npuGOqdlN83czZ/MpdS3QX0w3AMGPIRzoRUsDYsW2mdSrMMgNEb5Vgqjzx OPReLSPAkwA/N4wxhZl99oefCtMBXibgmhDEK09AneAWLLCw+bWvNaRLaa7/6DZHcROH UuVWSyxbdqa3frIBr99cR9HCk6hfZbl1moBtNyleAoIAwkxXQklGwQx+72irSUl7MOwA dw/Q== 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 c136si6070225pga.318.2018.03.23.05.41.50; Fri, 23 Mar 2018 05:42:05 -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 S1752622AbeCWMkl convert rfc822-to-8bit (ORCPT + 99 others); Fri, 23 Mar 2018 08:40:41 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6679 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752559AbeCWMkk (ORCPT ); Fri, 23 Mar 2018 08:40:40 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1D26852891A0; Fri, 23 Mar 2018 20:40:25 +0800 (CST) Received: from localhost (10.202.226.45) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 23 Mar 2018 20:40:25 +0800 Date: Fri, 23 Mar 2018 12:40:16 +0000 From: Jonathan Cameron To: =?ISO-8859-1?Q?Hern=E1n?= Gonzalez CC: , , , , , , Subject: Re: [PATCH 04/11] staging: iio: ad7746: Reorder variable declarations Message-ID: <20180323134016.00007753@huawei.com> In-Reply-To: <1521642539-4845-5-git-send-email-hernan@vanguardiasur.com.ar> References: <1521642539-4845-1-git-send-email-hernan@vanguardiasur.com.ar> <1521642539-4845-5-git-send-email-hernan@vanguardiasur.com.ar> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.202.226.45] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Mar 2018 11:28:52 -0300 Hern?n Gonzalez wrote: > Reorder some variable declarations in an inverse-pyramid scheme. > > Signed-off-by: Hern?n Gonzalez I'm not sure the first few cases here actually add much in the way of readablity. This 'rule' is very 'vague' deliberately as sometimes it makes sense and sometimes it really doesn't. One nice convention is to have ret on it's own line when it is the value returned by the function (it doesn't logically group with anything else). Having that one last is also nice to see (so I like your final change more than the others!) Jonathan > --- > drivers/staging/iio/cdc/ad7746.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c > index 86919e8..57623db 100644 > --- a/drivers/staging/iio/cdc/ad7746.c > +++ b/drivers/staging/iio/cdc/ad7746.c > @@ -220,8 +220,8 @@ static int ad7746_select_channel(struct iio_dev *indio_dev, > struct iio_chan_spec const *chan) > { > struct ad7746_chip_info *chip = iio_priv(indio_dev); > - int ret, delay, idx; > u8 vt_setup, cap_setup; > + int ret, delay, idx; > > switch (chan->type) { > case IIO_CAPACITANCE: > @@ -289,8 +289,8 @@ static inline ssize_t ad7746_start_calib(struct device *dev, > { > struct iio_dev *indio_dev = dev_to_iio_dev(dev); > struct ad7746_chip_info *chip = iio_priv(indio_dev); > - bool doit; > int ret, timeout = 10; > + bool doit; > > ret = strtobool(buf, &doit); > if (ret < 0) > @@ -681,8 +681,8 @@ static int ad7746_probe(struct i2c_client *client, > struct ad7746_platform_data *pdata = client->dev.platform_data; > struct ad7746_chip_info *chip; > struct iio_dev *indio_dev; > - int ret = 0; > unsigned char regval = 0; > + int ret = 0; > > indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip)); > if (!indio_dev)