LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: qcom/emac: fix unused variable
@ 2018-05-29 10:43 YueHaibing
  2018-05-30 12:10 ` Timur Tabi
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2018-05-29 10:43 UTC (permalink / raw)
  To: davem, timur; +Cc: netdev, linux-kernel, YueHaibing

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: qcom/emac: fix unused variable
  2018-05-29 10:43 [PATCH net-next] net: qcom/emac: fix unused variable YueHaibing
@ 2018-05-30 12:10 ` Timur Tabi
  2018-05-31  1:34   ` YueHaibing
  0 siblings, 1 reply; 3+ messages in thread
From: Timur Tabi @ 2018-05-30 12:10 UTC (permalink / raw)
  To: YueHaibing, davem; +Cc: netdev, linux-kernel

On 5/29/18 5:43 AM, YueHaibing wrote:
> 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>

I already fixed this with:

https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=d377df784178bf5b0a39e75dc8b1ee86e1abb3f6

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: qcom/emac: fix unused variable
  2018-05-30 12:10 ` Timur Tabi
@ 2018-05-31  1:34   ` YueHaibing
  0 siblings, 0 replies; 3+ messages in thread
From: YueHaibing @ 2018-05-31  1:34 UTC (permalink / raw)
  To: Timur Tabi, davem; +Cc: netdev, linux-kernel


On 2018/5/30 20:10, Timur Tabi wrote:
> On 5/29/18 5:43 AM, YueHaibing wrote:
>> 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>
> 
> I already fixed this with:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=d377df784178bf5b0a39e75dc8b1ee86e1abb3f6
>

Oh,I should notice this, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-31  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 10:43 [PATCH net-next] net: qcom/emac: fix unused variable YueHaibing
2018-05-30 12:10 ` Timur Tabi
2018-05-31  1:34   ` YueHaibing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).