Netdev List
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <timur@codeaurora.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH net-next] net: qcom/emac: fix unused variable
Date: Tue, 29 May 2018 18:43:43 +0800	[thread overview]
Message-ID: <20180529104343.19448-1-yuehaibing@huawei.com> (raw)

When CONFIG_ACPI isn't set, variable qdf2400_ops/qdf2432_ops isn't used.
drivers/net/ethernet/qualcomm/emac/emac-sgmii.c:284:25: warning: ‘qdf2400_ops’ defined but not used [-Wunused-variable]
 static struct sgmii_ops qdf2400_ops = {
                         ^~~~~~~~~~~
drivers/net/ethernet/qualcomm/emac/emac-sgmii.c:276:25: warning: ‘qdf2432_ops’ defined but not used [-Wunused-variable]
 static struct sgmii_ops qdf2432_ops = {
                         ^~~~~~~~~~~

Move the declaration and functions inside the CONFIG_ACPI ifdef 
to fix the warning.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/qualcomm/emac/emac-sgmii.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c
index 562420b..15609cb 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-sgmii.c
@@ -108,6 +108,7 @@ static void emac_sgmii_link_init(struct emac_adapter *adpt)
 	writel(val, phy->base + EMAC_SGMII_PHY_AUTONEG_CFG2);
 }
 
+#ifdef CONFIG_ACPI
 static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits)
 {
 	struct emac_sgmii *phy = &adpt->phy;
@@ -291,7 +292,6 @@ static struct sgmii_ops qdf2400_ops = {
 
 static int emac_sgmii_acpi_match(struct device *dev, void *data)
 {
-#ifdef CONFIG_ACPI
 	static const struct acpi_device_id match_table[] = {
 		{
 			.id = "QCOM8071",
@@ -327,10 +327,16 @@ static int emac_sgmii_acpi_match(struct device *dev, void *data)
 			return 1;
 		}
 	}
-#endif
 
 	return 0;
 }
+#else
+static int emac_sgmii_acpi_match(struct device *dev, void *data)
+{
+	return 0;
+}
+
+#endif
 
 static const struct of_device_id emac_sgmii_dt_match[] = {
 	{
-- 
2.7.0

             reply	other threads:[~2018-05-29 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 10:43 YueHaibing [this message]
2018-05-30 12:10 ` [PATCH net-next] net: qcom/emac: fix unused variable Timur Tabi
2018-05-31  1:34   ` YueHaibing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180529104343.19448-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=timur@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox