[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d36bef932de0612746088388df793de99d7c129.camel@perches.com>
Date: Mon, 16 Jul 2018 08:23:59 -0700
From: Joe Perches <joe@...ches.com>
To: Dirk Gouders <dirk@...ders.net>, Andy Whitcroft <apw@...onical.com>
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch: if_changed: check for multiple calls in
targets
On Mon, 2018-07-16 at 14:39 +0200, Dirk Gouders wrote:
> Because the kbuild function if_changed writes the command line to a
> .cmd file for later tests, multiple calls of that function within a
> target would result in overwrites of previous values and effectively
> render the command line test meaningless, resulting in flip-flop
> behaviour.
>
> Produce an error for targets with multiple calls to if_changed.
Hi. Some questions:
How is the existing use in arch/microblaze/boot/Makefile incorrect?
$(obj)/simpleImage.%: vmlinux FORCE
$(call if_changed,cp,.unstrip)
$(call if_changed,objcopy)
$(call if_changed,uimage)
$(call if_changed,strip,.strip)
@echo 'Kernel: $(UIMAGE_OUT) is ready' ' (#'`cat .version`')'
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2911,6 +2911,14 @@ sub process {
> "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag});
> }
> i
> + # Check for multiple calls of if_changed within a target in Makefiles
> + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
Why is any Kbuild file check useful?
> + ($prevline =~ /^[ +]\t\$\(call if_changed,/) &&
> + ($line =~ /^[ +]\t\$\(call if_changed,/)) {
What about if_changed_dep and if_changed_rule?
> + ERROR("MULTIPLE_IF_CHANGED",
> + "Multiple calls of if_changed within a target.\n" . $herecurr);
> + }
And some more style things:
There are instances with multiple tabs so probably
these should use '\t*' or '\s*' and not '\t'.
This should probably not require a single space after
if_changed so likely:
'call\s+if_changed'
Powered by blists - more mailing lists