Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1639417ybx; Sat, 2 Nov 2019 03:44:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2+iHrInJ+Qs5B4idQcDlaxhpLabVjxsm69pZqIA9JAT2/13Bg37YnOPzkR0JUGFvOhIju X-Received: by 2002:a05:6402:138c:: with SMTP id b12mr3166973edv.28.1572691481817; Sat, 02 Nov 2019 03:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572691481; cv=none; d=google.com; s=arc-20160816; b=ZJR/pzr4xmpGHu4sOx2UFm2CQziWOSMUwZYU6Q5dsJJd+y3xEScqw5iVEouR4lwlA/ XE5R/43375c8Ibiw8oUJ0XyxXYJFr4ejIMxmgKWH2dRDdnPsgEK1XMLvE64cOOW84fJ7 NP4hyDolIm/nPqA8pGRIKBzJWdsP7lzR3UdG97BJtDIrhn6MiYS/4WW4BwWy0cf8FECH RXdaE3pI/1B5n/RmRZ7puNiNeWQk9pIXUV2AJyQf/P58OkRgj1Kn8gpP9B4hlidbz7pH 4W1yBml3vyr4gJhlK5JgvQr+42Z3uFXge40pSrXM/Iw+EFj2lTF50C5BE15uGkgqfRbO Hecw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iTxQrDqX1ETEL/KmAuFDZOF+4+BqOHIHRcDuMdMWN1I=; b=uQrgYtPHlOy1dWY+6RKvzlh1IQqgrD/tSdy31fmUicD4XSGBRM4dXn0tUBlOIJvilN xREBq8fGhYQVECT9QdMQbA26vjuCOnP8KYdf9pNscT03oWX5Phzh8aNaYbg7nwozfK/r Jz0hmJ5cVLwZeXT5J6ZrnxF/GhBsCk+mIDDQHZwK1bKqTnmKbbVcCOFUDfI5dpTc0nYB prqMB704L6XK/B+MWUl71AP13OAGrqEVvrwFXA85PWL/ZAdAA5KTjajFMehFM0pLkObG bl68DvZ9gZkR4sQ3OMBXUP2yyLqR8Y+kwksCoIZW9kfCIiQUZP9Ly9wFN5XJuHi+ydIH PGGg== 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 e56si2653110edb.172.2019.11.02.03.44.17; Sat, 02 Nov 2019 03:44:41 -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 S1726651AbfKBKlb (ORCPT + 99 others); Sat, 2 Nov 2019 06:41:31 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:60982 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbfKBKla (ORCPT ); Sat, 2 Nov 2019 06:41:30 -0400 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990406AbfKBKl1kwUuD (ORCPT + 1 other); Sat, 2 Nov 2019 11:41:27 +0100 Date: Sat, 2 Nov 2019 11:41:25 +0100 From: Ladislav Michl To: YueHaibing Cc: jic23@kernel.org, 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: <20191102104125.GA22015@lenoch> References: <20191101134741.25108-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191101134741.25108-1-yuehaibing@huawei.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > { }, > }; > +#endif > > /* Read ST-specific _ONT orientation data from ACPI and generate an > * appropriate mount matrix. > -- > 2.7.4 >