linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaud Lacombe <lacombar@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Arnaud Lacombe <lacombar@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Andy Whitcroft <apw@canonical.com>
Subject: [PATCH 11/11] script/checkpatch.pl: warn about deprecated use of EXTRA_{A,C,CPP,LD}FLAGS
Date: Mon, 15 Aug 2011 01:07:14 -0400	[thread overview]
Message-ID: <1313384834-24433-12-git-send-email-lacombar@gmail.com> (raw)
In-Reply-To: <1313384834-24433-1-git-send-email-lacombar@gmail.com>

Usage of these flags has been deprecated for nearly 4 years by:

    commit f77bf01425b11947eeb3b5b54685212c302741b8
    Author: Sam Ravnborg <sam@neptun.(none)>
    Date:   Mon Oct 15 22:25:06 2007 +0200

        kbuild: introduce ccflags-y, asflags-y and ldflags-y

Moreover, these flags (at least EXTRA_CFLAGS) have been documented for command
line use. By default, gmake(1) do not override command line setting, so this is
likely to result in build failure or unexpected behavior.

Warn about their introduction in Makefile or Kbuild files.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Andy Whitcroft <apw@canonical.com>
---
 scripts/checkpatch.pl |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9d761c9..955183a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1661,6 +1661,20 @@ sub process {
 			#print "is_end<$is_end> length<$length>\n";
 		}
 
+		if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
+		    ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
+			my $flag = $1;
+			my $replacement = {
+				'EXTRA_AFLAGS' =>   'asflags-y',
+				'EXTRA_CFLAGS' =>   'ccflags-y',
+				'EXTRA_CPPFLAGS' => 'cppflags-y',
+				'EXTRA_LDFLAGS' =>  'ldflags-y',
+			};
+
+			WARN("DEPRECATED_VARIABLE",
+			     "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag});
+		}
+
 # check we are in a valid source file if not then ignore this hunk
 		next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
 
-- 
1.7.6.153.g78432


  parent reply	other threads:[~2011-08-15  5:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  5:07 [PATCH 00/11] Fix in-tree usage " Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 01/11] arch/m68k: do not use EXTRA_{A,C,LD}FLAGS Arnaud Lacombe
2011-08-15  5:11   ` Arnaud Lacombe
2011-08-15  7:26   ` Finn Thain
2011-08-15 14:45     ` Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 02/11] arch/mips: do not use EXTRA_CFLAGS Arnaud Lacombe
2011-08-15  9:45   ` Sergei Shtylyov
2011-08-15 13:55     ` Ralf Baechle
2011-08-15 16:19       ` Arnaud Lacombe
2011-08-15 17:28         ` Jayachandran C.
2011-08-16 10:05           ` Ralf Baechle
2011-08-15  5:07 ` [PATCH 03/11] arch/unicore32: do not use EXTRA_AFLAGS or EXTRA_CFLAGS Arnaud Lacombe
2011-08-15  5:13   ` Arnaud Lacombe
2011-08-18  8:00     ` Guan Xuetao
2011-08-18 16:37       ` Arnaud Lacombe
2011-08-19  6:54         ` Guan Xuetao
2011-08-15  5:07 ` [PATCH 04/11] arch/x86: do not use EXTRA_CFLAGS Arnaud Lacombe
2011-08-15  5:14   ` Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 05/11] drivers/media: " Arnaud Lacombe
2011-08-15  5:15   ` Arnaud Lacombe
2011-08-16  8:15   ` Laurent Pinchart
2011-08-15  5:07 ` [PATCH 06/11] drivers/net/bna: " Arnaud Lacombe
2011-08-15  5:16   ` Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 07/11] drivers/pps: " Arnaud Lacombe
2011-08-15  5:16   ` Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 08/11] drivers/scsi: " Arnaud Lacombe
2011-08-15  5:16   ` Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 09/11] drivers/staging: " Arnaud Lacombe
2011-08-15  5:15   ` Arnaud Lacombe
2011-08-15  5:07 ` [PATCH 10/11] scripts/Makefile.build: do not reference EXTRA_CFLAGS as CFLAGS replacement Arnaud Lacombe
2011-08-22 15:50   ` Arnaud Lacombe
2011-08-31 14:43   ` Michal Marek
2011-08-15  5:07 ` Arnaud Lacombe [this message]
2011-08-15  5:10   ` [PATCH 11/11] script/checkpatch.pl: warn about deprecated use of EXTRA_{A,C,CPP,LD}FLAGS Arnaud Lacombe
2011-08-31 14:44   ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1313384834-24433-12-git-send-email-lacombar@gmail.com \
    --to=lacombar@gmail.com \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --subject='Re: [PATCH 11/11] script/checkpatch.pl: warn about deprecated use of EXTRA_{A,C,CPP,LD}FLAGS' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).