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

Tom Rini trini at konsulko.com
Thu Feb 14 12:22:10 UTC 2019


On Thu, Feb 14, 2019 at 12:35:12PM +0100, Philipp Tomsich wrote:
> 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++)

Well, lets go with the C99 flag instead for v2, thanks again!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190214/23511b55/attachment.sig>


More information about the U-Boot mailing list