[U-Boot] [PATCH 1/2] rename CFG_ macros to CONFIG_SYS

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- Makefile | 52 +- README | 334 ++++---- README.nios_CONFIG_SYS_NIOS_CPU | 140 ++++ api/api_storage.c | 8 +- board/AtmarkTechno/suzaku/flash.c | 2 +- board/BuS/EB+MCF-EV123/EB+MCF-EV123.c | 30 +- board/BuS/EB+MCF-EV123/VCxK.c | 2 +- board/BuS/EB+MCF-EV123/cfm_flash.c | 16 +- board/BuS/EB+MCF-EV123/cfm_flash.h | 2 +- board/BuS/EB+MCF-EV123/flash.c | 20 +- board/BuS/EB+MCF-EV123/mii.c | 12 +- board/LEOX/elpt860/elpt860.c | 52 +- board/LEOX/elpt860/flash.c | 30 +- board/MAI/AmigaOneG3SE/cmd_boota.c | 2 +- board/MAI/AmigaOneG3SE/flash.c | 4 +- board/MAI/AmigaOneG3SE/flash_new.c | 30 +- board/MAI/AmigaOneG3SE/i8259.h | 28 +- board/MAI/AmigaOneG3SE/interrupts.c | 4 +- board/MAI/AmigaOneG3SE/ps2kbd.c | 10 +- board/MAI/AmigaOneG3SE/serial.c | 6 +- board/MAI/AmigaOneG3SE/usb_uhci.c | 2 +- board/Marvell/common/flash.c | 22 +- board/Marvell/common/i2c.c | 8 +- board/Marvell/common/intel_flash.c | 4 +- board/Marvell/common/intel_flash.h | 2 +- board/Marvell/common/misc.S | 18 +- board/Marvell/common/ns16550.c | 6 +- board/Marvell/common/ns16550.h | 2 +- board/Marvell/common/serial.c | 22 +- board/Marvell/db64360/db64360.c | 140 ++-- board/Marvell/db64360/mpsc.c | 6 +- board/Marvell/db64360/pci.c | 20 +- board/Marvell/db64360/sdram_init.c | 28 +- board/Marvell/db64460/db64460.c | 140 ++-- board/Marvell/db64460/mpsc.c | 6 +- board/Marvell/db64460/pci.c | 20 +- board/Marvell/db64460/sdram_init.c | 28 +- board/MigoR/migo_r.c | 6 +- board/RPXClassic/RPXClassic.c | 16 +- board/RPXClassic/eccx.c | 2 +- board/RPXClassic/flash.c | 18 +- board/RPXlite/RPXlite.c | 14 +- board/RPXlite/flash.c | 24 +- board/RPXlite_dw/RPXlite_dw.c | 16 +- board/RPXlite_dw/flash.c | 18 +- board/RRvision/RRvision.c | 26 +- board/RRvision/flash.c | 24 +- board/a3000/a3000.c | 2 +- board/a3000/flash.c | 30 +- .....
all board are touched
due to ML limitation patch available here http://git.denx.de/?p=u-boot/u-boot-arm.git;a=commit;h=c52cc1840cf8fe7136a83...
Best Regards, J.

