Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp5698656ybx; Sun, 10 Nov 2019 19:28:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwKTYZGsr1m+8u3s4+HDHl/alxboXc6adSkT5WK8HjZM3vCawNnNAGP3eLDzdA7tc+YtbYY X-Received: by 2002:a17:906:6dd1:: with SMTP id j17mr774457ejt.86.1573442898846; Sun, 10 Nov 2019 19:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573442898; cv=none; d=google.com; s=arc-20160816; b=Ay4H91tjwDu98dzXC6TT9b6AyKziLqAnJiTTaKl2uG+fK/1+scw3AbZb8g+l8NpMzS bpKLgl/AR33WlPLFHcZRM2ZQ5TLozF5tj9c1rs94GMA5tjZDLjEnvaMBmigrJc0ZPSrs IuuO8jhWWDkMgeRL2wQTz2Q5Fd+JgWhckJxclaaA6ohNRmVsTyeGNeWtAOGbCf7WAJoi 6t4w7FwfViJScxvF/veNSTigRKIcJJM4bDQPrPmnbxch2fLUQzkzkuIIxFC3mCmmfdTW vnVktPOg2z1UnBH6Z47jZ+O43c0M3JdnT6t6bIw+pTxemL4rYu6+xp8KajwfEyZ/fJU3 6N0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=6U3EFSRN6sf60B52DHSyfs85pRDov3R/KhY5Q3JfCkY=; b=YO0r7EgNpaHBl3e3m0xOWw2uU1LQuMuV7uk9XuJqyyO5Cpqqcgqxock7uW8oUbUtEy xZd0xrfmLCYt4txvu00srZP3J9sm3vd8dU3qMDq9g5T8M8Pc/3hpjGihnyz7K8ub+/zl c+La68QY/Qj4Za1gdig+f90yLsxW13KBI1ipK64R/IIIfXhoGEgzgiDWUKDi/9tV4riv bjQ8RMfpgVOj0SsbO5R9XCsj04DFwT/eL8AZ3LD1YtcKifdVMD7n7HE3BwqOJ35SMMPP hu6r7VR5M+Fx/q5qBleIGUdrMaR/eVM4yFTyrkBLlhVut/tpf7cJED2YgW6rsuTrUqR/ eRdw== 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 k26si8414268eja.58.2019.11.10.19.27.55; Sun, 10 Nov 2019 19:28:18 -0800 (PST) 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 S1726791AbfKKD1G (ORCPT + 99 others); Sun, 10 Nov 2019 22:27:06 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:6182 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726742AbfKKD1G (ORCPT ); Sun, 10 Nov 2019 22:27:06 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A38838B905A01154A088; Mon, 11 Nov 2019 11:27:02 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Mon, 11 Nov 2019 11:26:54 +0800 From: YueHaibing To: , , , , , , , , , , CC: , Subject: [PATCH v2 -next] iio: st_accel: Fix unused variable warning Date: Mon, 11 Nov 2019 11:21:15 +0800 Message-ID: <20191111032115.3008-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20191101134741.25108-1-yuehaibing@huawei.com> References: <20191101134741.25108-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/iio/accel/st_accel_core.c:1005:44: warning: mount_matrix_ext_info defined but not used [-Wunused-const-variable=] Using stub helper while CONFIG_ACPI is disabled to fix it. Suggested-by: Ladislav Michl Signed-off-by: YueHaibing --- drivers/iio/accel/st_accel_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 7b83764..7320275 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -992,6 +992,7 @@ static const struct iio_trigger_ops st_accel_trigger_ops = { #define ST_ACCEL_TRIGGER_OPS NULL #endif +#ifdef CONFIG_ACPI static const struct iio_mount_matrix * get_mount_matrix(const struct iio_dev *indio_dev, const struct iio_chan_spec *chan) @@ -1012,7 +1013,6 @@ static const struct iio_chan_spec_ext_info mount_matrix_ext_info[] = { static int apply_acpi_orientation(struct iio_dev *indio_dev, struct iio_chan_spec *channels) { -#ifdef CONFIG_ACPI struct st_sensor_data *adata = iio_priv(indio_dev); struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; struct acpi_device *adev; @@ -1140,10 +1140,14 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev, out: kfree(buffer.pointer); return ret; +} #else /* !CONFIG_ACPI */ +static int apply_acpi_orientation(struct iio_dev *indio_dev, + struct iio_chan_spec *channels) +{ return 0; -#endif } +#endif /* * st_accel_get_settings() - get sensor settings from device name -- 2.7.4