From: Ivo van Doorn <ivdoorn@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-wireless@vger.kernel.org, Michael Buesch <mb@bu3sch.de>
Subject: Re: [PATCH] rfkill: rename rfkill_mutex to rfkill_global_mutex
Date: Wed, 23 Jul 2008 20:44:46 +0200 [thread overview]
Message-ID: <200807232044.47129.IvDoorn@gmail.com> (raw)
In-Reply-To: <1216775046-9506-6-git-send-email-hmh@hmh.eng.br>
On Wednesday 23 July 2008, Henrique de Moraes Holschuh wrote:
> rfkill_mutex and rfkill->mutex are too easy to confuse with each other.
>
> Rename rfkill_mutex to rfkill_global_mutex, so that they are easier to tell
> apart with just one glance.
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: Ivo van Doorn <IvDoorn@gmail.com>
> Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> net/rfkill/rfkill.c | 40 ++++++++++++++++++++--------------------
> 1 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index 2265bc5..d6e16e1 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -37,7 +37,7 @@ MODULE_DESCRIPTION("RF switch support");
> MODULE_LICENSE("GPL");
>
> static LIST_HEAD(rfkill_list); /* list of registered rf switches */
> -static DEFINE_MUTEX(rfkill_mutex);
> +static DEFINE_MUTEX(rfkill_global_mutex);
>
> static unsigned int rfkill_default_state = RFKILL_STATE_UNBLOCKED;
> module_param_named(default_state, rfkill_default_state, uint, 0444);
> @@ -209,7 +209,7 @@ static int rfkill_toggle_radio(struct rfkill *rfkill,
> * unless a specific switch is claimed by userspace (in which case,
> * that switch is left alone).
> *
> - * Caller must have acquired rfkill_mutex.
> + * Caller must have acquired rfkill_global_mutex.
> */
> static void __rfkill_switch_all(const enum rfkill_type type,
> const enum rfkill_state state)
> @@ -231,7 +231,7 @@ static void __rfkill_switch_all(const enum rfkill_type type,
> * @type: type of interfaces to be affected
> * @state: the new state
> *
> - * Acquires rfkill_mutex and calls __rfkill_switch_all(@type, @state).
> + * Acquires rfkill_global_mutex and calls __rfkill_switch_all(@type, @state).
> * Please refer to __rfkill_switch_all() for details.
> *
> * Does nothing if rfkill_set_state_lock() was used to lock state
> @@ -239,10 +239,10 @@ static void __rfkill_switch_all(const enum rfkill_type type,
> */
> void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state)
> {
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
> if (!rfkill_state_lock)
> __rfkill_switch_all(type, state);
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
> }
> EXPORT_SYMBOL(rfkill_switch_all);
>
> @@ -250,7 +250,7 @@ EXPORT_SYMBOL(rfkill_switch_all);
> * rfkill_epo - emergency power off all transmitters
> *
> * This kicks all rfkill devices to RFKILL_STATE_SOFT_BLOCKED, ignoring
> - * everything in its path but rfkill_mutex and rfkill->mutex.
> + * everything in its path but rfkill_global_mutex and rfkill->mutex.
> *
> * The global state before the EPO is saved and can be restored later
> * using rfkill_restore_states().
> @@ -260,7 +260,7 @@ void rfkill_epo(void)
> struct rfkill *rfkill;
> int i;
>
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
>
> rfkill_state_lock = 1;
> list_for_each_entry(rfkill, &rfkill_list, node) {
> @@ -272,7 +272,7 @@ void rfkill_epo(void)
> rfkill_default_states[i] = rfkill_states[i];
> rfkill_states[i] = RFKILL_STATE_SOFT_BLOCKED;
> }
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
> }
> EXPORT_SYMBOL_GPL(rfkill_epo);
>
> @@ -287,12 +287,12 @@ void rfkill_restore_states(void)
> {
> int i;
>
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
>
> rfkill_state_lock = 0;
> for (i = 0; i < RFKILL_TYPE_MAX; i++)
> __rfkill_switch_all(i, rfkill_default_states[i]);
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
> }
> EXPORT_SYMBOL_GPL(rfkill_restore_states);
>
> @@ -306,9 +306,9 @@ EXPORT_SYMBOL_GPL(rfkill_restore_states);
> */
> void rfkill_set_state_lock(int lock)
> {
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
> rfkill_state_lock = !!lock;
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
> }
> EXPORT_SYMBOL_GPL(rfkill_set_state_lock);
>
> @@ -454,7 +454,7 @@ static ssize_t rfkill_claim_store(struct device *dev,
> * Take the global lock to make sure the kernel is not in
> * the middle of rfkill_switch_all
> */
> - error = mutex_lock_interruptible(&rfkill_mutex);
> + error = mutex_lock_interruptible(&rfkill_global_mutex);
> if (error)
> return error;
>
> @@ -469,7 +469,7 @@ static ssize_t rfkill_claim_store(struct device *dev,
> rfkill->user_claim = claim;
> }
>
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
>
> return error ? error : count;
> }
> @@ -601,7 +601,7 @@ static int rfkill_add_switch(struct rfkill *rfkill)
> {
> int error;
>
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
>
> error = rfkill_check_duplicity(rfkill);
> if (error < 0)
> @@ -620,16 +620,16 @@ static int rfkill_add_switch(struct rfkill *rfkill)
>
> error = 0;
> unlock_out:
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
>
> return error;
> }
>
> static void rfkill_remove_switch(struct rfkill *rfkill)
> {
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
> list_del_init(&rfkill->node);
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
>
> mutex_lock(&rfkill->mutex);
> rfkill_toggle_radio(rfkill, RFKILL_STATE_SOFT_BLOCKED, 1);
> @@ -797,7 +797,7 @@ int rfkill_set_default(enum rfkill_type type, enum rfkill_state state)
> state != RFKILL_STATE_UNBLOCKED))
> return -EINVAL;
>
> - mutex_lock(&rfkill_mutex);
> + mutex_lock(&rfkill_global_mutex);
>
> if (!test_and_set_bit(type, &rfkill_states_lockdflt)) {
> rfkill_default_states[type] = state;
> @@ -805,7 +805,7 @@ int rfkill_set_default(enum rfkill_type type, enum rfkill_state state)
> } else
> error = -EPERM;
>
> - mutex_unlock(&rfkill_mutex);
> + mutex_unlock(&rfkill_global_mutex);
> return error;
> }
> EXPORT_SYMBOL_GPL(rfkill_set_default);
next prev parent reply other threads:[~2008-07-23 18:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-23 1:04 [GIT PATCH] RFC: next batch of rfkill changes Henrique de Moraes Holschuh
2008-07-23 1:04 ` [PATCH] rfkill: detect bogus double-registering Henrique de Moraes Holschuh
2008-07-23 3:41 ` Johannes Berg
2008-07-23 15:27 ` Henrique de Moraes Holschuh
2008-07-23 16:30 ` Johannes Berg
2008-07-23 17:41 ` Henrique de Moraes Holschuh
2008-07-23 18:12 ` Ivo van Doorn
2008-07-23 1:04 ` [PATCH] rfkill: add default global states Henrique de Moraes Holschuh
2008-07-23 18:28 ` Ivo van Doorn
2008-07-23 18:42 ` Henrique de Moraes Holschuh
2008-07-23 19:20 ` Ivo van Doorn
2008-07-23 1:04 ` [PATCH] rfkill: add master_switch_mode functionality Henrique de Moraes Holschuh
2008-07-23 18:39 ` Ivo van Doorn
2008-07-23 19:37 ` Henrique de Moraes Holschuh
2008-07-23 1:04 ` [PATCH] rfkill: add EPO lock to rfkill-input Henrique de Moraes Holschuh
2008-07-23 18:44 ` Ivo van Doorn
2008-07-23 19:01 ` Henrique de Moraes Holschuh
2008-07-23 19:28 ` Ivo van Doorn
2008-07-23 1:04 ` [PATCH] rfkill: rename rfkill_mutex to rfkill_global_mutex Henrique de Moraes Holschuh
2008-07-23 18:44 ` Ivo van Doorn [this message]
2008-07-23 1:04 ` [PATCH] rfkill: rate-limit rfkill-input workqueue usage Henrique de Moraes Holschuh
2008-07-23 18:46 ` Ivo van Doorn
2008-07-23 19:43 ` Dmitry Torokhov
2008-07-23 20:27 ` Henrique de Moraes Holschuh
2008-07-23 20:39 ` Dmitry Torokhov
2008-07-23 1:12 ` [GIT PATCH] RFC: next batch of rfkill changes Henrique de Moraes Holschuh
2008-07-23 18:08 ` Ivo van Doorn
2008-07-23 19:09 ` Henrique de Moraes Holschuh
2008-08-01 18:11 ` John W. Linville
2008-08-01 19:35 ` Henrique de Moraes Holschuh
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=200807232044.47129.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=linux-wireless@vger.kernel.org \
--cc=mb@bu3sch.de \
/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;
as well as URLs for NNTP newsgroup(s).