Received: by 10.213.65.68 with SMTP id h4csp332944imn; Fri, 23 Mar 2018 05:45:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELuw0JHosG6ljp1RBNJh/ssvJqKAzJnI94I5Sf1CCnIxL/fHXMLiWZB02AWYq9QC35Nq3FFr X-Received: by 10.98.185.11 with SMTP id z11mr23812169pfe.153.1521809158167; Fri, 23 Mar 2018 05:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521809158; cv=none; d=google.com; s=arc-20160816; b=s5pTXDpJ0dSOiWDqzCX46fgPUsHLX3QzBzpr7QBCvV561SCJ9xqJXK1JOcXeJRzejn dWEQubGPVY82HKb3Eh5AqatQ1uG8DT5nT6n2v8/RCMEsW95dFpv1ZRIqWtjb06bcMmok P+64PQOjFuFWqNaAnzpcdaxl80900jC5WTDCYGuWQ7qnz72cEWOb2JEvDKSU2fTto9fd O9RK5TNply2Nq9FuTRbusB3Gqvwjk4eQx+M3oLdzoqHwvJD6GOm99jnRHW27Ho6e3jM+ AogoDEalY+WG9x6Vt62RnAhP919VNeRKMcwHi+Op8boSd45fHDngPyRIQJKvks1lgecq Fb1w== 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=uIMuEwc58jnWUeSoHA0fI0YOtBh/iFi0nFR/95TXkqk=; b=yowCRAt7s/cgfbTOSAxf59bYIbOpXwMqH+ltK1L1PiAg5S/e5r6v83Q1tUYNmAVDgK UTx/aN9b2k3tueguG/NxUm0ANHIRhQ6uD/XIeq98terpqRzq1sTLHYpaEIwQJgPYrrbW LImF4Huhk2wyO4Qpl5ak0zOhopySRiK+0OAkA0vmbjDxI55fVZh40+UNlL0dQQplTf2B ZTp43cnsPSZytCfQAwHiRoiKh82d8tFL9jk1EnxStjjJhQibgFTfjJOk7Lg6t4lNErcb 7nsGxh7aAsoal9Kd2lKUUoPhjVA6PPi8jTlpj5vvkzKGfjKG/Cpc7JyKIN4cTeNDXbiC jD+w== 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 q12-v6si9150358pli.492.2018.03.23.05.45.43; Fri, 23 Mar 2018 05:45:58 -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 S1752541AbeCWMou convert rfc822-to-8bit (ORCPT + 99 others); Fri, 23 Mar 2018 08:44:50 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:35910 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752244AbeCWMos (ORCPT ); Fri, 23 Mar 2018 08:44:48 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 5576BA44F4AF8; Fri, 23 Mar 2018 20:44:44 +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:44:41 +0800 Date: Fri, 23 Mar 2018 12:44:33 +0000 From: Jonathan Cameron To: =?ISO-8859-1?Q?Hern=E1n?= Gonzalez CC: , , , , , , Subject: Re: [PATCH 05/11] staging: iio: ad7746: Remove unused defines Message-ID: <20180323134433.00001530@huawei.com> In-Reply-To: <1521642539-4845-6-git-send-email-hernan@vanguardiasur.com.ar> References: <1521642539-4845-1-git-send-email-hernan@vanguardiasur.com.ar> <1521642539-4845-6-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:53 -0300 Hern?n Gonzalez wrote: > Signed-off-by: Hern?n Gonzalez Hmm. This sort of patch is always a trade off between clearing out unused code and the fact that the defines sometimes provide useful information even when not actually used. > --- > drivers/staging/iio/cdc/ad7746.c | 16 ---------------- > drivers/staging/iio/cdc/ad7746.h | 5 ----- > 2 files changed, 21 deletions(-) > > diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c > index 57623db..cba8cd1 100644 > --- a/drivers/staging/iio/cdc/ad7746.c > +++ b/drivers/staging/iio/cdc/ad7746.c > @@ -25,7 +25,6 @@ > * AD7746 Register Definition > */ > > -#define AD7746_REG_STATUS 0 > #define AD7746_REG_CAP_DATA_HIGH 1 > #define AD7746_REG_VT_DATA_HIGH 4 > #define AD7746_REG_CAP_SETUP 7 > @@ -38,17 +37,10 @@ > #define AD7746_REG_CAP_GAINH 15 > #define AD7746_REG_VOLT_GAINH 17 > > -/* Status Register Bit Designations (AD7746_REG_STATUS) */ > -#define AD7746_STATUS_EXCERR BIT(3) > -#define AD7746_STATUS_RDY BIT(2) > -#define AD7746_STATUS_RDYVT BIT(1) > -#define AD7746_STATUS_RDYCAP BIT(0) > - Hmm. My gut feeling is the driver really should be reading this register... Ah well. Perhaps it can go in the meantime. > /* Capacitive Channel Setup Register Bit Designations (AD7746_REG_CAP_SETUP) */ > #define AD7746_CAPSETUP_CAPEN BIT(7) > #define AD7746_CAPSETUP_CIN2 BIT(6) /* AD7746 only */ > #define AD7746_CAPSETUP_CAPDIFF BIT(5) > -#define AD7746_CAPSETUP_CACHOP BIT(0) Don't remove definitions of 'parts' of a register. It is odd to only have some parts described. > > /* Voltage/Temperature Setup Register Bit Designations (AD7746_REG_VT_SETUP) */ > #define AD7746_VTSETUP_VTEN (1 << 7) > @@ -56,13 +48,8 @@ > #define AD7746_VTSETUP_VTMD_EXT_TEMP (1 << 5) > #define AD7746_VTSETUP_VTMD_VDD_MON (2 << 5) > #define AD7746_VTSETUP_VTMD_EXT_VIN (3 << 5) > -#define AD7746_VTSETUP_EXTREF BIT(4) > -#define AD7746_VTSETUP_VTSHORT BIT(1) > -#define AD7746_VTSETUP_VTCHOP BIT(0) Same comment, keep these as odd to not know if the rest of the register is used etc... > > /* Excitation Setup Register Bit Designations (AD7746_REG_EXC_SETUP) */ > -#define AD7746_EXCSETUP_CLKCTRL BIT(7) > -#define AD7746_EXCSETUP_EXCON BIT(6) > #define AD7746_EXCSETUP_EXCB BIT(5) > #define AD7746_EXCSETUP_NEXCB BIT(4) > #define AD7746_EXCSETUP_EXCA BIT(3) > @@ -74,10 +61,7 @@ > #define AD7746_CONF_CAPFS_SHIFT 3 > #define AD7746_CONF_VTFS_MASK GENMASK(7, 6) > #define AD7746_CONF_CAPFS_MASK GENMASK(5, 3) > -#define AD7746_CONF_MODE_IDLE (0 << 0) > -#define AD7746_CONF_MODE_CONT_CONV (1 << 0) > #define AD7746_CONF_MODE_SINGLE_CONV (2 << 0) > -#define AD7746_CONF_MODE_PWRDN (3 << 0) This is really nasty. Some particular values may not be used in the driver (and they should be - for example we should power down on remove). Don't remove their definitions. > #define AD7746_CONF_MODE_OFFS_CAL (5 << 0) > #define AD7746_CONF_MODE_GAIN_CAL (6 << 0) > > diff --git a/drivers/staging/iio/cdc/ad7746.h b/drivers/staging/iio/cdc/ad7746.h > index ea8572d..2fbcee8 100644 > --- a/drivers/staging/iio/cdc/ad7746.h > +++ b/drivers/staging/iio/cdc/ad7746.h > @@ -13,11 +13,6 @@ > * TODO: struct ad7746_platform_data needs to go into include/linux/iio > */ > > -#define AD7466_EXCLVL_0 0 /* +-VDD/8 */ > -#define AD7466_EXCLVL_1 1 /* +-VDD/4 */ > -#define AD7466_EXCLVL_2 2 /* +-VDD * 3/8 */ > -#define AD7466_EXCLVL_3 3 /* +-VDD/2 */ This is used... If you wanted to use the platform data you would need these to fill it. Jonathan > - > struct ad7746_platform_data { > unsigned char exclvl; /*Excitation Voltage Level */ > bool exca_en; /* enables EXCA pin as the excitation output */