add same check on all board at MAKEALL start it can be disable by CHECK=no as $ CHECK=no ./MAKEALL
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- MAKEALL | 5 +++ Makefile | 4 ++ tools/find_config_errors | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 0 deletions(-) create mode 100755 tools/find_config_errors
diff --git a/MAKEALL b/MAKEALL index 9ccb9ac..a4ce135 100755 --- a/MAKEALL +++ b/MAKEALL @@ -22,6 +22,11 @@ fi
LIST=""
+if [ "${CHECK}" != "no" ] ; then +#find config errors as incorrectly used old variable names +make find_config_errors +fi + ######################################################################### ## MPC5xx Systems ######################################################################### diff --git a/Makefile b/Makefile index c711df6..e91cb18 100644 --- a/Makefile +++ b/Makefile @@ -3236,4 +3236,8 @@ backup: F=`basename $(TOPDIR)` ; cd .. ; \ gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
+find_config_errors: + @echo "Search for config errors" + @git-grep CFG_ | cut -d: -f1 | sort -u | xargs -I {} tools/find_config_errors -f {} + ######################################################################### diff --git a/tools/find_config_errors b/tools/find_config_errors new file mode 100755 index 0000000..168e7e1 --- /dev/null +++ b/tools/find_config_errors @@ -0,0 +1,87 @@ +#!/usr/bin/perl +# +# (C) Copyright 2008 +# Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +use Getopt::Std; +my $num = 1; +my $mode_patch = 0; +my $opt_string = 'hpf:'; + +getopts( "$opt_string", %opt ) or usage(); +usage() if $opt{h}; + +if ($opt{p}) { + $mode_patch = 1; +} + +sub usage() +{ + print STDERR << "EOF"; +This program does... +usage: $0 [-hp] [-f file] <or STDIN> + -h : this (help) message + -p : mode patch + -f file : file to work on +EOF +exit; +} + +my $file = $opt{f}; + +if ($file =~ m/.patch$/) { + $mode_patch = 1; +} + +if ($file =~ m/(config_deprecated.h$|^CHANGELOG)/) { + exit 0 +} + +if ($file) { + open FILE, $file or die $!; +} else { + open FILE, "<&STDIN" or die $!; +} + +while (chomp($line = <FILE>)) +{ + if ((( $mode_patch == 1 ) && ( $line =~ m/^+/)) || $mode_patch == 0) { + + my @matches = $line =~ m/[\s()+-/*{}<>=,;&~#!'"[](CFG_[A-Z0-9_a-z]+)/; + + push (@matches, $line =~ m/^(CFG_[A-Z0-9_a-z]+)/); + + push (@matches, $line =~ m/-D(CFG_[A-Z0-9_a-z]+)/); + + my $sz = scalar(@matches); + + for (my $i=0; $i < $sz; $i++) { + $cfg = $matches[$i]; + print $file.":".$num." "; + print "#error "".$cfg." renamed! Use "; + $cfg =~ s/CFG_/CONFIG_SYS_/g; + print $cfg." or new config instead!"\n"; + print $line."\n"; + } + } + $num++; +} +close FILE;

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1224172939-29090-2-git-send-email-plagnioj@jcrosoft.com you wrote:
add same check on all board at MAKEALL start it can be disable by CHECK=no as $ CHECK=no ./MAKEALL
NAK.
As discussed before, please remove the CHECK stuff from MAKEALL.
Best regards,
Wolfgang Denk

run make find_config_errors to performed it.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- Makefile | 4 ++ tools/find_config_errors | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-) create mode 100755 tools/find_config_errors
diff --git a/Makefile b/Makefile index c711df6..e91cb18 100644 --- a/Makefile +++ b/Makefile @@ -3236,4 +3236,8 @@ backup: F=`basename $(TOPDIR)` ; cd .. ; \ gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
+find_config_errors: + @echo "Search for config errors" + @git-grep CFG_ | cut -d: -f1 | sort -u | xargs -I {} tools/find_config_errors -f {} + ######################################################################### diff --git a/tools/find_config_errors b/tools/find_config_errors new file mode 100755 index 0000000..168e7e1 --- /dev/null +++ b/tools/find_config_errors @@ -0,0 +1,87 @@ +#!/usr/bin/perl +# +# (C) Copyright 2008 +# Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +use Getopt::Std; +my $num = 1; +my $mode_patch = 0; +my $opt_string = 'hpf:'; + +getopts( "$opt_string", %opt ) or usage(); +usage() if $opt{h}; + +if ($opt{p}) { + $mode_patch = 1; +} + +sub usage() +{ + print STDERR << "EOF"; +This program does... +usage: $0 [-hp] [-f file] <or STDIN> + -h : this (help) message + -p : mode patch + -f file : file to work on +EOF +exit; +} + +my $file = $opt{f}; + +if ($file =~ m/.patch$/) { + $mode_patch = 1; +} + +if ($file =~ m/(config_deprecated.h$|^CHANGELOG)/) { + exit 0 +} + +if ($file) { + open FILE, $file or die $!; +} else { + open FILE, "<&STDIN" or die $!; +} + +while (chomp($line = <FILE>)) +{ + if ((( $mode_patch == 1 ) && ( $line =~ m/^+/)) || $mode_patch == 0) { + + my @matches = $line =~ m/[\s()+-/*{}<>=,;&~#!'"[](CFG_[A-Z0-9_a-z]+)/; + + push (@matches, $line =~ m/^(CFG_[A-Z0-9_a-z]+)/); + + push (@matches, $line =~ m/-D(CFG_[A-Z0-9_a-z]+)/); + + my $sz = scalar(@matches); + + for (my $i=0; $i < $sz; $i++) { + $cfg = $matches[$i]; + print $file.":".$num." "; + print "#error "".$cfg." renamed! Use "; + $cfg =~ s/CFG_/CONFIG_SYS_/g; + print $cfg." or new config instead!"\n"; + print $line."\n"; + } + } + $num++; +} +close FILE;

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1224184956-2864-1-git-send-email-plagnioj@jcrosoft.com you wrote:
+find_config_errors:
- @echo "Search for config errors"
- @git-grep CFG_ | cut -d: -f1 | sort -u | xargs -I {} tools/find_config_errors -f {}
Hm... should we not just use "grep -r *" so this will also work when we don't have a full git repository?
And instead of running another process with "cut", a "-l" argument to grep (or even git-grep) would do the same? [Also note that "git-grep" is deprecated, "git grep" should be used instead.]
I think we should change this into:
grep -l -r * | xargs tools/find_config_errors -f
What do you think?
Best regards,
Wolfgang Denk

