Re: kernel guide to space (updated)

2005-07-31 Thread Miles Bader
Jan Engelhardt <[EMAIL PROTECTED]> writes: >>3i. if/else/do/while/for/switch >> space between if/else/do/while and following/preceeding >> statements/expressions, if any > > Why this? if(a) {} is not any worse than if (a). Well it's harder to read (because it makes control constructs

Re: kernel guide to space (updated)

2005-07-31 Thread Miles Bader
Jan Engelhardt [EMAIL PROTECTED] writes: 3i. if/else/do/while/for/switch space between if/else/do/while and following/preceeding statements/expressions, if any Why this? if(a) {} is not any worse than if (a). Well it's harder to read (because it makes control constructs look more

Re: kernel guide to space (updated)

2005-07-30 Thread Jan Engelhardt
>> >Ehrm, yes, I'm perfectly aware of that. Note the "for consistency" in >> >that sentence. If we add an extra space in front of the labels that >> >have an indentation level of 0, we'd better do it with the labels that >> >have an indentation level > 0 too. >> >> Labels at level > 0??? > >A

Re: kernel guide to space (updated)

2005-07-30 Thread David Weinehall
On Sat, Jul 30, 2005 at 01:41:55PM +0200, Jan Engelhardt wrote: > > >Ehrm, yes, I'm perfectly aware of that. Note the "for consistency" in > >that sentence. If we add an extra space in front of the labels that > >have an indentation level of 0, we'd better do it with the labels that > >have an

Re: kernel guide to space (updated)

2005-07-30 Thread Jan Engelhardt
>Ehrm, yes, I'm perfectly aware of that. Note the "for consistency" in >that sentence. If we add an extra space in front of the labels that >have an indentation level of 0, we'd better do it with the labels that >have an indentation level > 0 too. Labels at level > 0??? - To unsubscribe from

Re: kernel guide to space (updated)

2005-07-30 Thread Vincent Hanquez
On Fri, Jul 29, 2005 at 09:40:14AM +0200, Jan Engelhardt wrote: > >3i. if/else/do/while/for/switch > > space between if/else/do/while and following/preceeding > > statements/expressions, if any > > Why this? if(a) {} is not any worse than if (a). I would make this an option. please no,

Re: kernel guide to space (updated)

2005-07-30 Thread David Weinehall
On Sat, Jul 30, 2005 at 01:41:55PM +0200, Jan Engelhardt wrote: Ehrm, yes, I'm perfectly aware of that. Note the for consistency in that sentence. If we add an extra space in front of the labels that have an indentation level of 0, we'd better do it with the labels that have an indentation

Re: kernel guide to space (updated)

2005-07-30 Thread Jan Engelhardt
Ehrm, yes, I'm perfectly aware of that. Note the for consistency in that sentence. If we add an extra space in front of the labels that have an indentation level of 0, we'd better do it with the labels that have an indentation level 0 too. Labels at level 0??? A case in a switch

Re: kernel guide to space (updated)

