Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1393568pxj; Fri, 21 May 2021 13:08:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/yHnLbpQuwujZm6YBkQDYV28vNdwNI00egyfkLSVr1E6g7nwKZvONS0Pq+jN0wnBJejp9 X-Received: by 2002:a05:6638:2594:: with SMTP id s20mr6838565jat.140.1621627721170; Fri, 21 May 2021 13:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627721; cv=none; d=google.com; s=arc-20160816; b=RpGdEjtY0hcH4F4vwgKjczm91sqfBwsew/8cUUZywOzN6zVpsvDoXPPqfzAdGZoG37 RuMZrphYSJE+e4+OFuJfjltE1fRpFYGDsuuDqgYx37Uq9O2/P4f9Cr7S/biNXdhu0boq dKSzE5DeOv3rf71jJdEHOvqu+mlWw/JnC/SZYi/tcAdTqHS8oV8UZ5kDN37PBeIJEZj/ i7rowpa/bML2ihSlT1NHZCh5FP4qW6Ogw5MWQZGUnhIYUrcwzGHnlu3gjINSBCucAcep dwKLzFS9+8aMwwDXVJkUT9/bvchfhrhjVbJ9miOWk23G6NNDyfoIbTJvYetonLGKHYqZ S/mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wHJsiC5bAPMJ/JK2F8/kAPqQTZHzq5ny0YRHjZNAtPg=; b=PotxkYOXohYOf3YcL7nhKXr56kUYVlyqQyxXdZExR6rK1OwmGXTk8he8EEUJfA5OtK XdY1IDWKi+5vBXgEmgJn2BWhfztbdmCAmv21zAFF4lE0r4K1ASXEj+zKdZ+CzUY1U6Do zJ9HTfnAbGSonicIzMkw7D3jwl69OcJjFojr71Zid96bSWKzaT6JieuBgzatG0C+8u7s JP8BM4aZvkj57uDft7j45QAskaaCKM0ZyNbxiHXyrA+SxYGyLXd2OTeN5ZSizBzndZ1W ec9tbKHSVdHXoc3RnDDWwgd8xEUE0NuetVnXucJFUUmigcLSdSBjXGRhkqTIwd3vmmvo qjoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="D9Q+TP0/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si6825420ilt.149.2021.05.21.13.08.28; Fri, 21 May 2021 13:08:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="D9Q+TP0/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234186AbhEUH2C (ORCPT + 99 others); Fri, 21 May 2021 03:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232281AbhEUH2B (ORCPT ); Fri, 21 May 2021 03:28:01 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84B3C061763 for ; Fri, 21 May 2021 00:26:38 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id p7so16260829wru.10 for ; Fri, 21 May 2021 00:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=wHJsiC5bAPMJ/JK2F8/kAPqQTZHzq5ny0YRHjZNAtPg=; b=D9Q+TP0/xYt4iQ45TGcwC580vJ0ZoowBEIqSbX9KoF301h+z+xAJAjXYNPkmhcmO3e zgy8E4COS7RDsbiucJ8FlmM7gnHuo/tVxwxKnSuTnfWx7uRMZFWkONcGL/Z4kp67mBFd +BnwEy2t7VMOC5CB1PKqSyOdh022za9V8pMv7R+5xMLKhsHhnU+5ObBAXKY4z8y/z96D j8VsK3FcOyNuElRe11Uw4MSYYWTFG/lDwZJudfhwDtpsZ7558q8GbrerDk67+Nwb0u3F 8ztbk2Uyee+zWrCrQoirq+/r9tPtihNRW9BEl1cAAPqcqBxrsYTnsNaI3S9qaJGvh07Y N4tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=wHJsiC5bAPMJ/JK2F8/kAPqQTZHzq5ny0YRHjZNAtPg=; b=iDCKaX3aOI8Z9bnBjAl352ULO+A4CU6gC979nycZipljKG0AUJ3zWfvJYaYKTH0Q8s 0HCJM+YwXnhGKUlPPuVBk40OYK5itmhAhZGoWSNpX9RVW0qVXyRlLgIySL/VsqAJUSb7 cbW+rjDIE/J/MlDxCecDliiFQd6vtcpvwMVrWmDVTANrY0fcV8ctm9eJH+9qroPIJW6i c5AWpszGOinbm8kKDcOmWRWoI3DkAnU8+B8XUTn/N+J2wiwLUCaUWMOIZ5QXOx+KFa8o MAfbQX+7RQNqpwec8MgtT77/+zewug36pAdyMqXoOb4KNR7SCi06O49PzdkCEcXPNpNQ y/mg== X-Gm-Message-State: AOAM533JPeuiz1FfccVE3tD4PA6aW8yLyPmdEcRK+zonMoOhJDB8Tqrt lMbfnicotvV8odP+Y25F2TQk3g== X-Received: by 2002:a5d:688d:: with SMTP id h13mr7927610wru.362.1621581997336; Fri, 21 May 2021 00:26:37 -0700 (PDT) Received: from dell ([91.110.221.215]) by smtp.gmail.com with ESMTPSA id c6sm1032177wru.50.2021.05.21.00.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 00:26:36 -0700 (PDT) Date: Fri, 21 May 2021 08:26:35 +0100 From: Lee Jones To: Ian Abbott Cc: linux-kernel@vger.kernel.org, H Hartley Sweeten , Greg Kroah-Hartman , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , "David A. Schleef" , Mori Hess , Truxton Fulton , linux-staging@lists.linux.dev, linux-pwm@vger.kernel.org Subject: Re: [PATCH 5/6] comedi: drivers: ni_mio_common: Move 'range_ni_E_ao_ext' to where it is used Message-ID: <20210521072635.GY2549456@dell> References: <20210520122538.3470259-1-lee.jones@linaro.org> <20210520122538.3470259-6-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 May 2021, Ian Abbott wrote: > On 20/05/2021 13:25, Lee Jones wrote: > > ... and mark it as __maybe_unused since not all users of the > > header file reference it. > > > > Fixes the following W=1 kernel build warning(s): > > > > drivers/staging/comedi/drivers/ni_mio_common.c:163:35: warning: ‘range_ni_E_ao_ext’ defined but not used [-Wunused-const-variable=] > > > > Cc: Ian Abbott > > Cc: H Hartley Sweeten > > Cc: Greg Kroah-Hartman > > Cc: Thierry Reding > > Cc: "Uwe Kleine-König" > > Cc: Lee Jones > > Cc: "David A. Schleef" > > Cc: Mori Hess > > Cc: Truxton Fulton > > Cc: linux-staging@lists.linux.dev > > Cc: linux-pwm@vger.kernel.org > > Signed-off-by: Lee Jones > > --- > > drivers/comedi/drivers/ni_mio_common.c | 9 --------- > > drivers/comedi/drivers/ni_stc.h | 9 ++++++++- > > 2 files changed, 8 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/comedi/drivers/ni_mio_common.c b/drivers/comedi/drivers/ni_mio_common.c > > index 4f80a4991f953..37615b4e2c10d 100644 > > --- a/drivers/comedi/drivers/ni_mio_common.c > > +++ b/drivers/comedi/drivers/ni_mio_common.c > > @@ -160,15 +160,6 @@ static const struct comedi_lrange range_ni_M_ai_628x = { > > } > > }; > > -static const struct comedi_lrange range_ni_E_ao_ext = { > > - 4, { > > - BIP_RANGE(10), > > - UNI_RANGE(10), > > - RANGE_ext(-1, 1), > > - RANGE_ext(0, 1) > > - } > > -}; > > - > > static const struct comedi_lrange *const ni_range_lkup[] = { > > [ai_gain_16] = &range_ni_E_ai, > > [ai_gain_8] = &range_ni_E_ai_limited, > > diff --git a/drivers/comedi/drivers/ni_stc.h b/drivers/comedi/drivers/ni_stc.h > > index fbc0b753a0f59..0822e65f709dd 100644 > > --- a/drivers/comedi/drivers/ni_stc.h > > +++ b/drivers/comedi/drivers/ni_stc.h > > @@ -1137,6 +1137,13 @@ struct ni_private { > > u8 rgout0_usage; > > }; > > -static const struct comedi_lrange range_ni_E_ao_ext; > > +static const struct comedi_lrange __maybe_unused range_ni_E_ao_ext = { > > + 4, { > > + BIP_RANGE(10), > > + UNI_RANGE(10), > > + RANGE_ext(-1, 1), > > + RANGE_ext(0, 1) > > + } > > +}; > > #endif /* _COMEDI_NI_STC_H */ > > > > The "ni_stc.h" header is also included by "ni_mio_cs.c" which doesn't need > `range_ni_E_ao_ext` (admittedly, it was already pulling in a "tentative" > definition of the variable). > > Thinking about it, I think it's probably better to move `range_ni_E_ao_ext` > from "ni_mio_common.c" into *both* "ni_atmio.c" and "ni_pcimio.c" (I think > we can live with the small amount of duplication), and to remove the > tentative definition from "ni_stc.h". Happy to rework. Am I taking this or Uwe's suggestion? -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog