linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, Matthew Garrett <mjg@redhat.com>,
	Dan Williams <dcbw@redhat.com>, Thomas Renninger <trenn@suse.de>,
	Fabien Crespel <fabien@crespel.net>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH 11/13] rfkill: drop current_state from tasks in rfkill-input
Date: Mon, 23 Jun 2008 22:49:42 +0200	[thread overview]
Message-ID: <200806232249.42769.IvDoorn@gmail.com> (raw)
In-Reply-To: <1214252588-30723-12-git-send-email-hmh@hmh.eng.br>

On Monday 23 June 2008, Henrique de Moraes Holschuh wrote:
> From: Fabien Crespel <fabien@crespel.net>
> 
> The whole current_state thing seems completely useless and a source of
> problems in rfkill-input, since state comparison is already done in rfkill,
> and rfkill-input is more than likely to become out of sync with the real
> state.
> 
> Signed-off-by: Fabien Crespel <fabien@crespel.net>
> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: Ivo van Doorn <IvDoorn@gmail.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>

Acked-by: Ivo van Doorn <IvDoorn@gmail.com>

> ---
>  net/rfkill/rfkill-input.c |   15 +--------------
>  1 files changed, 1 insertions(+), 14 deletions(-)
> 
> diff --git a/net/rfkill/rfkill-input.c b/net/rfkill/rfkill-input.c
> index 29c13d3..d285f9a 100644
> --- a/net/rfkill/rfkill-input.c
> +++ b/net/rfkill/rfkill-input.c
> @@ -30,27 +30,15 @@ struct rfkill_task {
>  	spinlock_t lock; /* for accessing last and desired state */
>  	unsigned long last; /* last schedule */
>  	enum rfkill_state desired_state; /* on/off */
> -	enum rfkill_state current_state; /* on/off */
>  };
>  
>  static void rfkill_task_handler(struct work_struct *work)
>  {
>  	struct rfkill_task *task = container_of(work, struct rfkill_task, work);
> -	enum rfkill_state state;
>  
>  	mutex_lock(&task->mutex);
>  
> -	/*
> -	 * Use temp variable to fetch desired state to keep it
> -	 * consistent even if rfkill_schedule_toggle() runs in
> -	 * another thread or interrupts us.
> -	 */
> -	state = task->desired_state;
> -
> -	if (state != task->current_state) {
> -		rfkill_switch_all(task->type, state);
> -		task->current_state = state;
> -	}
> +	rfkill_switch_all(task->type, task->desired_state);
>  
>  	mutex_unlock(&task->mutex);
>  }
> @@ -94,7 +82,6 @@ static void rfkill_schedule_toggle(struct rfkill_task *task)
>  		.mutex = __MUTEX_INITIALIZER(n.mutex),	\
>  		.lock = __SPIN_LOCK_UNLOCKED(n.lock),	\
>  		.desired_state = RFKILL_STATE_ON,	\
> -		.current_state = RFKILL_STATE_ON,	\
>  	}
>  
>  static DEFINE_RFKILL_TASK(rfkill_wlan, RFKILL_TYPE_WLAN);



  reply	other threads:[~2008-06-23 20:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 20:22 [GIT PATCH] rfkill rework for 2.6.27 (v3) Henrique de Moraes Holschuh
2008-06-23 20:22 ` [PATCH 01/13] rfkill: clarify meaning of rfkill states Henrique de Moraes Holschuh
2008-06-23 20:22 ` [PATCH 02/13] rfkill: fix minor typo in kernel doc Henrique de Moraes Holschuh
2008-06-23 20:22 ` [PATCH 03/13] rfkill: handle SW_RFKILL_ALL events Henrique de Moraes Holschuh
2008-06-23 20:22 ` [PATCH 04/13] rfkill: add parameter to disable radios by default Henrique de Moraes Holschuh
2008-06-24 14:05   ` Dmitry Baryshkov
2008-06-24 17:06     ` Fabien Crespel
2008-06-24 17:56       ` Dan Williams
2008-06-24 20:29         ` Fabien Crespel
2008-06-24 21:49           ` Dan Williams
2008-06-25  7:23             ` Fabien Crespel
2008-06-24 23:17       ` Henrique de Moraes Holschuh
2008-06-25  8:11         ` Fabien Crespel
2008-06-25 14:02           ` Henrique de Moraes Holschuh
2008-06-24 17:07     ` Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 05/13] rfkill: add read-write rfkill switch support Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 06/13] rfkill: add the WWAN radio type Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 07/13] rfkill: rework suspend and resume handlers Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 08/13] rfkill: add notifier chains support Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 09/13] rfkill: add type string helper Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 10/13] rfkill: add uevent notifications Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 11/13] rfkill: drop current_state from tasks in rfkill-input Henrique de Moraes Holschuh
2008-06-23 20:49   ` Ivo van Doorn [this message]
2008-06-23 20:23 ` [PATCH 12/13] rfkill: do not allow userspace to override ALL RADIOS OFF Henrique de Moraes Holschuh
2008-06-23 20:23 ` [PATCH 13/13] rfkill: document rw rfkill switches and clarify input subsystem interactions Henrique de Moraes Holschuh
2008-06-26 13:13 ` [GIT PATCH] rfkill rework for 2.6.27 (v3) Dmitry Baryshkov

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=200806232249.42769.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=dcbw@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fabien@crespel.net \
    --cc=hmh@hmh.eng.br \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mjg@redhat.com \
    --cc=trenn@suse.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).