linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "João Paulo Rechi Vita" <jprvita@gmail.com>
Cc: "Johannes Berg" <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org,
	"João Paulo Rechi Vita" <jprvita@endlessm.com>
Subject: Re: [PATCH] rfkill: Copy "all" global state to other types
Date: Mon, 24 Aug 2015 17:28:32 -0700	[thread overview]
Message-ID: <1440462512.2670.83.camel@perches.com> (raw)
In-Reply-To: <1440432084-20928-1-git-send-email-jprvita@endlessm.com>

On Mon, 2015-08-24 at 12:01 -0400, João Paulo Rechi Vita wrote:
> When switching the state of all RFKill switches of type all we need to
> replicate the RFKILL_TYPE_ALL global state to all the other types global
> state, so it is used to initialize persistent RFKill switches on
> register.
[]
> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
[]
> @@ -341,7 +341,14 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)
>  {
>  	struct rfkill *rfkill;
>  
> -	rfkill_global_states[type].cur = blocked;
> +	if (type == RFKILL_TYPE_ALL) {
> +		enum rfkill_type i;

Does it really make sense to use an enum here?

> +		for (i = 0; i < NUM_RFKILL_TYPES; i++)
> +			rfkill_global_states[i].cur = blocked;

increment it and then use it as an index?

Most every other loop use of NUM_RFKILL_TYPES is int



  reply	other threads:[~2015-08-25  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 16:01 [PATCH] rfkill: Copy "all" global state to other types João Paulo Rechi Vita
2015-08-25  0:28 ` Joe Perches [this message]
2015-08-25  0:44   ` João Paulo Rechi Vita
2015-08-25 12:56   ` João Paulo Rechi Vita
2015-08-25 16:13     ` Marcel Holtmann
2015-09-01 20:25       ` João Paulo Rechi Vita
2015-09-02 17:42         ` Marcel Holtmann
2015-09-02 18:28           ` Johannes Berg
2015-09-02 18:35             ` João Paulo Rechi Vita
2015-09-04 12:28     ` Johannes Berg

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=1440462512.2670.83.camel@perches.com \
    --to=joe@perches.com \
    --cc=johannes@sipsolutions.net \
    --cc=jprvita@endlessm.com \
    --cc=jprvita@gmail.com \
    --cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).