[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for l
From: |
Riku Voipio |
Subject: |
Re: [Qemu-devel] [PATCH] checkpatch.pl: disable arch-specific test for linux-user |
Date: |
Tue, 27 Sep 2016 16:36:58 +0300 |
On 27 September 2016 at 14:58, Paolo Bonzini <address@hidden> wrote:
>
>
> On 26/09/2016 21:58, address@hidden wrote:
>> From: Riku Voipio <address@hidden>
>>
>> Linux-user and bsd-user code needs lots of arch-specific ifdefs,
>> so disable the warning.
>>
>> Signed-off-by: Riku Voipio <address@hidden>
>> ---
>> scripts/checkpatch.pl | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index dde3f5f..98a007f 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -2405,8 +2405,9 @@ sub process {
>> }
>> # check of hardware specific defines
>> # we have e.g. CONFIG_LINUX and CONFIG_WIN32 for common cases
>> -# where they might be necessary.
>> - if ($line =~ address@hidden@) {
>> +# where they might be necessary. Skip test on linux-user and bsd-user
>> +# where arch defines are needed
>> + if (!($realfile =~ /^(linux|bsd)-user/) && $line =~
>> address@hidden@) {
>> ERROR("architecture specific defines should be
>> avoided\n" . $herecurr);
>> }
>>
>>
>
> Hi Riku,
>
> I have already posted a pull request that degrades this to a warning.
>
> Later on we may make it an error except for some files and/or patterns.
> For linux-user I think that __NR_* should be definitely allowed, but a
> blanket permission is not necessary.
I'll update my patch against your PR and to check not only for
linux-user dir, but also match __NR_.
Riku