Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1117910pxj; Fri, 21 May 2021 06:55:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvo+86SVhsFfYtBeTQk6dVM3zhyDnNwgIIWmDeRa+sMSRjYVRTprEZ6JQS5HRnIbg6jIxS X-Received: by 2002:aa7:cd55:: with SMTP id v21mr11688865edw.344.1621605318904; Fri, 21 May 2021 06:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621605318; cv=none; d=google.com; s=arc-20160816; b=KTI2W9o2fQl8kriT2KPCP3CYf+XXNTXgZAFy10K8LT93obmJOR8BHehNXXEDij82ti w8hz0Ek/yz2czlYPUoIR5waAHV48q4zG6+xG+uOfhuAv/GFl50UGhvpf7ALulNkHd3+2 rUMTk9+BVRwSKThyVK2faBBvsc2UagCSchBBNMei6i27t0udDq32qwcGBoprMMZ7U/mo ijU6Z47fyubzzGaVvmdJUWcvU7QdqxIm81NTild+ZvIKkLR2YlCQOSpS6zczL1tg8B9e ix+DUdM64PxnuhvCvX7XLIY6mxkaDwuxVnqUlcP2ES0AiZ0CDknbEDy2raZ6VqpjC3Yu 2Chg== 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=or2n56rchUUN+O0Ey3IVBmf3hNw4ShOy6t6olT7Yts8=; b=awIM+z+jDT9P46oPx1827cNGzP5ZXWRL3FZjPNtr0icOS0ZwLdRvI3YMUdwuhrl2Hq l5hyC9PvhM5b8wmreAVqex62re1pr/CzpnN6sqhJYGlyrbfqt0Fa/pe6wencSMuiOB/9 29AZSjeaG5QYz/uBQE2IOfxZqfh60HplHOXLtgMHM0i9IAE2chFRzrgSplT7DM39tWas I8qc5PEnoIUtdDJirz+EwmNCbTjrAm07wkLNBH3nKnPzJJCVDtswZ89mXGztsZDsIIEZ F6kTMQIG74uaEEqgjDPcJ0scN4zSIId0FDdcy/fs0xZXf04p9XPnliELuNNdQSbAfRQL PE9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kXvV09+x; 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 t12si6135058edc.179.2021.05.21.06.54.55; Fri, 21 May 2021 06:55:18 -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=kXvV09+x; 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 S236259AbhEUNys (ORCPT + 99 others); Fri, 21 May 2021 09:54:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbhEUNyq (ORCPT ); Fri, 21 May 2021 09:54:46 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 887BCC061574 for ; Fri, 21 May 2021 06:53:23 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id z137-20020a1c7e8f0000b02901774f2a7dc4so6853007wmc.0 for ; Fri, 21 May 2021 06:53:23 -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=or2n56rchUUN+O0Ey3IVBmf3hNw4ShOy6t6olT7Yts8=; b=kXvV09+x2hRrzcATNswB8+rrGsAVBOokL9TwVkrtw8xXa9K4ik9WqPLHHBDppD1mwp 7VQ613T1gisYwYQ+QOBfOnLhM0exnAbNgRcuXXMYd4/cNU5nOgRuCtEocCGoOQM+R5dH gpiDYfU2AuIkHnIiI+b/F+/+Hfe3zGwqeuZPxK+zSizY1LF9pAkseLT30IclfRycC0zl J4pPu++Qz3A/TeJSS1XsRNhLPjSYtLgkpKN5THHd589XPhx1hbWQOCWv8Z8dVvz0tOVg K9zAYcLTHpkwdfS5yUWVMKH24cY+yKBuBqmjZa2WxuQY+sPGeUZWZxZ8rwBN45D8fS7O Fb3Q== 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=or2n56rchUUN+O0Ey3IVBmf3hNw4ShOy6t6olT7Yts8=; b=txLCWfBTyAPRVXk9frCs8Itkl68RpOBtN0UhY20t1LyPr/h00rOWIxRATV0C4UKzdD uOpmu4gveC77kb4O8dCe2I2zppYcXiUrFXr11UEoORYrE+xahhJ7Zsm/62mTDggzc7BV MYfHdE3On2E6TRfIipp5G4fRnQg0HFisa69doABbAYjKGfah/4epx7nOIPo0v+atFVgr tQNk4X4TEnrSsxWag3CJu2tuKZ6ZFa1uCmEK4oOQ2U3exq8YiTImvrV0BWL+xKhOhaPC oGSywx7vTfD1ZhGN9N3XaDX7PMKbMW3/TN7YSa5mP1wCZMVURiyQXMb9seLEn3wmwZQC qwzg== X-Gm-Message-State: AOAM531Yhdy5ToAL1wcTa/9Hp4Vne68eU1juUqNLJ6Je/zIVlBnvz22i zeI04Y7f5OHiPk33ZirEIu6/oQ== X-Received: by 2002:a7b:c444:: with SMTP id l4mr8873126wmi.36.1621605202105; Fri, 21 May 2021 06:53:22 -0700 (PDT) Received: from dell ([91.110.221.215]) by smtp.gmail.com with ESMTPSA id c64sm3596361wma.15.2021.05.21.06.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 06:53:21 -0700 (PDT) Date: Fri, 21 May 2021 14:53:19 +0100 From: Lee Jones To: Dan Carpenter Cc: Ian Abbott , 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: <20210521135319.GH2549456@dell> References: <20210520122538.3470259-1-lee.jones@linaro.org> <20210520122538.3470259-6-lee.jones@linaro.org> <20210521072635.GY2549456@dell> <20210521115431.GK1955@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210521115431.GK1955@kadam> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 May 2021, Dan Carpenter wrote: > On Fri, May 21, 2021 at 08:26:35AM +0100, Lee Jones wrote: > > 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? > > You should probably take Ian's suggestion because he is the maintainer I think you missed my point. Now there are 2 options; I'd like Ian to tell me which one to implement. > and I really doubt Uwe's will build. :P But Uwe is right that > including .c files is ugly. No one is disputing that. :) -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog