All of lore.kernel.org
 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 18:15:17 +0100	[thread overview]
Message-ID: <1290186917.23033.8.camel@maggie> (raw)
In-Reply-To: <AANLkTimFQ9UYWKtHpjXBTS0PPJcB_vPD7kawfffY_c+-@mail.gmail.com> (sfid-20101119_180023_531984_6B3BA604)

On Fri, 2010-11-19 at 17:59 +0100, G?bor Stefanik wrote: 
> > There's no difference.
> > (int)0 implicitly casts to false and anything else to true.
> 
> I know, just for the sake of coding style.

All of my code in b43 uses 0/1. That's just less characters to write
and is as readable as true/false (to me).
And most b43 G code existed before bool was added to the kernel. ;)

> Same as initializing
> pointers to NULL, not 0 (though AFAIK there are platforms where 0x0 is
> a valid memory address, so using NULL is more than just coding style).

No it is not. C handles the case for NULL not being zero and generates
correct code even if 0 is used. But Linux doesn't support those
platforms due to other reasons (memset(..., 0, ...) on struct
with pointers, for example).

-- 
Greetings Michael.

WARNING: multiple messages have this Message-ID (diff)
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: Re: [PATCH V2] b43: rfkill: use HI enabled bit for all devices
Date: Fri, 19 Nov 2010 18:15:17 +0100	[thread overview]
Message-ID: <1290186917.23033.8.camel@maggie> (raw)
In-Reply-To: <AANLkTimFQ9UYWKtHpjXBTS0PPJcB_vPD7kawfffY_c+-@mail.gmail.com> (sfid-20101119_180023_531984_6B3BA604)

On Fri, 2010-11-19 at 17:59 +0100, Gábor Stefanik wrote: 
> > There's no difference.
> > (int)0 implicitly casts to false and anything else to true.
> 
> I know, just for the sake of coding style.

All of my code in b43 uses 0/1. That's just less characters to write
and is as readable as true/false (to me).
And most b43 G code existed before bool was added to the kernel. ;)

> Same as initializing
> pointers to NULL, not 0 (though AFAIK there are platforms where 0x0 is
> a valid memory address, so using NULL is more than just coding style).

No it is not. C handles the case for NULL not being zero and generates
correct code even if 0 is used. But Linux doesn't support those
platforms due to other reasons (memset(..., 0, ...) on struct
with pointers, for example).

-- 
Greetings Michael.


  reply	other threads:[~2010-11-19 17:15 UTC|newest]

Thread overview: 10+ 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-17 21:14 ` Rafał Miłecki
2010-11-19 16:12 ` Gábor Stefanik
2010-11-19 16:12   ` Gábor Stefanik
2010-11-19 16:41   ` Michael Büsch
2010-11-19 16:41     ` Michael Büsch
2010-11-19 16:59     ` Gábor Stefanik
2010-11-19 16:59       ` Gábor Stefanik
2010-11-19 17:15       ` Michael Büsch [this message]
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=1290186917.23033.8.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.