All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] checkpatch: remove rule on non-indented labels
@ 2011-10-07 13:59 Paolo Bonzini
  2011-10-07 14:43 ` Peter Maydell
  2011-11-01 22:20 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2011-10-07 13:59 UTC (permalink / raw)
  To: qemu-devel

There are 508 non-indented (non-default) labels, and 511 that are
indented.  So the rule is debatable at least.  Actually, in the
common case of labels at the outermost scope, there is really just
one place where to put the label, so the rule is just wrong IMHO.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/checkpatch.pl |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0eba357..7a71324 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2206,12 +2206,6 @@ sub process {
 			ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr);
 		}
 
-#goto labels aren't indented, allow a single space however
-		if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
-		   !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
-			WARN("labels should not be indented\n" . $herecurr);
-		}
-
 # Return is not a function.
 		if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
 			my $spacing = $1;
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] checkpatch: remove rule on non-indented labels
  2011-10-07 13:59 [Qemu-devel] [PATCH] checkpatch: remove rule on non-indented labels Paolo Bonzini
@ 2011-10-07 14:43 ` Peter Maydell
  2011-11-01 22:20 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2011-10-07 14:43 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 7 October 2011 14:59, Paolo Bonzini <pbonzini@redhat.com> wrote:
> There are 508 non-indented (non-default) labels, and 511 that are
> indented.  So the rule is debatable at least.  Actually, in the
> common case of labels at the outermost scope, there is really just
> one place where to put the label, so the rule is just wrong IMHO.

Agreed. This is one of the checkpatch shibboleths that I just
ignore when submitting patches :-)

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] checkpatch: remove rule on non-indented labels
  2011-10-07 13:59 [Qemu-devel] [PATCH] checkpatch: remove rule on non-indented labels Paolo Bonzini
  2011-10-07 14:43 ` Peter Maydell
@ 2011-11-01 22:20 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-11-01 22:20 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 10/07/2011 08:59 AM, Paolo Bonzini wrote:
> There are 508 non-indented (non-default) labels, and 511 that are
> indented.  So the rule is debatable at least.  Actually, in the
> common case of labels at the outermost scope, there is really just
> one place where to put the label, so the rule is just wrong IMHO.
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   scripts/checkpatch.pl |    6 ------
>   1 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 0eba357..7a71324 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2206,12 +2206,6 @@ sub process {
>   			ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr);
>   		}
>
> -#goto labels aren't indented, allow a single space however
> -		if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
> -		   !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
> -			WARN("labels should not be indented\n" . $herecurr);
> -		}
> -
>   # Return is not a function.
>   		if (defined($stat)&&  $stat =~ /^.\s*return(\s*)(\(.*);/s) {
>   			my $spacing = $1;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-01 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07 13:59 [Qemu-devel] [PATCH] checkpatch: remove rule on non-indented labels Paolo Bonzini
2011-10-07 14:43 ` Peter Maydell
2011-11-01 22:20 ` Anthony Liguori

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.