From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: corentincj@iksaif.net, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, IvDoorn@gmail.com
Subject: Re: [PATCH 2/2] eeepc-laptop: Use standard interfaces
Date: Mon, 4 Aug 2008 18:29:52 -0300 [thread overview]
Message-ID: <20080804212952.GC24927@khazad-dum.debian.net> (raw)
In-Reply-To: <20080804171504.GB9513@srcf.ucam.org>
On Mon, 04 Aug 2008, Matthew Garrett wrote:
> +static int eeepc_wlan_rfkill_set(void *data, enum rfkill_state state)
> +{
> + return set_acpi(CM_ASL_WLAN, state);
> +}
> +
> +static int eeepc_wlan_rfkill_state(void *data, enum rfkill_state *state)
> +{
> + *state = get_acpi(CM_ASL_WLAN);
> + return 0;
> +}
This might just be style, but I'd rather you didn't do this unless get_acpi
and set_acpi do take enum rfkill_state... Doing state conversion would be a
lot more future-proof, as well:
Something like:
set_acpi(CM_ASL_WLAN, (state == RFKILL_STATE_UNBLOCKED) ? 0 : 1);
And:
*state = get_acpi(CM_ASL_WLAN) ? RFKILL_STATE_SOFT_BLOCKED :
RFKILL_STATE_UNBLOCKED;
Adjust as needed.
> + ehotk->eeepc_wlan_rfkill->user_claim_unsupported = 0;
This is not needed, and if we get rid of user_claim_unsupported later, your
code wouldn't need changes if you get rid of that line.
I have not paid much attention to it yet, but so far I have failed to
understand what user_claim_unsupported is good for in the new style rfkill
interface.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
next prev parent reply other threads:[~2008-08-04 21:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-04 17:08 [PATCH 1/2] eeepc-laptop: Fix user after free Matthew Garrett
2008-08-04 17:15 ` [PATCH 2/2] eeepc-laptop: Use standard interfaces Matthew Garrett
2008-08-04 17:53 ` Ivo van Doorn
2008-08-04 17:36 ` Matthew Garrett
2008-08-04 21:21 ` Henrique de Moraes Holschuh
2008-08-04 21:29 ` Henrique de Moraes Holschuh [this message]
2008-08-06 9:23 ` [PATCH v2 1/2] eeepc-laptop: Fix user after free Matthew Garrett
2008-08-06 9:25 ` [PATCH v2 2/2] eeepc-laptop: Use standard interfaces Matthew Garrett
2008-08-19 9:58 ` Andrew Morton
2008-08-19 11:13 ` Matthew Garrett
2008-08-19 23:09 ` Henrique de Moraes Holschuh
2008-08-19 23:24 ` Matthew Garrett
2008-08-20 1:18 ` Henrique de Moraes Holschuh
2008-08-20 1:28 ` Matthew Garrett
2008-08-20 1:32 ` Henrique de Moraes Holschuh
2008-08-20 1:42 ` Awkward rfkill corner cases Matthew Garrett
2008-08-20 2:30 ` Henrique de Moraes Holschuh
2008-10-08 20:50 ` [PATCH v2 2/2] eeepc-laptop: Use standard interfaces Len Brown
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=20080804212952.GC24927@khazad-dum.debian.net \
--to=hmh@hmh.eng.br \
--cc=IvDoorn@gmail.com \
--cc=corentincj@iksaif.net \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.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