[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MdbkgvVFFPuyzeAR1HbEh=YVCyDBQ09mnw1qFFtANt3ig@mail.gmail.com>
Date: Mon, 11 Dec 2017 10:39:10 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Joe Perches <joe@...ches.com>
Cc: Andy Whitcroft <apw@...onical.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] checkpatch: don't require octal permissions for "0"
2017-12-11 3:19 GMT+01:00 Joe Perches <joe@...ches.com>:
> On Sun, 2017-12-10 at 15:04 +0100, Bartosz Golaszewski wrote:
>> If the permission value is 0, don't raise the NON_OCTAL_PERMISSIONS
>> error. There's no possibility of an error if there are no permissions.
>>
>> Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
>> Signed-off-by: Bartosz Golaszewski <brgl@...ev.pl>
>> ---
>> scripts/checkpatch.pl | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>> index 6b130a4116fa..ea98e298d3ac 100755
>> --- a/scripts/checkpatch.pl
>> +++ b/scripts/checkpatch.pl
>> @@ -6321,7 +6321,7 @@ sub process {
>> if ($stat =~ /$test/) {
>> my $val = $1;
>> $val = $6 if ($skip_args ne "");
>> - if (($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
>> + if (($val ne "0" && $val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
>> ($val =~ /^$Octal$/ && length($val) ne 4)) {
>> ERROR("NON_OCTAL_PERMISSIONS",
>> "Use 4 digit octal (0777) not decimal permissions\n" . "$here\n" . $stat_real);
>
> perhaps
> ---
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 6b130a4116fa..950bbc0e6e3f 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -6321,7 +6321,8 @@ sub process {
> if ($stat =~ /$test/) {
> my $val = $1;
> $val = $6 if ($skip_args ne "");
> - if (($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
> + if ($func !~ /^module_param/ &&
> + ($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
> ($val =~ /^$Octal$/ && length($val) ne 4)) {
> ERROR("NON_OCTAL_PERMISSIONS",
> "Use 4 digit octal (0777) not decimal permissions\n" . "$here\n" . $stat_real);
I would still check for octal permissions for anything else but "0"
here. I'll send a patch shortly.
Thanks,
Bartosz
Powered by blists - more mailing lists