* [PATCH] Explicitly ignore unused return value of _hfcpci_softirq
@ 2010-03-03 0:00 imunsie
2010-03-03 8:31 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: imunsie @ 2010-03-03 0:00 UTC (permalink / raw)
To: linux-kernel
Cc: Ian Munsie, Karsten Keil, David S. Miller, Andreas Eversberg,
Andreas Mohr
From: Ian Munsie <imunsie@au.ibm.com>
The compiler throws the following warning during compilation:
drivers/isdn/hardware/mISDN/hfcpci.c:2319: warning: ignoring return value of 'driver_for_each_device', declared with attribute warn_unused_result
driver_for_each_device is being used to call _hfcpci_softirq for each
device, which will only ever return 0.
This patch explicitly ignores the return value to silence the warning.
Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
---
drivers/isdn/hardware/mISDN/hfcpci.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index 70e6b0e..1333d4a 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2316,7 +2316,8 @@ _hfcpci_softirq(struct device *dev, void *arg)
static void
hfcpci_softirq(void *arg)
{
- (void) driver_for_each_device(&hfc_driver.driver, NULL, arg,
+ int err;
+ err = driver_for_each_device(&hfc_driver.driver, NULL, arg,
_hfcpci_softirq);
/* if next event would be in the past ... */
--
1.6.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Explicitly ignore unused return value of _hfcpci_softirq
2010-03-03 0:00 [PATCH] Explicitly ignore unused return value of _hfcpci_softirq imunsie
@ 2010-03-03 8:31 ` Dan Carpenter
2010-03-04 4:16 ` [PATCH v2] mISDN: " Ian Munsie
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-03-03 8:31 UTC (permalink / raw)
To: imunsie
Cc: linux-kernel, Karsten Keil, David S. Miller, Andreas Eversberg,
Andreas Mohr
On Wed, Mar 03, 2010 at 11:00:53AM +1100, imunsie@au1.ibm.com wrote:
> From: Ian Munsie <imunsie@au.ibm.com>
>
> The compiler throws the following warning during compilation:
>
> drivers/isdn/hardware/mISDN/hfcpci.c:2319: warning: ignoring return value of 'driver_for_each_device', declared with attribute warn_unused_result
>
> driver_for_each_device is being used to call _hfcpci_softirq for each
> device, which will only ever return 0.
> This patch explicitly ignores the return value to silence the warning.
>
> Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
> ---
> drivers/isdn/hardware/mISDN/hfcpci.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
> index 70e6b0e..1333d4a 100644
> --- a/drivers/isdn/hardware/mISDN/hfcpci.c
> +++ b/drivers/isdn/hardware/mISDN/hfcpci.c
> @@ -2316,7 +2316,8 @@ _hfcpci_softirq(struct device *dev, void *arg)
> static void
> hfcpci_softirq(void *arg)
> {
> - (void) driver_for_each_device(&hfc_driver.driver, NULL, arg,
> + int err;
> + err = driver_for_each_device(&hfc_driver.driver, NULL, arg,
> _hfcpci_softirq);
>
Could you name the variable "dummy" instead of "err"? Every few months I go through
and look for code like what you have done here and it sucks to try figure out if
people are ignoring the errors on purpose or not.
regards,
dan carpenter
> /* if next event would be in the past ... */
> --
> 1.6.6.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] mISDN: Explicitly ignore unused return value of _hfcpci_softirq
2010-03-03 8:31 ` Dan Carpenter
@ 2010-03-04 4:16 ` Ian Munsie
0 siblings, 0 replies; 3+ messages in thread
From: Ian Munsie @ 2010-03-04 4:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Dan Carpenter, Ian Munsie
From: Ian Munsie <imunsie@au.ibm.com>
The compiler throws the following warning during compilation:
drivers/isdn/hardware/mISDN/hfcpci.c:2319: warning: ignoring return value of 'driver_for_each_device', declared with attribute warn_unused_result
driver_for_each_device is being used to call _hfcpci_softirq for each
device, which will only ever return 0.
This patch explicitly ignores the return value to silence the warning.
Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
---
Changes since v1: Changed name of dummy variable to hold unused return value from 'err' to 'dummy' as per Dan Carpenter's feedback.
drivers/isdn/hardware/mISDN/hfcpci.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
index 70e6b0e..ae50e5a 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2316,7 +2316,8 @@ _hfcpci_softirq(struct device *dev, void *arg)
static void
hfcpci_softirq(void *arg)
{
- (void) driver_for_each_device(&hfc_driver.driver, NULL, arg,
+ int dummy;
+ dummy = driver_for_each_device(&hfc_driver.driver, NULL, arg,
_hfcpci_softirq);
/* if next event would be in the past ... */
--
1.7.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-04 4:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03 0:00 [PATCH] Explicitly ignore unused return value of _hfcpci_softirq imunsie
2010-03-03 8:31 ` Dan Carpenter
2010-03-04 4:16 ` [PATCH v2] mISDN: " Ian Munsie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox