From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] standardising boolean variables in drivers/net (first
Date: Tue, 30 Oct 2007 14:30:13 +0000 [thread overview]
Message-ID: <47273FF5.2030501@student.ltu.se> (raw)
In-Reply-To: <af42259d0710300134h63515753i6bcdad897a6296c3@mail.gmail.com>
Robert P. J. Day wrote:
> you should include the subsystem against which this patch applies in
> the subject, as in:
>
> [PATCH] NET: standardizing ...
>
> and you should also CC that mailing list or maintainer of that
> subsystem.
>
> also, if this is to be the first of many related patches, you might
> consider doing a multi-part patch.
>
> On Tue, 30 Oct 2007, Lucas Woods wrote:
>
>
>> First patch here, be gentle, please let me know if I've made a mess of this :)
>>
>>
>> Phase 1 standardised boolean variables in drivers/net
>>
>> --
>> diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
>> index d5d092c..f67b29b 100644
>> --- a/drivers/net/ipg.h
>> +++ b/drivers/net/ipg.h
>> @@ -491,37 +491,37 @@ enum ipg_regs {
>> */
>>
>> /* Miscellaneous Constants. */
>> -#define TRUE 1
>> -#define FALSE 0
>> +#define true 1
>> +#define false 0
>>
>
> there should be no need to define the symbols "true" and "false" as
> they should be predefined for variables of type "bool".
>
>
>> @@ -7379,7 +7379,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct
>> pci_device_id *pre)
>> struct s2io_nic *sp;
>> struct net_device *dev;
>> int i, j, ret;
>> - int dma_flag = FALSE;
>> + int dma_flag = false;
>>
>
> if a variable is truly going to represent just boolean values, you
> might consider redeclaring it as "bool" instead of "int".
>
+ if you are changing the type of the variable/(return of a function),
it is a good idea to check all instances of it to secure it as a boolean
and not a multi-state variable. Also it gives you the opportunity to see
if it still is needed (or only assigned values and never used).
thanks
Richard Knutsson
next prev parent reply other threads:[~2007-10-30 14:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 8:34 [patch] standardising boolean variables in drivers/net (first phase) Lucas Woods
2007-10-30 8:40 ` [patch] standardising boolean variables in drivers/net (first Robert P. J. Day
2007-10-30 12:17 ` Arnaldo Carvalho de Melo
2007-10-30 14:30 ` Richard Knutsson [this message]
2007-10-30 14:52 ` Richard Knutsson
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=47273FF5.2030501@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--cc=kernel-janitors@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 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.