qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] checkpatch: Don't WARN about missing spaces in


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] checkpatch: Don't WARN about missing spaces in audio files
Date: Thu, 09 Feb 2012 16:03:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0

Am 09.02.2012 15:59, schrieb Andreas Färber:
> Disable warnings for spaces before opening parenthesis in
> hw/{ac97,adlib,cs4231a,es1370,gus,sb16}.c.
> 
> Signed-off-by: Andreas Färber <address@hidden>
> Cc: Blue Swirl <address@hidden>
> Cc: malc <address@hidden>
> ---

For testing I used the following pseudo-patch:

--8<--

--- a/hw/sb16.c
+++ b/hw/sb16.c
@@ -1,1 +1,1 @@
-device_init (foobar)
+type_init (foobar)

--- a/hw/foo.c
+++ b/hw/foo.c
@@ -1,1 +1,1 @@
-device_init (foobar)
+type_init (foobar)

--8<--

Adding a rule to warn about missing space before parenthesis is left as
an exercise for malc.

Andreas

>  scripts/checkpatch.pl |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 8850a5f..5433736 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -246,6 +246,8 @@ our $allowed_asm_includes = qr{(?x:
>  )};
>  # memory.h: ARM has a custom one
>  
> +our $audio_files = 
> qr{hw/ac97.c|hw/adlib.c|hw/cs4231a.c|hw/es1370.c|hw/gus.c|hw/sb16.c};
> +
>  sub build_types {
>       my $mods = "(?x:  \n" . join("|\n  ", @modifierList) . "\n)";
>       my $all = "(?x:  \n" . join("|\n  ", @typeList) . "\n)";
> @@ -1966,6 +1968,9 @@ sub process {
>                               asm|__asm__)$/x)
>                       {
>  
> +                     # malc wants to keep spacing consistent in the audio 
> files.
> +                     } elsif ($realfile =~ /($audio_files)/) {
> +
>                       # cpp #define statements have non-optional spaces, ie
>                       # if there is a space between the name and the open
>                       # parenthesis it is simply not a parameter group.

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]