[U-Boot] [PATCH] lib/crc16: use non-C99 loop style

Philipp Tomsich philipp.tomsich at theobroma-systems.com
Thu Feb 14 11:35:12 UTC 2019


Tom & Thomas,

> On 14.02.2019, at 08:56, Thomas Petazzoni <thomas.petazzoni at bootlin.com> wrote:
> 
> However, generally speaking is U-Boot interested in allowing this kind
> of C99 variable declaration ? For example, the Linux kernel coding
> style doesn't allow this, but perhaps U-Boot has made a difference
> choice here.


I took the opportunity to see how widespread the use of this style already
is in U-Boot (as it will eventually creep in, now that we’ve moved to GCC6
or newer) and there’s only a few occurences to date:

board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; i < NR_CPUS; i++) {
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; i < NR_CPUS; i++) {
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; i < NR_CPUS; i++) {
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; map[i].env_name; i++)
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; map[i].env_name; i++)
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; map[i].env_name; i++) {
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; map[i].env_name; i++) {
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; map[i].env_name; i++) {
board/synopsys/hsdk/env-lib.c:	for (u32 i = 0; map[i].env_name; i++) {
board/synopsys/hsdk/hsdk.c:	for (u32 i = 0; i < NR_CPUS; i++) {
board/synopsys/hsdk/hsdk.c:	for (u32 i = 0; i < NR_CPUS; i++) {
board/synopsys/hsdk/hsdk.c:	for (u32 i = 0; i < NR_CPUS; i++) {
board/synopsys/hsdk/hsdk.c:	for (u32 i = 0; i < NR_CPUS; i++)
board/synopsys/hsdk/hsdk.c:	for (u32 i = MASTER_CPU_ID + 1; i < NR_CPUS; i++)
board/synopsys/hsdk/hsdk.c:	for (u32 i = 0; i < NR_CPUS; i++) {
lib/crc16.c:	for (int i = 0;  i < len;  i++)

Thanks,
Philipp.


More information about the U-Boot mailing list