Skip to content

Commit

Permalink
checkpatch: remove GCC_BINARY_CONSTANT warning
Browse files Browse the repository at this point in the history
This warning was there to avoid the use of 0bxxx values as they are not
supported by gcc prior to v4.3

Since cafa001 ("Raise the minimum required gcc version to 4.6"),
it's not an issue anymore and using such values can increase readability
of code.

Joe said:

: Seems sensible as the other compilers also support binary literals from
: relatively old versions.
: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf
: https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler

Link: http://lkml.kernel.org/r/392eeae782302ee8812a3c932a602035deed1609.1535351453.git.christophe.leroy@c-s.fr
Signed-off-by: Christophe Leroy <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
chleroy authored and torvalds committed Oct 31, 2018
1 parent 8997600 commit 22ebb72
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4934,17 +4934,6 @@ sub process {
while ($line =~ m{($Constant|$Lval)}g) {
my $var = $1;

#gcc binary extension
if ($var =~ /^$Binary$/) {
if (WARN("GCC_BINARY_CONSTANT",
"Avoid gcc v4.3+ binary constant extension: <$var>\n" . $herecurr) &&
$fix) {
my $hexval = sprintf("0x%x", oct($var));
$fixed[$fixlinenr] =~
s/\b$var\b/$hexval/;
}
}

#CamelCase
if ($var !~ /^$Constant$/ &&
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
Expand Down

0 comments on commit 22ebb72

Please sign in to comment.