2005-07-29 Thread David Weinehall
On Fri, Jul 29, 2005 at 09:52:01PM +0200, Jan Engelhardt wrote: > > >I'd definitely call that a joe-bug. Adding extra space for no good > >reason is just silly; for consistency we'd have to add a space for the > >case : labels also... > > No, the word "case" never starts at column 1 (counting

Re: kernel guide to space (updated)

2005-07-29 Thread Jan Engelhardt
>I'd definitely call that a joe-bug. Adding extra space for no good >reason is just silly; for consistency we'd have to add a space for the >case : labels also... No, the word "case" never starts at column 1 (counting from 1), but at least in column , where minimalIndent is the default indent

Re: kernel guide to space (updated)

2005-07-29 Thread David Weinehall
On Fri, Jul 29, 2005 at 09:40:14AM +0200, Jan Engelhardt wrote: [snip] > Would it be reasonable to say that the first column can be a space? > Some editors (e.g. joe) list the function in some status bar and do > that based on the fact that all C code in a function is indented, and > only the

Re: kernel guide to space (updated)

2005-07-29 Thread Joost Remijn
Jan Engelhardt wrote: >>3e. sizeof >> space after the operator >> no space if the operand is in barces >> >> > >braces > > > >>3f. Braces etc >> () [] -> . >> >> > >() parentheses (short form: parens) >[] square brackets >{} braces ><> dunno their name :p > angle

Re: kernel guide to space (updated)

2005-07-29 Thread Jan Engelhardt
>3e. sizeof > space after the operator > no space if the operand is in barces braces >3f. Braces etc > () [] -> . () parentheses (short form: parens) [] square brackets {} braces <> dunno their name :p >3i. if/else/do/while/for/switch > space between if/else/do/while

Re: kernel guide to space (updated)

2005-07-29 Thread Jan Engelhardt
>> 9. The following is helpful with VIM >>set cinoptions=(0:0 >> > >And this will highlight whitespace damage: > >highlight RedundantSpaces ctermbg=red guibg=red >match RedundantSpaces /\s\+$\| \+\ze\t/ find linux -type f -print0 | xargs -0 egrep '[[:space:]]+$' With `wc -l`, returns

Re: kernel guide to space (updated)

2005-07-29 Thread Jan Engelhardt
9. The following is helpful with VIM set cinoptions=(0:0 And this will highlight whitespace damage: highlight RedundantSpaces ctermbg=red guibg=red match RedundantSpaces /\s\+$\| \+\ze\t/ find linux -type f -print0 | xargs -0 egrep '[[:space:]]+$' With `wc -l`, returns 132409*

Re: kernel guide to space (updated)

2005-07-29 Thread Jan Engelhardt
3e. sizeof space after the operator no space if the operand is in barces braces 3f. Braces etc () [] - . () parentheses (short form: parens) [] square brackets {} braces dunno their name :p 3i. if/else/do/while/for/switch space between if/else/do/while and

Re: kernel guide to space (updated)

2005-07-29 Thread Joost Remijn
Jan Engelhardt wrote: 3e. sizeof space after the operator no space if the operand is in barces braces 3f. Braces etc () [] - . () parentheses (short form: parens) [] square brackets {} braces dunno their name :p angle brackets, it's all nicely explained at

Re: kernel guide to space (updated)

2005-07-29 Thread David Weinehall
On Fri, Jul 29, 2005 at 09:40:14AM +0200, Jan Engelhardt wrote: [snip] Would it be reasonable to say that the first column can be a space? Some editors (e.g. joe) list the function in some status bar and do that based on the fact that all C code in a function is indented, and only the function

Re: kernel guide to space (updated)

2005-07-29 Thread Jan Engelhardt
I'd definitely call that a joe-bug. Adding extra space for no good reason is just silly; for consistency we'd have to add a space for the case foo: labels also... No, the word case never starts at column 1 (counting from 1), but at least in column minimalIndent, where minimalIndent is the

Re: kernel guide to space (updated)

2005-07-29 Thread David Weinehall
On Fri, Jul 29, 2005 at 09:52:01PM +0200, Jan Engelhardt wrote: I'd definitely call that a joe-bug. Adding extra space for no good reason is just silly; for consistency we'd have to add a space for the case foo: labels also... No, the word case never starts at column 1 (counting from 1),

Re: kernel guide to space (updated)

2005-07-28 Thread John W. Linville
On Thu, Jul 28, 2005 at 11:52:25AM -0400, linux-os (Dick Johnson) wrote: > > On Thu, 28 Jul 2005, Michael S. Tsirkin wrote: > > > > > 7. Comments > > Don't use C99 // comments. > > I don't think this is correct. In fact, I remember a discussion > where // was preferred for new code.

Re: kernel guide to space (updated)

2005-07-28 Thread Dmitry Torokhov
On 7/28/05, Michael S. Tsirkin <[EMAIL PROTECTED]> wrote: > > 9. The following is helpful with VIM >set cinoptions=(0:0 > And this will highlight whitespace damage: highlight RedundantSpaces ctermbg=red guibg=red match RedundantSpaces /\s\+$\| \+\ze\t/ -- Dmitry - To unsubscribe

Re: kernel guide to space (updated)

2005-07-28 Thread linux-os \(Dick Johnson\)
On Thu, 28 Jul 2005, Michael S. Tsirkin wrote: > > 7. Comments > Don't use C99 // comments. I don't think this is correct. In fact, I remember a discussion where // was preferred for new code. Cheers, Dick Johnson Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).

kernel guide to space (updated)

2005-07-28 Thread Michael S. Tsirkin
ether a short list of rules complementing > Documentation/CodingStyle. This list is attached, below. Here's an updated version of the boring list. My thanks to everyone who commented on the first draft. --- kernel guide to space AKA a boring list of rules http://www.mellanox.com/mst/boring.txt T

kernel guide to space (updated)

2005-07-28 Thread Michael S. Tsirkin
complementing Documentation/CodingStyle. This list is attached, below. Here's an updated version of the boring list. My thanks to everyone who commented on the first draft. --- kernel guide to space AKA a boring list of rules http://www.mellanox.com/mst/boring.txt This text deals mostly

Re: kernel guide to space (updated)

2005-07-28 Thread linux-os \(Dick Johnson\)
On Thu, 28 Jul 2005, Michael S. Tsirkin wrote: 7. Comments Don't use C99 // comments. I don't think this is correct. In fact, I remember a discussion where // was preferred for new code. Cheers, Dick Johnson Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).

Re: kernel guide to space (updated)

2005-07-28 Thread Dmitry Torokhov
On 7/28/05, Michael S. Tsirkin [EMAIL PROTECTED] wrote: 9. The following is helpful with VIM set cinoptions=(0:0 And this will highlight whitespace damage: highlight RedundantSpaces ctermbg=red guibg=red match RedundantSpaces /\s\+$\| \+\ze\t/ -- Dmitry - To unsubscribe from this

Re: kernel guide to space (updated)

2005-07-28 Thread John W. Linville
On Thu, Jul 28, 2005 at 11:52:25AM -0400, linux-os (Dick Johnson) wrote: On Thu, 28 Jul 2005, Michael S. Tsirkin wrote: 7. Comments Don't use C99 // comments. I don't think this is correct. In fact, I remember a discussion where // was preferred for new code. Ick...I hope

Re: kernel guide to space

2005-07-22 Thread Jesper Juhl
On 7/22/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > On 7/21/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > > On 7/21/05, linux-os (Dick Johnson) <[EMAIL PROTECTED]> wrote: > > > > > > On Thu, 21 Jul 2005, Jesper Juhl wrote: > > > > > > > On 7/21/05, Kyle Moffett <[EMAIL PROTECTED]> wrote: > > > >>

Re: kernel guide to space

2005-07-22 Thread Jesper Juhl
On 7/22/05, Sam Ravnborg <[EMAIL PROTECTED]> wrote: > On Fri, Jul 22, 2005 at 12:12:12PM -0500, Patrick Draper wrote: > > Why isn't a code formatting program used? People could write the code > > as they like to write it, then format it automatically in a standard > > way before it gets put into

Re: kernel guide to space

2005-07-22 Thread Jesper Juhl
On 7/22/05, Patrick Draper <[EMAIL PROTECTED]> wrote: > Why isn't a code formatting program used? There's scripts/Lindent (which is just a wrapper around indent with appropriate options. >People could write the code > as they like to write it, then format it automatically in a standard > way

Re: kernel guide to space

2005-07-22 Thread Sam Ravnborg
On Fri, Jul 22, 2005 at 12:12:12PM -0500, Patrick Draper wrote: > Why isn't a code formatting program used? People could write the code > as they like to write it, then format it automatically in a standard > way before it gets put into the kernel. There is. scripts/Lindent But sometimes it fails

Re: kernel guide to space

2005-07-22 Thread Patrick Draper
Why isn't a code formatting program used? People could write the code as they like to write it, then format it automatically in a standard way before it gets put into the kernel. Patrick - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL

Re: kernel guide to space

2005-07-22 Thread Patrick Draper
Why isn't a code formatting program used? People could write the code as they like to write it, then format it automatically in a standard way before it gets put into the kernel. Patrick - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL

Re: kernel guide to space

2005-07-22 Thread Sam Ravnborg
On Fri, Jul 22, 2005 at 12:12:12PM -0500, Patrick Draper wrote: Why isn't a code formatting program used? People could write the code as they like to write it, then format it automatically in a standard way before it gets put into the kernel. There is. scripts/Lindent But sometimes it fails to

Re: kernel guide to space

2005-07-22 Thread Jesper Juhl
On 7/22/05, Patrick Draper [EMAIL PROTECTED] wrote: Why isn't a code formatting program used? There's scripts/Lindent (which is just a wrapper around indent with appropriate options. People could write the code as they like to write it, then format it automatically in a standard way before

Re: kernel guide to space

2005-07-22 Thread Jesper Juhl
On 7/22/05, Sam Ravnborg [EMAIL PROTECTED] wrote: On Fri, Jul 22, 2005 at 12:12:12PM -0500, Patrick Draper wrote: Why isn't a code formatting program used? People could write the code as they like to write it, then format it automatically in a standard way before it gets put into the

Re: kernel guide to space

2005-07-22 Thread Jesper Juhl
On 7/22/05, Jesper Juhl [EMAIL PROTECTED] wrote: On 7/21/05, Jesper Juhl [EMAIL PROTECTED] wrote: On 7/21/05, linux-os (Dick Johnson) [EMAIL PROTECTED] wrote: On Thu, 21 Jul 2005, Jesper Juhl wrote: On 7/21/05, Kyle Moffett [EMAIL PROTECTED] wrote: On Jul 20, 2005, at 20:45:21,

Re: kernel guide to space

2005-07-21 Thread Paul Jackson
Miles wrote: > CodingStyle is vague on the issue, though ... Perhaps we should call it "coding_style" . -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <[EMAIL PROTECTED]> 1.925.600.0401 - To unsubscribe

Re: kernel guide to space

2005-07-21 Thread Miles Bader
"linux-os \(Dick Johnson\)" <[EMAIL PROTECTED]> writes: > It will take probably an hour to parse: > struct BusLogic_FetchHostAdapterLocalRAMReguest > FetchHostAdapterLocalRAMRequest > ^!) Agh! My eyes! The above names are way overdone by any measure, but is there any consensus

Re: kernel guide to space

2005-07-21 Thread Jesper Juhl
On 7/21/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > On 7/21/05, linux-os (Dick Johnson) <[EMAIL PROTECTED]> wrote: > > > > On Thu, 21 Jul 2005, Jesper Juhl wrote: > > > > > On 7/21/05, Kyle Moffett <[EMAIL PROTECTED]> wrote: > > >> On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: > > >

Re: kernel guide to space

2005-07-21 Thread Jesper Juhl
On 7/21/05, linux-os (Dick Johnson) <[EMAIL PROTECTED]> wrote: > > On Thu, 21 Jul 2005, Jesper Juhl wrote: > > > On 7/21/05, Kyle Moffett <[EMAIL PROTECTED]> wrote: > >> On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: > > [...snip...] > >> *cough*

Re: kernel guide to space

2005-07-21 Thread linux-os \(Dick Johnson\)
On Thu, 21 Jul 2005, Jesper Juhl wrote: > On 7/21/05, Kyle Moffett <[EMAIL PROTECTED]> wrote: >> On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: > [...snip...] >> *cough* TargetStatistics[TargetID].HostAdapterResetsCompleted *cough* >> >> I suspect linus would be willing to accept a few

Re: kernel guide to space

2005-07-21 Thread Jesper Juhl
On 7/21/05, Kyle Moffett <[EMAIL PROTECTED]> wrote: > On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: [...snip...] > *cough* TargetStatistics[TargetID].HostAdapterResetsCompleted *cough* > > I suspect linus would be willing to accept a few cleanup patches for the > BusLogic.c file. Perhaps

Re: kernel guide to space

2005-07-21 Thread Kyle Moffett
On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: drivers/scsi/BusLogic.c: %2d %5d %5d %5d%5d %5d %5d %5d %5d %5d\n", TargetID, TargetStatistics[TargetID].CommandAbortsRequested, TargetStatistics[TargetID].CommandAbortsAttempted, TargetStatistics

Re: kernel guide to space

2005-07-21 Thread Jan Engelhardt
>> (Find source files, expand tab chars to their on-screen length, print if >> >= 80, count lines) > >The bulk of the longest lines are in the sound and drivers subtrees. >One example on the "high end", with 546 chars in one line: > >== >drivers/scsi/BusLogic.c: > %2d %5d %5d %5d%5d %5d

Re: kernel guide to space

2005-07-21 Thread Jan Engelhardt
(Find source files, expand tab chars to their on-screen length, print if = 80, count lines) The bulk of the longest lines are in the sound and drivers subtrees. One example on the high end, with 546 chars in one line: == drivers/scsi/BusLogic.c: %2d %5d %5d %5d%5d %5d %5d%5d

Re: kernel guide to space

2005-07-21 Thread Kyle Moffett
On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: drivers/scsi/BusLogic.c: %2d %5d %5d %5d%5d %5d %5d %5d %5d %5d\n, TargetID, TargetStatistics[TargetID].CommandAbortsRequested, TargetStatistics[TargetID].CommandAbortsAttempted, TargetStatistics

Re: kernel guide to space

2005-07-21 Thread Jesper Juhl
On 7/21/05, Kyle Moffett [EMAIL PROTECTED] wrote: On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: [...snip...] *cough* TargetStatistics[TargetID].HostAdapterResetsCompleted *cough* I suspect linus would be willing to accept a few cleanup patches for the BusLogic.c file. Perhaps even one

Re: kernel guide to space

2005-07-21 Thread linux-os \(Dick Johnson\)
On Thu, 21 Jul 2005, Jesper Juhl wrote: On 7/21/05, Kyle Moffett [EMAIL PROTECTED] wrote: On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: [...snip...] *cough* TargetStatistics[TargetID].HostAdapterResetsCompleted *cough* I suspect linus would be willing to accept a few cleanup patches

Re: kernel guide to space

2005-07-21 Thread Jesper Juhl
On 7/21/05, linux-os (Dick Johnson) [EMAIL PROTECTED] wrote: On Thu, 21 Jul 2005, Jesper Juhl wrote: On 7/21/05, Kyle Moffett [EMAIL PROTECTED] wrote: On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: [...snip...] *cough* TargetStatistics[TargetID].HostAdapterResetsCompleted *cough*

Re: kernel guide to space

2005-07-21 Thread Jesper Juhl
On 7/21/05, Jesper Juhl [EMAIL PROTECTED] wrote: On 7/21/05, linux-os (Dick Johnson) [EMAIL PROTECTED] wrote: On Thu, 21 Jul 2005, Jesper Juhl wrote: On 7/21/05, Kyle Moffett [EMAIL PROTECTED] wrote: On Jul 20, 2005, at 20:45:21, Paul Jackson wrote: [...snip...] *cough*

Re: kernel guide to space

2005-07-21 Thread Miles Bader
linux-os \(Dick Johnson\) [EMAIL PROTECTED] writes: It will take probably an hour to parse: struct BusLogic_FetchHostAdapterLocalRAMReguest FetchHostAdapterLocalRAMRequest ^!) Agh! My eyes! The above names are way overdone by any measure, but is there any consensus whether

Re: kernel guide to space

2005-07-21 Thread Paul Jackson
Miles wrote: CodingStyle is vague on the issue, though ... Perhaps we should call it coding_style grin. -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson [EMAIL PROTECTED] 1.925.600.0401 - To unsubscribe from

Re: kernel guide to space

2005-07-20 Thread Horst von Brand
Jesper Juhl <[EMAIL PROTECTED]> wrote: > On 7/11/05, Michael S. Tsirkin <[EMAIL PROTECTED]> wrote: > [snip] > > 3e. sizeof > > space after the operator > > sizeof a > I don't think that's a hard rule, there's plenty of code that does > "sizeof(type)" and not "sizeof (type)",

Re: kernel guide to space

2005-07-20 Thread Paul Jackson
Jan wrote: > (Find source files, expand tab chars to their on-screen length, print if > >= 80, count lines) The bulk of the longest lines are in the sound and drivers subtrees. One example on the "high end", with 546 chars in one line: == drivers/scsi/BusLogic.c: %2d%5d %5d %5d%5d

Re: kernel guide to space

2005-07-20 Thread Krzysztof Halasa
Jesper Juhl <[EMAIL PROTECTED]> writes: > I don't think that's a hard rule, there's plenty of code that does > "sizeof(type)" and not "sizeof (type)", and whitespace cleanup > patches I've done that change "sizeof (type)" into "sizeof(type)" have > generally been accepted. Sure, the common

Re: kernel guide to space

2005-07-20 Thread Paul Jackson
> > 3c. * in types > > Leave space between name and * in types. > > Multiple * dont need additional space between them. > > > > struct foo **bar; > > > Don't put spaces between `*' and the name when declaring variables, > even if it's not a double pointer. int * foo;

Re: kernel guide to space

2005-07-20 Thread Bodo Eggert
Jan Engelhardt <[EMAIL PROTECTED]> wrote: >> 3) If a normal line of code is more than 80 characters, one of the >> following is probably true: you need to break the line up and use temps >> for clarity, or your function is so big that you're tabbing over too >> far. > > (Find source files,

Re: kernel guide to space

2005-07-20 Thread Michael S. Tsirkin
Quoting r. Jesper Juhl <[EMAIL PROTECTED]>: > > static struct foo *foo_bar(struct foo *first, struct bar *second, > >struct foobar* thirsd); > > > In this example you are not consistently placing your *'s, "struct foo > *first" vs "struct foobar* thirsd". Common

Re: kernel guide to space

2005-07-20 Thread Jesper Juhl
On 7/11/05, Michael S. Tsirkin <[EMAIL PROTECTED]> wrote: > [snip] > kernel guide to space AKA a boring list of rules > http://www.mellanox.com/mst/boring.txt > [snip] > > 3c. * in types > Leave space between name and * in types. > Multiple * dont

Re: kernel guide to space

2005-07-20 Thread Jan Engelhardt
> 3) If a normal line of code is more than 80 characters, one of the > following is probably true: you need to break the line up and use temps > for clarity, or your function is so big that you're tabbing over too > far. (Find source files, expand tab chars to their on-screen length, print if

Re: kernel guide to space

2005-07-20 Thread Jan Engelhardt
3) If a normal line of code is more than 80 characters, one of the following is probably true: you need to break the line up and use temps for clarity, or your function is so big that you're tabbing over too far. (Find source files, expand tab chars to their on-screen length, print if =

Re: kernel guide to space

2005-07-20 Thread Jesper Juhl
On 7/11/05, Michael S. Tsirkin [EMAIL PROTECTED] wrote: [snip] kernel guide to space AKA a boring list of rules http://www.mellanox.com/mst/boring.txt [snip] 3c. * in types Leave space between name and * in types. Multiple * dont need additional space between them

Re: kernel guide to space

2005-07-20 Thread Michael S. Tsirkin
Quoting r. Jesper Juhl [EMAIL PROTECTED]: static struct foo *foo_bar(struct foo *first, struct bar *second, struct foobar* thirsd); In this example you are not consistently placing your *'s, struct foo *first vs struct foobar* thirsd. Common practice is struct

Re: kernel guide to space

2005-07-20 Thread Bodo Eggert
Jan Engelhardt [EMAIL PROTECTED] wrote: 3) If a normal line of code is more than 80 characters, one of the following is probably true: you need to break the line up and use temps for clarity, or your function is so big that you're tabbing over too far. (Find source files, expand tab chars

Re: kernel guide to space

2005-07-20 Thread Paul Jackson
3c. * in types Leave space between name and * in types. Multiple * dont need additional space between them. struct foo **bar; Don't put spaces between `*' and the name when declaring variables, even if it's not a double pointer. int * foo; is ugly. Common

Re: kernel guide to space

2005-07-20 Thread Krzysztof Halasa
Jesper Juhl [EMAIL PROTECTED] writes: I don't think that's a hard rule, there's plenty of code that does sizeof(type) and not sizeof (type), and whitespace cleanup patches I've done that change sizeof (type) into sizeof(type) have generally been accepted. Sure, the common rule is that

Re: kernel guide to space

2005-07-20 Thread Paul Jackson
Jan wrote: (Find source files, expand tab chars to their on-screen length, print if = 80, count lines) The bulk of the longest lines are in the sound and drivers subtrees. One example on the high end, with 546 chars in one line: == drivers/scsi/BusLogic.c: %2d%5d %5d %5d%5d %5d

Re: kernel guide to space

2005-07-20 Thread Horst von Brand
Jesper Juhl [EMAIL PROTECTED] wrote: On 7/11/05, Michael S. Tsirkin [EMAIL PROTECTED] wrote: [snip] 3e. sizeof space after the operator sizeof a I don't think that's a hard rule, there's plenty of code that does sizeof(type) and not sizeof (type), and whitespace

Re: kernel guide to space

2005-07-19 Thread Kyle Moffett
On Jul 13, 2005, at 21:12:08, [EMAIL PROTECTED] wrote: I don't think there's a strict 80 column rule anymore. It's 2005... Think again. There are a lot of people who use 80 column windows so that we can see two code windows side-by-side. Agreed. If you're having trouble with width, it's

Re: kernel guide to space

2005-07-19 Thread Kyle Moffett
On Jul 13, 2005, at 21:12:08, [EMAIL PROTECTED] wrote: I don't think there's a strict 80 column rule anymore. It's 2005... Think again. There are a lot of people who use 80 column windows so that we can see two code windows side-by-side. Agreed. If you're having trouble with width, it's

Re: kernel guide to space

2005-07-13 Thread linux
>> I don't think there's a strict 80 column rule anymore. It's 2005... > Think again. There are a lot of people who use 80 column windows so > that we can see two code windows side-by-side. Agreed. If you're having trouble with width, it's a sign that the code needs to be refactored. Also,

Re: kernel guide to space

2005-07-13 Thread Marc Singer
On Wed, Jul 13, 2005 at 01:22:04PM -0400, Lee Revell wrote: > On Tue, 2005-07-12 at 23:58 -0700, Paul Jackson wrote: > > Dick Johnson wrote: > > > Or just disallow tabs altogether. At Analogic we ... > > > > This is the Linux kernel, not Analogic. > > > > We use tabs for indentation. You can

Re: kernel guide to space

2005-07-13 Thread Lee Revell
On Tue, 2005-07-12 at 23:58 -0700, Paul Jackson wrote: > Dick Johnson wrote: > > Or just disallow tabs altogether. At Analogic we ... > > This is the Linux kernel, not Analogic. > > We use tabs for indentation. You can set the number > of physical spaces per tab however you want in your >

Re: kernel guide to space

2005-07-13 Thread Paul Jackson
Lee wrote: > I don't think there's a strict 80 column rule anymore. It's 2005... Look back through the lkml archives. One will find repeated requests to keep code within 80 columns. It maybe 2005, but this is the kernel. -- I won't rest till it's the best ...

Re: kernel guide to space

2005-07-13 Thread Paul Jackson
Nice work - thanks. A couple of possible additions: * Keep lines within 80 columns. * Be consistent in use of tabs versus spaces. If the rest of a file is indented using tabs, then any change you make should be indented the same way, not with spaces. It is easy to unknowingly

Re: kernel guide to space

2005-07-13 Thread Paul Jackson
Dick Johnson wrote: > Or just disallow tabs altogether. At Analogic we ... This is the Linux kernel, not Analogic. We use tabs for indentation. You can set the number of physical spaces per tab however you want in your editor, but it had better look good (and stay within 80 columns) when the

Re: kernel guide to space

2005-07-13 Thread Paul Jackson
Dick Johnson wrote: Or just disallow tabs altogether. At Analogic we ... This is the Linux kernel, not Analogic. We use tabs for indentation. You can set the number of physical spaces per tab however you want in your editor, but it had better look good (and stay within 80 columns) when the

Re: kernel guide to space

2005-07-13 Thread Paul Jackson
Nice work - thanks. A couple of possible additions: * Keep lines within 80 columns. * Be consistent in use of tabs versus spaces. If the rest of a file is indented using tabs, then any change you make should be indented the same way, not with spaces. It is easy to unknowingly

Re: kernel guide to space

2005-07-13 Thread Paul Jackson
Lee wrote: I don't think there's a strict 80 column rule anymore. It's 2005... Look back through the lkml archives. One will find repeated requests to keep code within 80 columns. It maybe 2005, but this is the kernel. -- I won't rest till it's the best ...

Re: kernel guide to space

2005-07-13 Thread Lee Revell
On Tue, 2005-07-12 at 23:58 -0700, Paul Jackson wrote: Dick Johnson wrote: Or just disallow tabs altogether. At Analogic we ... This is the Linux kernel, not Analogic. We use tabs for indentation. You can set the number of physical spaces per tab however you want in your editor, but it

Re: kernel guide to space

2005-07-13 Thread Marc Singer
On Wed, Jul 13, 2005 at 01:22:04PM -0400, Lee Revell wrote: On Tue, 2005-07-12 at 23:58 -0700, Paul Jackson wrote: Dick Johnson wrote: Or just disallow tabs altogether. At Analogic we ... This is the Linux kernel, not Analogic. We use tabs for indentation. You can set the number

Re: kernel guide to space

2005-07-13 Thread linux
I don't think there's a strict 80 column rule anymore. It's 2005... Think again. There are a lot of people who use 80 column windows so that we can see two code windows side-by-side. Agreed. If you're having trouble with width, it's a sign that the code needs to be refactored. Also, my

Re: kernel guide to space

2005-07-12 Thread Denis Vlasenko
On Tuesday 12 July 2005 22:36, Bodo Eggert wrote: > Denis Vlasenko <[EMAIL PROTECTED]> wrote: > > > text with 8-char tabs: > > > > struct s { > > int n; /* comment */ > > unsigned int u; /* comment */ > > }; > > > > Same text viewed with tabs set to 4-char width: > > >

Re: kernel guide to space

2005-07-12 Thread Bodo Eggert
Denis Vlasenko <[EMAIL PROTECTED]> wrote: > text with 8-char tabs: > > struct s { > int n; /* comment */ > unsigned int u; /* comment */ > }; > > Same text viewed with tabs set to 4-char width: > > struct s { > int n; /* comment */ > unsigned int u; /*

Re: kernel guide to space

2005-07-12 Thread Richard B. Johnson
On Tue, 12 Jul 2005, Patrick McHardy wrote: Denis Vlasenko wrote: text with 8-char tabs: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Same text viewed with tabs set to 4-char width: struct s { int n; /* comment */ unsigned int u; /*

Re: kernel guide to space

2005-07-12 Thread Patrick McHardy
Denis Vlasenko wrote: text with 8-char tabs: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Same text viewed with tabs set to 4-char width: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Comments are not aligned

Re: kernel guide to space

2005-07-12 Thread Domen Puncer
On 12/07/05 10:12 +0300, Denis Vlasenko wrote: > > 3c. * in types > > Leave space between name and * in types. > > Multiple * dont need additional space between them. > > > > struct foo **bar; > > unless you declare a fuction: > > int* > function_style_for_easy_grep(...) > { >

Re: kernel guide to space

2005-07-12 Thread Denis Vlasenko
> 3c. * in types > Leave space between name and * in types. > Multiple * dont need additional space between them. > > struct foo **bar; unless you declare a fuction: int* function_style_for_easy_grep(...) { ... } I like this style because I can grep for

Re: kernel guide to space

2005-07-12 Thread Denis Vlasenko
On Monday 11 July 2005 18:34, Sander wrote: > Michael S. Tsirkin wrote (ao): > > Use tabs, not spaces, for indentation. Tabs should be 8 > > characters wide. > > A tab is a tab. The editor/viewer can be configured to show 2, 3, 4, 8, > any amount of characters, right? text with 8-char

Re: kernel guide to space

2005-07-12 Thread Denis Vlasenko
On Tuesday 12 July 2005 22:36, Bodo Eggert wrote: Denis Vlasenko [EMAIL PROTECTED] wrote: text with 8-char tabs: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Same text viewed with tabs set to 4-char width: struct s { int

Re: kernel guide to space

2005-07-12 Thread Denis Vlasenko
On Monday 11 July 2005 18:34, Sander wrote: Michael S. Tsirkin wrote (ao): Use tabs, not spaces, for indentation. Tabs should be 8 characters wide. A tab is a tab. The editor/viewer can be configured to show 2, 3, 4, 8, any amount of characters, right? text with 8-char tabs:

Re: kernel guide to space

2005-07-12 Thread Denis Vlasenko
3c. * in types Leave space between name and * in types. Multiple * dont need additional space between them. struct foo **bar; unless you declare a fuction: int* function_style_for_easy_grep(...) { ... } I like this style because I can grep for

Re: kernel guide to space

2005-07-12 Thread Domen Puncer
On 12/07/05 10:12 +0300, Denis Vlasenko wrote: 3c. * in types Leave space between name and * in types. Multiple * dont need additional space between them. struct foo **bar; unless you declare a fuction: int* function_style_for_easy_grep(...) { ... } I like

Re: kernel guide to space

2005-07-12 Thread Patrick McHardy
Denis Vlasenko wrote: text with 8-char tabs: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Same text viewed with tabs set to 4-char width: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Comments are not aligned

Re: kernel guide to space

2005-07-12 Thread Richard B. Johnson
On Tue, 12 Jul 2005, Patrick McHardy wrote: Denis Vlasenko wrote: text with 8-char tabs: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Same text viewed with tabs set to 4-char width: struct s { int n; /* comment */ unsigned int u; /*

Re: kernel guide to space

2005-07-12 Thread Bodo Eggert
Denis Vlasenko [EMAIL PROTECTED] wrote: text with 8-char tabs: struct s { int n; /* comment */ unsigned int u; /* comment */ }; Same text viewed with tabs set to 4-char width: struct s { int n; /* comment */ unsigned int u; /* comment */ };

Re: kernel guide to space

2005-07-11 Thread Ingo Oeser
On Monday 11 July 2005 17:44, Dmitry Torokhov wrote: > >Descendant must be indented at least to the level of the innermost > >compound expression in the parent. All descendants at the same level > >are indented the same. > >if

Re: kernel guide to space

2005-07-11 Thread Dmitry Torokhov
Hi, On 7/11/05, Michael S. Tsirkin <[EMAIL PROTECTED]> wrote: > 3e. sizeof >space after the operator >sizeof a If braces are used no spaces please : sizeof(struct foo) > > 4c. Breaking long lines >Descendants are always substantially shorter than the parent >

  1   2   >