[PATCH v3 6/9] scripts/checkpatch: expand pattern for matching makefiles

Daniel P. Berrangé posted 9 patches 7 months ago
There is a newer version of this series
[PATCH v3 6/9] scripts/checkpatch: expand pattern for matching makefiles
Posted by Daniel P. Berrangé 7 months ago
The current regex matches Makefile & Makefile.objs, but the latter is
no longer used, and we're missing coverage of Makefile.include and
Makefile.target. Expand the pattern to match any suffix.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4a18daa384..00d7d72e53 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1453,7 +1453,7 @@ sub process_start_of_file {
 		my $permhere = $fileinfo->{linestart} . "FILE: " .
 			$fileinfo->{filenew} . "\n";
 		if ($fileinfo->{filenew} =~
-		    /(\bMakefile(?:\.objs)?|\.(c|cc|cpp|h|mak|s|S))$/) {
+		    /(\bMakefile.*|\.(c|cc|cpp|h|mak|s|S))$/) {
 			ERROR("do not set execute permissions for source " .
 			      "files\n" . $permhere);
 		}
-- 
2.49.0


Re: [PATCH v3 6/9] scripts/checkpatch: expand pattern for matching makefiles
Posted by Peter Maydell 7 months ago
On Thu, 15 May 2025 at 15:00, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> The current regex matches Makefile & Makefile.objs, but the latter is
> no longer used, and we're missing coverage of Makefile.include and
> Makefile.target. Expand the pattern to match any suffix.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Re: [PATCH v3 6/9] scripts/checkpatch: expand pattern for matching makefiles
Posted by Cédric Le Goater 7 months ago
On 5/15/25 15:59, Daniel P. Berrangé wrote:
> The current regex matches Makefile & Makefile.objs, but the latter is
> no longer used, and we're missing coverage of Makefile.include and
> Makefile.target. Expand the pattern to match any suffix.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   scripts/checkpatch.pl | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 4a18daa384..00d7d72e53 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1453,7 +1453,7 @@ sub process_start_of_file {
>   		my $permhere = $fileinfo->{linestart} . "FILE: " .
>   			$fileinfo->{filenew} . "\n";
>   		if ($fileinfo->{filenew} =~
> -		    /(\bMakefile(?:\.objs)?|\.(c|cc|cpp|h|mak|s|S))$/) {
> +		    /(\bMakefile.*|\.(c|cc|cpp|h|mak|s|S))$/) {
>   			ERROR("do not set execute permissions for source " .
>   			      "files\n" . $permhere);
>   		}



Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.