b43-dev.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Büsch" <mb@bu3sch.de>
To: "Gábor Stefanik" <netrolller.3d@gmail.com>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
	linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
Subject: [PATCH V2] b43: rfkill: use HI enabled bit for all devices
Date: Fri, 19 Nov 2010 17:41:13 +0100	[thread overview]
Message-ID: <1290184873.23033.3.camel@maggie> (raw)
In-Reply-To: <AANLkTikXqg9boY1H_OPAvs7WPd6SXUt8DpykRHuRxB6E@mail.gmail.com> (sfid-20101119_111452_623076_AFFB9E4D)

On Fri, 2010-11-19 at 17:12 +0100, G?bor Stefanik wrote: 
> 2010/11/17 Rafa? Mi?ecki <zajec5@gmail.com>:
> > Devices which use LO enabled bit are covered by b43legacy
> >
> > Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> > ---
> > V2: Dropped some not needed stuff as pointed by Michael, thanks!
> >
> > John: it's .38 ofc.
> > ---
> >  drivers/net/wireless/b43/rfkill.c |   19 ++-----------------
> >  1 files changed, 2 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
> > index 78016ae..86bc0a0 100644
> > --- a/drivers/net/wireless/b43/rfkill.c
> > +++ b/drivers/net/wireless/b43/rfkill.c
> > @@ -28,23 +28,8 @@
> >  /* Returns TRUE, if the radio is enabled in hardware. */
> >  bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
> >  {
> > -       if (dev->phy.rev >= 3 || dev->phy.type == B43_PHYTYPE_LP) {
> > -               if (!(b43_read32(dev, B43_MMIO_RADIO_HWENABLED_HI)
> > -                     & B43_MMIO_RADIO_HWENABLED_HI_MASK))
> > -                       return 1;
> > -       } else {
> > -               /* To prevent CPU fault on PPC, do not read a register
> > -                * unless the interface is started; however, on resume
> > -                * for hibernation, this routine is entered early. When
> > -                * that happens, unconditionally return TRUE.
> > -                */
> > -               if (b43_status(dev) < B43_STAT_STARTED)
> > -                       return 1;
> > -               if (b43_read16(dev, B43_MMIO_RADIO_HWENABLED_LO)
> > -                   & B43_MMIO_RADIO_HWENABLED_LO_MASK)
> > -                       return 1;
> > -       }
> > -       return 0;
> 
> Is there any reason why this bool originally returned 1 or 0 instead
> of true or false?

There's no difference.
(int)0 implicitly casts to false and anything else to true.

-- 
Greetings Michael.

  reply	other threads:[~2010-11-19 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 21:14 [PATCH V2] b43: rfkill: use HI enabled bit for all devices Rafał Miłecki
2010-11-19 16:12 ` Gábor Stefanik
2010-11-19 16:41   ` Michael Büsch [this message]
2010-11-19 16:59     ` Gábor Stefanik
2010-11-19 17:15       ` Michael Büsch

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=1290184873.23033.3.camel@maggie \
    --to=mb@bu3sch.de \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netrolller.3d@gmail.com \
    --cc=zajec5@gmail.com \
    /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).