Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1829132ybx; Sat, 2 Nov 2019 07:09:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZST5q4jiH8Txz/BYHPoRAZWMaoMgARjfhO0sg14MsfIb2FdXOnPsEFrrcOyoTecBHtUgw X-Received: by 2002:aa7:cb09:: with SMTP id s9mr17132505edt.148.1572703760842; Sat, 02 Nov 2019 07:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572703760; cv=none; d=google.com; s=arc-20160816; b=zzbltnrxe+5UypB2pQH1CsxGJPOeGLOArhfUO5lBbFwVc2GQCjj+M97A4IkSFE7eSg z2LfMOm+6/S6htLwBuMOaNbFye6NdvYsUqVHLgAfmeVVPxsvWrdsASNUMS0Ab86CB+zL J9npr4i6rJcfKrzGP0ki23DUH+t2uh2d1XeFN93quC8hML0XQs7inRstorhUcu37fKBZ vpoTWZnOm8H6LWrE8yFsZyebi0bidIYHqArm3Zu0N1hCTCX/i5TfxfkAJMTxRdzOeqoQ mZvCHn6YCad7tNGNAjRVmm6CMXQvA45iB0RXsUZ3YJd+xHIQnNyBKpxweLENDOl2dng2 gDfw== 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 :dkim-signature; bh=7xSTUon+g1eVSXAzokg4a+GF7WTCukP86X5blbpPpQk=; b=VB7MFrrXMtkmNNjhq8BtgoxSQlUhTdnP1sl5+4jVh6hYh7u/O2igh/R0OTjSs0tPJ4 BbCIgcm4HTwbvTf5rHlqrhFoT6Ii0MbPSdMJc0RTshEOkP1Oo8BWz6UF0FW7dS82pQzS /gkQQFiGsGwpx0yFXPIrhyXPJO2bsKWJ3VppJ5p+6cCD874m07RIGfyY7eDCRu3LmbV7 nRYe72mYE6P4a5u9d7UE3p36TNzWpKDGCfP0jsiHlAh+nENc1dFtUSK3+uE8rfZZCxzD +y0+XGKIIflJM243i5pFLEvP6aGYn9C1PgBzOLTDo7S3fWHKVZ6VQbf6B3QD3E7CRvUL wIww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jY8Zv6Gz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si7447277ejk.173.2019.11.02.07.08.55; Sat, 02 Nov 2019 07:09:20 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jY8Zv6Gz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbfKBOIX (ORCPT + 99 others); Sat, 2 Nov 2019 10:08:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbfKBOIW (ORCPT ); Sat, 2 Nov 2019 10:08:22 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 432ED2080F; Sat, 2 Nov 2019 14:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572703701; bh=zkVv+PBe+dPr9yU5idGOMLaRVmsI1rFpcWxNjSshYZ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jY8Zv6GzOBEEsHYV4KOIBoMDK6g0/dT5KGAR/SLnmK7ycjawJlv1qF4drLSOFDtWg p57B8XjFFe7N3ouqRlfrx5a5hwFFZZzKyd71iIqBTOYuRomxU2Hx/iRsGnlhU8DRh7 Xalg355+OiAJYHwGcecz496eevqO+HzjjE/iGH/Y= Date: Sat, 2 Nov 2019 14:08:10 +0000 From: Jonathan Cameron To: Ladislav Michl Cc: YueHaibing , knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, denis.ciocca@st.com, rfontana@redhat.com, tglx@linutronix.de, heiko.stuebner@bq.com, rjones@gateworks.com, drake@endlessm.com, colin.king@canonical.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] iio: st_accel: Fix unused variable warning Message-ID: <20191102140810.3d756294@archlinux> In-Reply-To: <20191102104125.GA22015@lenoch> References: <20191101134741.25108-1-yuehaibing@huawei.com> <20191102104125.GA22015@lenoch> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2 Nov 2019 11:41:25 +0100 Ladislav Michl wrote: > On Fri, Nov 01, 2019 at 09:47:41PM +0800, YueHaibing wrote: > > drivers/iio/accel/st_accel_core.c:1005:44: warning: > > mount_matrix_ext_info defined but not used [-Wunused-const-variable=] > > > > Move it to ifdef to mute this warning. > > > > Signed-off-by: YueHaibing > > --- > > drivers/iio/accel/st_accel_core.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c > > index 2e37f8a..bba0717 100644 > > --- a/drivers/iio/accel/st_accel_core.c > > +++ b/drivers/iio/accel/st_accel_core.c > > @@ -1002,10 +1002,12 @@ get_mount_matrix(const struct iio_dev *indio_dev, > > return adata->mount_matrix; > > } > > > > +#ifdef CONFIG_ACPI > > static const struct iio_chan_spec_ext_info mount_matrix_ext_info[] = { > > IIO_MOUNT_MATRIX(IIO_SHARED_BY_ALL, get_mount_matrix), > > So now you do not get any warning for unused get_mount_matrix? > (Then it would make more sense to put all that stuff under one ifdef > and provide empty apply_acpi_orientation for non ACPI case) Does the __maybe_unused marking make this go away? I'd assume that the compiler will manage to drop this either way but I guess we should check that. ifdef magic is always harder to read and potentially fragile in the long run. Here we simply want to indicate that in some build configurations we might not use this. Thanks, Jonathan > > > { }, > > }; > > +#endif > > > > /* Read ST-specific _ONT orientation data from ACPI and generate an > > * appropriate mount matrix. > > -- > > 2.7.4 > >