All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.
@ 2017-10-11  4:33 Jiang Biao
  2017-10-11  5:12 ` no-reply
  2017-10-11 12:03 ` Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Jiang Biao @ 2017-10-11  4:33 UTC (permalink / raw)
  To: qemu-devel, peter.maydell; +Cc: jiang.biao2, zhong.weidong

There are some rare cases which need external declarations in .c
files. patchew.org and checkpatch.pl will complain errors on
patches for these declarations.

Degrade ERROR to WARN to erase the error complaints taking
checkpatch.pl in kernel as reference.

Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3c0a28e..9123788 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2546,7 +2546,7 @@ sub process {
 			if ($s =~ /^\s*;/ &&
 			    $function_name ne 'uninitialized_var')
 			{
-				ERROR("externs should be avoided in .c files\n" .  $herecurr);
+				WARN("externs should be avoided in .c files\n" .  $herecurr);
 			}
 
 			if ($paren_space =~ /\n/) {
@@ -2556,7 +2556,7 @@ sub process {
 		} elsif ($realfile =~ /\.c$/ && defined $stat &&
 		    $stat =~ /^.\s*extern\s+/)
 		{
-			ERROR("externs should be avoided in .c files\n" .  $herecurr);
+			WARN("externs should be avoided in .c files\n" .  $herecurr);
 		}
 
 # check for pointless casting of g_malloc return
-- 
2.9.5

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

* Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.
  2017-10-11  4:33 [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking Jiang Biao
@ 2017-10-11  5:12 ` no-reply
  2017-10-11 12:03 ` Peter Maydell
  1 sibling, 0 replies; 5+ messages in thread
From: no-reply @ 2017-10-11  5:12 UTC (permalink / raw)
  To: jiang.biao2; +Cc: famz, qemu-devel, peter.maydell, zhong.weidong

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 1507696406-11168-1-git-send-email-jiang.biao2@zte.com.cn
Subject: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
5a8e815e78 checkpatch: replace ERROR with WARN for extern checking.

=== OUTPUT BEGIN ===
Checking PATCH 1/1: checkpatch: replace ERROR with WARN for extern checking....
ERROR: line over 90 characters
#25: FILE: scripts/checkpatch.pl:2550:
+				WARN("externs should be avoided in .c files\n" .  $herecurr);

WARNING: line over 80 characters
#34: FILE: scripts/checkpatch.pl:2560:
+			WARN("externs should be avoided in .c files\n" .  $herecurr);

total: 1 errors, 1 warnings, 16 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

* Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.
  2017-10-11  4:33 [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking Jiang Biao
  2017-10-11  5:12 ` no-reply
@ 2017-10-11 12:03 ` Peter Maydell
  2017-10-12  1:19   ` [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN forextern checking jiang.biao2
  2017-11-06  6:19   ` [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking Markus Armbruster
  1 sibling, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2017-10-11 12:03 UTC (permalink / raw)
  To: Jiang Biao; +Cc: QEMU Developers, zhong.weidong

On 11 October 2017 at 05:33, Jiang Biao <jiang.biao2@zte.com.cn> wrote:
> There are some rare cases which need external declarations in .c
> files. patchew.org and checkpatch.pl will complain errors on
> patches for these declarations.
>
> Degrade ERROR to WARN to erase the error complaints taking
> checkpatch.pl in kernel as reference.
>
> Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
> ---
>  scripts/checkpatch.pl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

I'd rather not drop this to a warning for the sake of a single
use case that's already in the tree (and which if you really
cared about you could work around by putting the link_error()
declaration in a header file I suppose, though I wouldn't
bother personally.)

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN forextern checking.
  2017-10-11 12:03 ` Peter Maydell
@ 2017-10-12  1:19   ` jiang.biao2
  2017-11-06  6:19   ` [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking Markus Armbruster
  1 sibling, 0 replies; 5+ messages in thread
From: jiang.biao2 @ 2017-10-12  1:19 UTC (permalink / raw)
  To: qemu-devel

> On 11 October 2017 at 05:33, Jiang Biao <jiang.biao2@zte.com.cn> wrote:
> 
> I'd rather not drop this to a warning for the sake of a single
> use case that's already in the tree (and which if you really
> cared about you could work around by putting the link_error()
> declaration in a header file I suppose, though I wouldn't
> bother personally.)



Neither would I :). Thanks for the reply. 


Regards, Jiang

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

* Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.
  2017-10-11 12:03 ` Peter Maydell
  2017-10-12  1:19   ` [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN forextern checking jiang.biao2
@ 2017-11-06  6:19   ` Markus Armbruster
  1 sibling, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2017-11-06  6:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Jiang Biao, zhong.weidong, QEMU Developers

Peter Maydell <peter.maydell@linaro.org> writes:

> On 11 October 2017 at 05:33, Jiang Biao <jiang.biao2@zte.com.cn> wrote:
>> There are some rare cases which need external declarations in .c
>> files. patchew.org and checkpatch.pl will complain errors on
>> patches for these declarations.
>>
>> Degrade ERROR to WARN to erase the error complaints taking
>> checkpatch.pl in kernel as reference.
>>
>> Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
>> ---
>>  scripts/checkpatch.pl | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> I'd rather not drop this to a warning for the sake of a single
> use case that's already in the tree (and which if you really

Concur.  Rare false positives from checkpatch are tolerable.

> cared about you could work around by putting the link_error()
> declaration in a header file I suppose, though I wouldn't
> bother personally.)

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

end of thread, other threads:[~2017-11-06  6:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-11  4:33 [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking Jiang Biao
2017-10-11  5:12 ` no-reply
2017-10-11 12:03 ` Peter Maydell
2017-10-12  1:19   ` [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN forextern checking jiang.biao2
2017-11-06  6:19   ` [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking Markus Armbruster

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.