Skip to contentSkip to conversation

CFG_ macro renaming

RFC Jean-Christophe PLAGNIOL-VILLARD 4 participants 9 messages Sep 1, 2008 – Sep 13, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

As announce during OLS conference, it's plain to use kconfig to manage board configuration.

For this purpose and Makefile conditional compile we're move CFG_ macro to new CONFIG_ marco

For memory

There are two classes of configuration variables:

* Configuration _OPTIONS_:
These are selectable by the user and have names beginning with "CONFIG_".

* Configuration _SETTINGS_:
These depend on the hardware etc. and should not be meddled with if you don't know what you're doing; they have names beginning with "CFG_".

to keep CFG_ meaning we will rename them in the following change

1) Basic config

For environment we will use CONFIG_ENV_ (will be done this merge windows)

For configuration settings CONFIG_SYS_

additional proposition

2) Extra config

For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_

For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_

For USB settings CONFIG_USE or CONFIG_SYS_PCI_

For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_

For nand settins CONFIG_NAND or CONFIG_SYS_NAND_

For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT

etc...

Comments are welcome.

The move to new style will be done for the beggining of the next merge window

Best Regards,
J.

#1 lore raw

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 2 lines · In message <[email protected]> you wrote:

As announce during OLS conference, it's plain to

s/plain/planned/

Quoted 9 lines

* Configuration _OPTIONS_:
These are selectable by the user and have names beginning with "CONFIG_".

* Configuration _SETTINGS_:
These depend on the hardware etc. and should not be meddled with if you don't know what you're doing; they have names beginning with "CFG_".

Quoted 5 lines

to keep CFG_ meaning we will rename them in the following change

1) Basic config

For environment we will use CONFIG_ENV_ (will be done this merge windows)

i. e. s/CFG_ENV_/CONFIG_ENV_/g

Quoted 1 line

For configuration settings CONFIG_SYS_

For *other* configuration settings we will use CONFIG_SYS_, i. e. s/CFG_/CONFIG_SYS_g.

Quoted 8 lines

2) Extra config

For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_

For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_

For USB settings CONFIG_USE or CONFIG_SYS_PCI_

Quoted 7 lines

For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_

For nand settins CONFIG_NAND or CONFIG_SYS_NAND_

For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT

etc...

Please do not do that, as it will interfere with a lot of already existing definitions. Stick with CONFIG_SYS_ in general. There may be some cases where your suggestion makes sense, but these need to be carefully hand-selected, i. e. this must not be done by some automatically running script.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
: ... and it's got weird formatting - Notepad, Write, Works  3  can't
: decipher it, and it's too big to go in DOS Edit. Help!
Install an operating system. :-)                  -- Tom Christiansen
#2 lore raw
Quoted 15 lines
Quoted 15 lines

2) Extra config

For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_

For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_

For USB settings CONFIG_USE or CONFIG_SYS_PCI_

For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_

For nand settins CONFIG_NAND or CONFIG_SYS_NAND_

For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT

Quoted 7 lines
Quoted 1 line
	etc...

Please do not do that, as it will interfere with a lot of already existing definitions. Stick with CONFIG_SYS_ in general. There may be some cases where your suggestion makes sense, but these need to be carefully hand-selected, i. e. this must not be done by some automatically running script.

As you point this part was plain to be done manually.

Best Regards,
J.

#3 lore raw

Hi Jean-Christophe,
Hi Wolfgang,

Can you create a "deprecated_cfg.h" file that contains directives like:

#ifdef CFG_OLD_PARAMATER
#error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif

for each CFG_* renamed directive?

This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.

my2cents

best regards,

luigi

Il marted? 02 settembre 2008 02:59:58 Jean-Christophe PLAGNIOL-VILLARD ha scritto:

Quoted 30 lines
Quoted 14 lines
Quoted 14 lines

2) Extra config

For memory settings CONFIG_MEM_ or CONFIG_SYS_MEM_

For PCI settings CONFIG_PCI_ or CONFIG_SYS_PCI_

For USB settings CONFIG_USE or CONFIG_SYS_PCI_

For flash settings CONFIG_FLASH or CONFIG_SYS_FLASH_

For nand settins CONFIG_NAND or CONFIG_SYS_NAND_

For dtt settgins CONFIG_DTT or CONFIG_SYS_DTT

Quoted 7 lines
Quoted 1 line
	etc...

