lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAN8TOE9AFSVOhP1fazHK_VWZjDtqtd-Co47pGGFVvuS99qNy4A@mail.gmail.com>
Date:	Thu, 22 Aug 2013 15:14:47 -0700
From:	Brian Norris <computersforpeace@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Andy Whitcroft <apw@...onical.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: checkpatch.pl: false warning about "-p0 patch"

On Thu, Aug 22, 2013 at 2:57 PM, Joe Perches <joe@...ches.com> wrote:
> On Thu, 2013-08-22 at 14:45 -0700, Brian Norris wrote:
>> Hello,
>
> Hello.
>
>> I have received what appears to be a false warning from checkpatch.pl when
>> checking a patch named 'b':
>>
>>     $ scripts/checkpatch.pl b
>>     WARNING: patch prefix 'b' exists, appears to be a -p0 patch
>>
>>     total: 0 errors, 1 warnings, 16 lines checked
>>
>>     b has style problems, please review.
>>
>>     If any of these errors are false positives, please report
>>     them to the maintainer, see CHECKPATCH in MAINTAINERS.
>>
>> It appears that I can trigger this warning with any arbitrary commit. The
>> following bash script gives me at least one warning for everything in Linus'
>> tree:
>>
>>   for i in {0..100}
>>   do
>>       git format-patch -1 HEAD~$i --stdout > b
>>       scripts/checkpatch.pl b
>>   done
>>
>> I have also seen this warning on patches with other names, but I'm not
>> reproducing that right now.
>
> checkpatch can use stdin as well as files/patches.
>
> Try this instead of creating a temporary file:
>
> for i in {0..100}
> do
>     git format-patch -1 --stdout HEAD~$1 | ./scripts/checkpatch.pl -
> done

Thanks for the tip. This for-loop was just a litmus test to show that
checkpatch.pl is indeed failing simply because of the filename of 'b'.
So I would consider that a checkpatch.pl bug.

But now, I realized the problem is simply with the existence of a file
named 'b'. That is, checkpatch will give a warning for this:

  touch b
  git format-patch -1 --stdout | scripts/checkpatch.pl -
  WARNING: patch prefix 'b' exists, appears to be a -p0 patch

  WARNING: patch prefix 'b' exists, appears to be a -p0 patch

  WARNING: patch prefix 'b' exists, appears to be a -p0 patch
  ...

Is that expected?

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