Patchwork mISDN: suppress compiler warning

login
register
mail settings
Submitter Paul Bolle
Date Sept. 21, 2012, 10:25 a.m.
Message ID <1348223124.1581.15.camel@x61.thuisdomein>
Download mbox | patch
Permalink /patch/185677/
State Rejected
Delegated to: David Miller
Headers show

Comments

Paul Bolle - Sept. 21, 2012, 10:25 a.m.
Building the hfcpci driver triggers this GCC warning:
    drivers/isdn/hardware/mISDN/hfcpci.c:2298:2: warning: ignoring return value of 'driver_for_each_device', declared with attribute warn_unused_result [-Wunused-result]

That return value is apparently ignored because _hfcpci_softirq() will
always return 0. Suppress this warning in the way a few other drivers do
that too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
0) I noticed this warning while building v3.6-rc6 on current Fedora 17,
using Fedora's default config.

1) Compile tested only.

 drivers/isdn/hardware/mISDN/hfcpci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
David Miller - Sept. 21, 2012, 5:49 p.m.
From: Paul Bolle <pebolle@tiscali.nl>
Date: Fri, 21 Sep 2012 12:25:24 +0200

> Building the hfcpci driver triggers this GCC warning:
>     drivers/isdn/hardware/mISDN/hfcpci.c:2298:2: warning: ignoring return value of 'driver_for_each_device', declared with attribute warn_unused_result [-Wunused-result]
> 
> That return value is apparently ignored because _hfcpci_softirq() will
> always return 0. Suppress this warning in the way a few other drivers do
> that too.
> 
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>

This is pretty pointless and I'm therefore not applying it.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index 81363ff..a547c8c 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2295,8 +2295,11 @@  _hfcpci_softirq(struct device *dev, void *arg)
 static void
 hfcpci_softirq(void *arg)
 {
-	(void) driver_for_each_device(&hfc_driver.driver, NULL, arg,
+	int ret;
+
+	ret = driver_for_each_device(&hfc_driver.driver, NULL, arg,
 				      _hfcpci_softirq);
+	(void)ret;	/* suppress compiler warning */
 
 	/* if next event would be in the past ... */
 	if ((s32)(hfc_jiffies + tics - jiffies) <= 0)