On 22:18 Thu 16 Oct , Wolfgang Denk wrote:
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 1224184956-2864-1-git-send-email-plagnioj@jcrosoft.com you wrote:
+find_config_errors:
- @echo "Search for config errors"
- @git-grep CFG_ | cut -d: -f1 | sort -u | xargs -I {} tools/find_config_errors -f {}
Hm... should we not just use "grep -r *" so this will also work when we don't have a full git repository?
And instead of running another process with "cut", a "-l" argument to grep (or even git-grep) would do the same? [Also note that "git-grep" is deprecated, "git grep" should be used instead.]
I think we should change this into:
grep -l -r * | xargs tools/find_config_errors -f
It will not work with symlinks
when you do not have a git repository you will check compile code, non use file patch maybe etc... and not ignoring files specified in the differents gitignore.
I'll prefer to only activate it when we have a git reprository otherwise the user will use find_config_errors to check it's patch before send it as done with checkpatch.pl.
so I'll propose instead find_config_errors: @echo "Search for config errors" @# Check for git and a git repo. @if head=`git rev-parse --verify HEAD 2>/dev/null`; then \ git grep -l CFG_ | sort -u | xargs -I {} tools/find_config_errors -f {} ;\ fi
Best Regards, J.

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20081016211010.GA2807@game.jcrosoft.org you wrote:
I think we should change this into:
grep -l -r * | xargs tools/find_config_errors -f
It will not work with symlinks
You don't want to run this in a dirty tree, do you?
when you do not have a git repository you will check compile code, non use file patch maybe etc... and not ignoring files specified in the differents gitignore.
Hm... why should I run this in a drity tree?
I'll prefer to only activate it when we have a git reprository
I don't. There are quite a lot of people out there not using git for their work. Unless really necessary we should not cut them off. And here it seems not really necessary.
otherwise the user will use find_config_errors to check it's patch before send it as done with checkpatch.pl.
so I'll propose instead find_config_errors: @echo "Search for config errors" @# Check for git and a git repo. @if head=`git rev-parse --verify HEAD 2>/dev/null`; then \ git grep -l CFG_ | sort -u | xargs -I {} tools/find_config_errors -f {} ;\ fi
Comments - if we do this only when git is available, then:
- we must issue an error message and set an error return code if git is missing - I don't see much use for the "| sort -u" part of the pipe ? - I don't see much sense for the "-I {}" and "{}" parts in the xargs command ?
Best regards,
Wolfgang Denk

On Thursday 16 October 2008, Jean-Christophe PLAGNIOL-VILLARD wrote:
+find_config_errors:
- @echo "Search for config errors"
- @git-grep CFG_ | cut -d: -f1 | sort -u | xargs -I {} tools/find_config_errors -f {} +
`git grep`, not `git-grep` -mike
participants (3)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Mike Frysinger
-
Wolfgang Denk