LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] hp-wmi: Fix warnings
@ 2008-11-02 16:36 Larry Finger
2008-11-11 22:19 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2008-11-02 16:36 UTC (permalink / raw)
To: Matthew Garrett; +Cc: LKML
Compilation of the HP WMI hotkeys code results in the following:
CC [M] drivers/misc/hp-wmi.o
drivers/misc/hp-wmi.c: In function hp_wmi_bios_setup:
drivers/misc/hp-wmi.c:431: warning: ignoring return value of rfkill_register,
declared with attribute warn_unused_result
drivers/misc/hp-wmi.c:441: warning: ignoring return value of rfkill_register,
declared with attribute warn_unused_result
drivers/misc/hp-wmi.c:450: warning: ignoring return value of rfkill_register,
declared with attribute warn_unused_result
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Index: linux-2.6/drivers/misc/hp-wmi.c
===================================================================
--- linux-2.6.orig/drivers/misc/hp-wmi.c
+++ linux-2.6/drivers/misc/hp-wmi.c
@@ -428,7 +428,9 @@ static int __init hp_wmi_bios_setup(stru
wifi_rfkill->state = hp_wmi_wifi_state();
wifi_rfkill->toggle_radio = hp_wmi_wifi_set;
wifi_rfkill->user_claim_unsupported = 1;
- rfkill_register(wifi_rfkill);
+ err = rfkill_register(wifi_rfkill);
+ if (err)
+ goto add_sysfs_error;
}
if (wireless & 0x2) {
@@ -438,7 +440,8 @@ static int __init hp_wmi_bios_setup(stru
bluetooth_rfkill->state = hp_wmi_bluetooth_state();
bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set;
bluetooth_rfkill->user_claim_unsupported = 1;
- rfkill_register(bluetooth_rfkill);
+ err = rfkill_register(bluetooth_rfkill);
+ goto register_bluetooth_error;
}
if (wireless & 0x4) {
@@ -447,10 +450,16 @@ static int __init hp_wmi_bios_setup(stru
wwan_rfkill->state = hp_wmi_wwan_state();
wwan_rfkill->toggle_radio = hp_wmi_wwan_set;
wwan_rfkill->user_claim_unsupported = 1;
- rfkill_register(wwan_rfkill);
+ err = rfkill_register(wwan_rfkill);
+ if (err)
+ goto register_wwan_err;
}
return 0;
+register_wwan_err:
+ rfkill_unregister(bluetooth_rfkill);
+register_bluetooth_error:
+ rfkill_unregister(wifi_rfkill);
add_sysfs_error:
cleanup_sysfs(device);
return err;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] hp-wmi: Fix warnings
2008-11-02 16:36 [PATCH] hp-wmi: Fix warnings Larry Finger
@ 2008-11-11 22:19 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-11-11 22:19 UTC (permalink / raw)
To: Larry Finger; +Cc: mjg59, linux-kernel
On Sun, 02 Nov 2008 08:36:06 -0800
Larry Finger <Larry.Finger@lwfinger.net> wrote:
> Subject: [PATCH] hp-wmi: Fix warnings
A nit: the point of such a patch is _not_ to "fix warnings". It is to
fix the issues which those warnings are warning us about!
I renamed the patch to "hp-wmi: handle rfkill_register() failure",
thanks.
> Compilation of the HP WMI hotkeys code results in the following:
>
> CC [M] drivers/misc/hp-wmi.o
> drivers/misc/hp-wmi.c: In function hp_wmi_bios_setup:
> drivers/misc/hp-wmi.c:431: warning: ignoring return value of rfkill_register,
> declared with attribute warn_unused_result
> drivers/misc/hp-wmi.c:441: warning: ignoring return value of rfkill_register,
> declared with attribute warn_unused_result
> drivers/misc/hp-wmi.c:450: warning: ignoring return value of rfkill_register,
> declared with attribute warn_unused_result
>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>
>
> Index: linux-2.6/drivers/misc/hp-wmi.c
> ===================================================================
> --- linux-2.6.orig/drivers/misc/hp-wmi.c
> +++ linux-2.6/drivers/misc/hp-wmi.c
> @@ -428,7 +428,9 @@ static int __init hp_wmi_bios_setup(stru
> wifi_rfkill->state = hp_wmi_wifi_state();
> wifi_rfkill->toggle_radio = hp_wmi_wifi_set;
> wifi_rfkill->user_claim_unsupported = 1;
> - rfkill_register(wifi_rfkill);
> + err = rfkill_register(wifi_rfkill);
> + if (err)
> + goto add_sysfs_error;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-11 22:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-02 16:36 [PATCH] hp-wmi: Fix warnings Larry Finger
2008-11-11 22:19 ` Andrew Morton
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).