Please do not do that, as it will interfere with a lot of already existing definitions. Stick with CONFIG_SYS_ in general. There may be some cases where your suggestion makes sense, but these need to be carefully hand-selected, i. e. this must not be done by some automatically running script.

As you point this part was plain to be done manually.

Best Regards,
J.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 8 lines
Luigi Mantellini
R&D - Software
Industrie Dial Face S.p.A.
Via Canzo, 4
20068 Peschiera Borromeo (MI), Italy
Tel.:  +39 02 5167 2813
Fax:   +39 02 5167 2459
Email: luigi.mantellini at idf-hit.com
#4 lore raw
Quoted 5 lines · Luigi 'Comio' Mantellini

Hi Jean-Christophe,
Hi Wolfgang,

Can you create a "deprecated_cfg.h" file that contains directives like:

Quoted 8 lines

#ifdef CFG_OLD_PARAMATER
#error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif

for each CFG_* renamed directive?

This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.

IMHO, I do not think it's needed due to there is no "lost" possible with this kind of script

git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e "s:CFG_:CONFIG_SYS_:g"

Best Regards,
J.

#5 lore raw

Hi J.

see inline comments.
Il sabato 13 settembre 2008 23:41:55 Jean-Christophe PLAGNIOL-VILLARD ha scritto:

Quoted 12 lines · Luigi 'Comio' Mantellini
Quoted 11 lines

Hi Jean-Christophe,
Hi Wolfgang,

Can you create a "deprecated_cfg.h" file that contains directives like:

#ifdef CFG_OLD_PARAMATER
#error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif

for each CFG_* renamed directive?

Quoted 9 lines
Quoted 2 lines

This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.

IMHO, I do not think it's needed due to there is no "lost" possible with this kind of script

git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e "s:CFG_:CONFIG_SYS_:g"

This doesn't apply on CFG_ENV_IS_* / CONFIG_ENV_IS_* macros (for example). and I should use this grep/sed only at the end of the macro renaming. I'm speaking about the transitory time.

Best regards,

luigi

Quoted 2 lines

Best Regards,
J.

Signature · 9 lines
?
Luigi Mantellini
R&D - Software
Industrie Dial Face S.p.A.
Via Canzo, 4 
20068 Peschiera Borromeo (MI), Italy
Tel.:?? +39 02 5167 2813
Fax:??? +39 02 5167 2459
E-mail: luigi.mantellini at idf-hit.com
#6 lore raw
Quoted 20 lines
Quoted 4 lines
Quoted 4 lines

This should avoid to "lost" some configuration parameters during this

transitory.phase. this file should be included by common.h for

example.

Quoted 4 lines

IMHO, I do not think it's needed due to there is no "lost" possible with

Quoted 9 lines

this kind of script

git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e

"s:CFG_:CONFIG_SYS_:g"

Quoted 5 lines

This doesn't apply on CFG_ENV_IS_* / CONFIG_ENV_IS_* macros (for example). and

I should use this grep/sed only at the end of the macro renaming. I'm speaking about the transitory time.

The CFG_ENV_ is already renammed into CONFIG_ENV_ and applied in Wolfgang's tree.

Best Regards,
J.

#7 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 8 lines

Can you create a "deprecated_cfg.h" file that contains directives like:

#ifdef CFG_OLD_PARAMATER
#error "CFG_OLD_PARAMETER renamed! Use CONIFIG_NEW_PARAMETER instead!" #endif

for each CFG_* renamed directive?

I think this is a good idea.

Quoted 5 lines
Quoted 2 lines

This should avoid to "lost" some configuration parameters during this transitory.phase. this file should be included by common.h for example.

IMHO, I do not think it's needed due to there is no "lost" possible with this kind of script

git-grep CFG_ | cut -d: -f1 | grep -v -e "CHANGELOG*" | xargs sed -i -e "s:CFG_:CONFIG_SYS_:g"

It may not be needed for code in mainline, but it is a simple and efficient way to catch mistakes when someone submits new code that has been smoldering for some while in some private repository.

It protects against errors, and it doesn't hurt...

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A wise person makes his  own  decisions,  a  weak  one  obeys  public
opinion.                                           -- Chinese proverb
#8 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

For USB settings CONFIG_USE or CONFIG_SYS_PCI_

Huh?

I guess you meant s/USE/USB/ and s/PCI/USB/ ?

Best regards
Markus

Signature · 3 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de")