From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Knutsson Date: Tue, 30 Oct 2007 14:30:13 +0000 Subject: Re: [patch] standardising boolean variables in drivers/net (first Message-Id: <47273FF5.2030501@student.ltu.se> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org 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