Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475934

Re: Clarification for source code formatting around jump labels

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: Clarification for source code formatting around jump labels
Date 2016-09-04 16:00 +0200
Message-ID <sdG7L-6vL-3@gated-at.bofh.it> (permalink)
References (1 earlier) <sdyWB-7hx-3@gated-at.bofh.it> <sdzzj-7tU-3@gated-at.bofh.it> <sdzzj-7tU-7@gated-at.bofh.it> <sdAc1-81V-7@gated-at.bofh.it> <sdCnv-3za-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> I am just curious on how much further software development "fun" the recent update
>> by a topic like "CodingStyle: Clarify and complete chapter 7" will trigger.
> 
> I don't want to drag this thread onwards for (way) too long, but clearly "it is
> advised to indent labels with a single space (not tab)" (from diff in above commit)

How do you think about the reason (which you omitted from your quotation) for this advice?

“…,
so that "diff -p" does not confuse labels with functions.
…”


> doesn't really reflect the majority of kernel practice we have in-tree today and
> actually rather adds more confusion than any clarification whatsoever:
> 
>   $ git grep -n "^\ [a-z_]*:" -- '*.[ch]' | wc -l
>   4919
>   $ git grep -n "^[a-z_]*:" -- '*.[ch]' | wc -l
>   54686

So there is a mixture already.


> A CodingStyle document should document what's regarded as a general consensus of
> kernel coding practices, and thus should represent the /majority/ of coding style,
> which (if I didn't screw up my git-grep line completely)

1. Is the used character class specification complete in the shown regular expression?

2. I guess that you should use the regex operator "plus" (instead of the asterisk).

3. Would you like to try another source code analysis out which can be a bit safer
   with the usage of the semantic patch language?


> above 9% does not really reflect at all.

How tolerant are you for using an extra space character before the identifier for
a jump label?


> So, new folks starting with kernel hacking reading this are rather misguided,
> and code-wise it just adds up to have more inconsistencies from new patches,
> or worse, have noisy patches (like this one) flying around that try to
> brute-force everything into this advice.

In which ways would you prefer that the style specifications should be
clarified further?

Where should source code become more consistent?

Regards,
Markus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] sparc: bpf_jit: Fine-tuning for bpf_jit_compile() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-03 18:40 +0200
  [PATCH 1/4] sparc: bpf_jit: Use kmalloc_array() in bpf_jit_compile() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-03 18:40 +0200
    Re: [PATCH 1/4] sparc: bpf_jit: Use kmalloc_array() in bpf_jit_compile() Daniel Borkmann <daniel@iogearbox.net> - 2016-09-03 19:00 +0200
  [PATCH 4/4] sparc: bpf_jit: Rename jump labels in bpf_jit_compile() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-03 18:50 +0200
    Re: [PATCH 4/4] sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Daniel Borkmann <daniel@iogearbox.net> - 2016-09-03 19:00 +0200
      Re: [PATCH 4/4] sparc: bpf_jit: Rename jump labels in  bpf_jit_compile() David Miller <davem@davemloft.net> - 2016-09-04 08:20 +0200
        Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-04 09:00 +0200
          Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() David Miller <davem@davemloft.net> - 2016-09-04 09:00 +0200
            Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-04 09:40 +0200
              Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() David Miller <davem@davemloft.net> - 2016-09-04 09:40 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-04 09:50 +0200
              Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Daniel Borkmann <daniel@iogearbox.net> - 2016-09-04 12:00 +0200
                Re: Clarification for source code formatting around jump labels SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-04 16:00 +0200
                Re: Clarification for source code formatting around jump labels Daniel Borkmann <daniel@iogearbox.net> - 2016-09-04 19:40 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Jean Delvare <jdelvare@suse.de> - 2016-09-05 13:10 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Peter Zijlstra <peterz@infradead.org> - 2016-09-05 13:40 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Peter Zijlstra <peterz@infradead.org> - 2016-09-05 14:00 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Jean Delvare <jdelvare@suse.de> - 2016-09-06 16:40 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Peter Zijlstra <peterz@infradead.org> - 2016-09-06 16:50 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Joe Perches <joe@perches.com> - 2016-09-06 17:30 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Jean Delvare <jdelvare@suse.de> - 2016-09-07 14:40 +0200
                Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile() Jean Delvare <jdelvare@suse.de> - 2016-09-05 14:00 +0200
  [PATCH 3/4] sparc: bpf_jit: Avoid assignment for "flen" if BPF JIT is  disabled SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-03 18:50 +0200
    Re: [PATCH 3/4] sparc: bpf_jit: Avoid assignment for "flen" if BPF  JIT is disabled Daniel Borkmann <daniel@iogearbox.net> - 2016-09-03 19:00 +0200

csiph-web