mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fix compiler warnings: use puts() instead of printf()
@ 2013-02-21  8:31 Fabio Porcedda
  2013-02-21 13:26 ` Sascha Hauer
  2013-02-25 12:02 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 8+ messages in thread
From: Fabio Porcedda @ 2013-02-21  8:31 UTC (permalink / raw)
  To: barebox; +Cc: Vicente

Use puts() because printf() isn't necessary,
to fix the following compiler warnings:

/barebox/common/menu.c: In function ‘menu_show’:
/barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]

/barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
/barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Vicente <vicencb@gmail.com>
---
 common/menu.c           | 2 +-
 scripts/omap4_usbboot.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/menu.c b/common/menu.c
index ce93838..30dced7 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -274,7 +274,7 @@ int menu_show(struct menu *m)
 			printf("Auto Select in");
 		} else {
 			auto_display_len = strlen(m->auto_display);
-			printf(m->auto_display);
+			puts(m->auto_display);
 		}
 		printf(" %2d", countdown--);
 	}
diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
index 8c5775d..34e53c0 100644
--- a/scripts/omap4_usbboot.c
+++ b/scripts/omap4_usbboot.c
@@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
 			sprintf(line+4+j*3, "%02X ", id[i+j]);
 		line[4+j*3+0] = '\n';
 		line[4+j*3+1] = 0;
-		printf(line);
+		puts(line);
 	}
 	ret = 0;
 	for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
-- 
1.8.1.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-21  8:31 [PATCH] fix compiler warnings: use puts() instead of printf() Fabio Porcedda
@ 2013-02-21 13:26 ` Sascha Hauer
  2013-02-25 12:02 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2013-02-21 13:26 UTC (permalink / raw)
  To: Fabio Porcedda; +Cc: barebox, Vicente

On Thu, Feb 21, 2013 at 09:31:54AM +0100, Fabio Porcedda wrote:
> Use puts() because printf() isn't necessary,
> to fix the following compiler warnings:
> 
> /barebox/common/menu.c: In function ‘menu_show’:
> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
> 
> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Vicente <vicencb@gmail.com>

Applied, thanks

Sascha

> ---
>  common/menu.c           | 2 +-
>  scripts/omap4_usbboot.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/menu.c b/common/menu.c
> index ce93838..30dced7 100644
> --- a/common/menu.c
> +++ b/common/menu.c
> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
>  			printf("Auto Select in");
>  		} else {
>  			auto_display_len = strlen(m->auto_display);
> -			printf(m->auto_display);
> +			puts(m->auto_display);
>  		}
>  		printf(" %2d", countdown--);
>  	}
> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
> index 8c5775d..34e53c0 100644
> --- a/scripts/omap4_usbboot.c
> +++ b/scripts/omap4_usbboot.c
> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
>  			sprintf(line+4+j*3, "%02X ", id[i+j]);
>  		line[4+j*3+0] = '\n';
>  		line[4+j*3+1] = 0;
> -		printf(line);
> +		puts(line);
>  	}
>  	ret = 0;
>  	for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
> -- 
> 1.8.1.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-21  8:31 [PATCH] fix compiler warnings: use puts() instead of printf() Fabio Porcedda
  2013-02-21 13:26 ` Sascha Hauer
@ 2013-02-25 12:02 ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-25 12:23   ` Fabio Porcedda
  1 sibling, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-25 12:02 UTC (permalink / raw)
  To: Fabio Porcedda; +Cc: barebox, Vicente

On 09:31 Thu 21 Feb     , Fabio Porcedda wrote:
> Use puts() because printf() isn't necessary,
> to fix the following compiler warnings:
> 
> /barebox/common/menu.c: In function ‘menu_show’:
> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
> 
> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]

Sascha revert this please this add a "\n" that we do not want
specially on the menu

Best Regards,
J.
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Vicente <vicencb@gmail.com>
> ---
>  common/menu.c           | 2 +-
>  scripts/omap4_usbboot.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/menu.c b/common/menu.c
> index ce93838..30dced7 100644
> --- a/common/menu.c
> +++ b/common/menu.c
> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
>  			printf("Auto Select in");
>  		} else {
>  			auto_display_len = strlen(m->auto_display);
> -			printf(m->auto_display);
> +			puts(m->auto_display);
>  		}
>  		printf(" %2d", countdown--);
>  	}
> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
> index 8c5775d..34e53c0 100644
> --- a/scripts/omap4_usbboot.c
> +++ b/scripts/omap4_usbboot.c
> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
>  			sprintf(line+4+j*3, "%02X ", id[i+j]);
>  		line[4+j*3+0] = '\n';
>  		line[4+j*3+1] = 0;
> -		printf(line);
> +		puts(line);
>  	}
>  	ret = 0;
>  	for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
> -- 
> 1.8.1.1
> 

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-25 12:02 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-25 12:23   ` Fabio Porcedda
  2013-02-25 13:16     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Porcedda @ 2013-02-25 12:23 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Vicente

On Mon, Feb 25, 2013 at 1:02 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 09:31 Thu 21 Feb     , Fabio Porcedda wrote:
>> Use puts() because printf() isn't necessary,
>> to fix the following compiler warnings:
>>
>> /barebox/common/menu.c: In function ‘menu_show’:
>> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
>>
>> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
>> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
>
> Sascha revert this please this add a "\n" that we do not want
> specially on the menu

I've already sent a patch to fix the newline problem and the warning too.
Reverting the patch doesn't fix the warning.

Best regards
Fabio Porcedda

> Best Regards,
> J.
>>
>> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
>> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> Cc: Vicente <vicencb@gmail.com>
>> ---
>>  common/menu.c           | 2 +-
>>  scripts/omap4_usbboot.c | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/menu.c b/common/menu.c
>> index ce93838..30dced7 100644
>> --- a/common/menu.c
>> +++ b/common/menu.c
>> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
>>                       printf("Auto Select in");
>>               } else {
>>                       auto_display_len = strlen(m->auto_display);
>> -                     printf(m->auto_display);
>> +                     puts(m->auto_display);
>>               }
>>               printf(" %2d", countdown--);
>>       }
>> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
>> index 8c5775d..34e53c0 100644
>> --- a/scripts/omap4_usbboot.c
>> +++ b/scripts/omap4_usbboot.c
>> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
>>                       sprintf(line+4+j*3, "%02X ", id[i+j]);
>>               line[4+j*3+0] = '\n';
>>               line[4+j*3+1] = 0;
>> -             printf(line);
>> +             puts(line);
>>       }
>>       ret = 0;
>>       for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
>> --
>> 1.8.1.1
>>



-- 
Fabio Porcedda

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-25 12:23   ` Fabio Porcedda
@ 2013-02-25 13:16     ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-25 15:27       ` Fabio Porcedda
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-25 13:16 UTC (permalink / raw)
  To: Fabio Porcedda; +Cc: barebox, Vicente

On 13:23 Mon 25 Feb     , Fabio Porcedda wrote:
> On Mon, Feb 25, 2013 at 1:02 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 09:31 Thu 21 Feb     , Fabio Porcedda wrote:
> >> Use puts() because printf() isn't necessary,
> >> to fix the following compiler warnings:
> >>
> >> /barebox/common/menu.c: In function ‘menu_show’:
> >> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
> >>
> >> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
> >> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
> >
> > Sascha revert this please this add a "\n" that we do not want
> > specially on the menu
> 
> I've already sent a patch to fix the newline problem and the warning too.
> Reverting the patch doesn't fix the warning.
the patch is wrong we revert you send the write one

Best Regards,
J.
> 
> Best regards
> Fabio Porcedda
> 
> > Best Regards,
> > J.
> >>
> >> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> >> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> Cc: Vicente <vicencb@gmail.com>
> >> ---
> >>  common/menu.c           | 2 +-
> >>  scripts/omap4_usbboot.c | 2 +-
> >>  2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/common/menu.c b/common/menu.c
> >> index ce93838..30dced7 100644
> >> --- a/common/menu.c
> >> +++ b/common/menu.c
> >> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
> >>                       printf("Auto Select in");
> >>               } else {
> >>                       auto_display_len = strlen(m->auto_display);
> >> -                     printf(m->auto_display);
> >> +                     puts(m->auto_display);
> >>               }
> >>               printf(" %2d", countdown--);
> >>       }
> >> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
> >> index 8c5775d..34e53c0 100644
> >> --- a/scripts/omap4_usbboot.c
> >> +++ b/scripts/omap4_usbboot.c
> >> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
> >>                       sprintf(line+4+j*3, "%02X ", id[i+j]);
> >>               line[4+j*3+0] = '\n';
> >>               line[4+j*3+1] = 0;
> >> -             printf(line);
> >> +             puts(line);
> >>       }
> >>       ret = 0;
> >>       for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
> >> --
> >> 1.8.1.1
> >>
> 
> 
> 
> -- 
> Fabio Porcedda

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-25 13:16     ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-25 15:27       ` Fabio Porcedda
  2013-02-25 17:21         ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Porcedda @ 2013-02-25 15:27 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Vicente

On Mon, Feb 25, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 13:23 Mon 25 Feb     , Fabio Porcedda wrote:
>> On Mon, Feb 25, 2013 at 1:02 PM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>> > On 09:31 Thu 21 Feb     , Fabio Porcedda wrote:
>> >> Use puts() because printf() isn't necessary,
>> >> to fix the following compiler warnings:
>> >>
>> >> /barebox/common/menu.c: In function ‘menu_show’:
>> >> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
>> >>
>> >> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
>> >> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
>> >
>> > Sascha revert this please this add a "\n" that we do not want
>> > specially on the menu
>>
>> I've already sent a patch to fix the newline problem and the warning too.
>> Reverting the patch doesn't fix the warning.
> the patch is wrong we revert you send the write one

I understand that the patch is wrong but the patch cannot be simply
reverted because in master there is already a partial fix for it:
"OMAP4 USB BOOT: remove double line endings".

Only half of the patch can be reverted but instead of reverting it we
can fix it.
I've already sent the patch to fix the remaining part:
" menu: fix remove superfluous newline: change puts() -> printf("%s, )"

What do you think about that patch?

Best regards
Fabio Porcedda

> Best Regards,
> J.
>>
>> Best regards
>> Fabio Porcedda
>>
>> > Best Regards,
>> > J.
>> >>
>> >> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
>> >> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> >> Cc: Vicente <vicencb@gmail.com>
>> >> ---
>> >>  common/menu.c           | 2 +-
>> >>  scripts/omap4_usbboot.c | 2 +-
>> >>  2 files changed, 2 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/common/menu.c b/common/menu.c
>> >> index ce93838..30dced7 100644
>> >> --- a/common/menu.c
>> >> +++ b/common/menu.c
>> >> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
>> >>                       printf("Auto Select in");
>> >>               } else {
>> >>                       auto_display_len = strlen(m->auto_display);
>> >> -                     printf(m->auto_display);
>> >> +                     puts(m->auto_display);
>> >>               }
>> >>               printf(" %2d", countdown--);
>> >>       }
>> >> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
>> >> index 8c5775d..34e53c0 100644
>> >> --- a/scripts/omap4_usbboot.c
>> >> +++ b/scripts/omap4_usbboot.c
>> >> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
>> >>                       sprintf(line+4+j*3, "%02X ", id[i+j]);
>> >>               line[4+j*3+0] = '\n';
>> >>               line[4+j*3+1] = 0;
>> >> -             printf(line);
>> >> +             puts(line);
>> >>       }
>> >>       ret = 0;
>> >>       for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
>> >> --
>> >> 1.8.1.1
>> >>
>>
>>
>>
>> --
>> Fabio Porcedda



--
Fabio Porcedda

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-25 15:27       ` Fabio Porcedda
@ 2013-02-25 17:21         ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-25 17:38           ` Fabio Porcedda
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-25 17:21 UTC (permalink / raw)
  To: Fabio Porcedda; +Cc: barebox, Vicente

On 16:27 Mon 25 Feb     , Fabio Porcedda wrote:
> On Mon, Feb 25, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 13:23 Mon 25 Feb     , Fabio Porcedda wrote:
> >> On Mon, Feb 25, 2013 at 1:02 PM, Jean-Christophe PLAGNIOL-VILLARD
> >> <plagnioj@jcrosoft.com> wrote:
> >> > On 09:31 Thu 21 Feb     , Fabio Porcedda wrote:
> >> >> Use puts() because printf() isn't necessary,
> >> >> to fix the following compiler warnings:
> >> >>
> >> >> /barebox/common/menu.c: In function ‘menu_show’:
> >> >> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
> >> >>
> >> >> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
> >> >> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
> >> >
> >> > Sascha revert this please this add a "\n" that we do not want
> >> > specially on the menu
> >>
> >> I've already sent a patch to fix the newline problem and the warning too.
> >> Reverting the patch doesn't fix the warning.
> > the patch is wrong we revert you send the write one
> 
> I understand that the patch is wrong but the patch cannot be simply
> reverted because in master there is already a partial fix for it:
> "OMAP4 USB BOOT: remove double line endings".
> 
> Only half of the patch can be reverted but instead of reverting it we
> can fix it.
> I've already sent the patch to fix the remaining part:
> " menu: fix remove superfluous newline: change puts() -> printf("%s, )"
> 
> What do you think about that patch?

I'm sorry NACK this break git bisect not acceptable

for just warnings

Best Regards,
J.
> 
> Best regards
> Fabio Porcedda
> 
> > Best Regards,
> > J.
> >>
> >> Best regards
> >> Fabio Porcedda
> >>
> >> > Best Regards,
> >> > J.
> >> >>
> >> >> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> >> >> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> >> Cc: Vicente <vicencb@gmail.com>
> >> >> ---
> >> >>  common/menu.c           | 2 +-
> >> >>  scripts/omap4_usbboot.c | 2 +-
> >> >>  2 files changed, 2 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/common/menu.c b/common/menu.c
> >> >> index ce93838..30dced7 100644
> >> >> --- a/common/menu.c
> >> >> +++ b/common/menu.c
> >> >> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
> >> >>                       printf("Auto Select in");
> >> >>               } else {
> >> >>                       auto_display_len = strlen(m->auto_display);
> >> >> -                     printf(m->auto_display);
> >> >> +                     puts(m->auto_display);
> >> >>               }
> >> >>               printf(" %2d", countdown--);
> >> >>       }
> >> >> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
> >> >> index 8c5775d..34e53c0 100644
> >> >> --- a/scripts/omap4_usbboot.c
> >> >> +++ b/scripts/omap4_usbboot.c
> >> >> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
> >> >>                       sprintf(line+4+j*3, "%02X ", id[i+j]);
> >> >>               line[4+j*3+0] = '\n';
> >> >>               line[4+j*3+1] = 0;
> >> >> -             printf(line);
> >> >> +             puts(line);
> >> >>       }
> >> >>       ret = 0;
> >> >>       for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
> >> >> --
> >> >> 1.8.1.1
> >> >>
> >>
> >>
> >>
> >> --
> >> Fabio Porcedda
> 
> 
> 
> --
> Fabio Porcedda

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix compiler warnings: use puts() instead of printf()
  2013-02-25 17:21         ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-25 17:38           ` Fabio Porcedda
  0 siblings, 0 replies; 8+ messages in thread
From: Fabio Porcedda @ 2013-02-25 17:38 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Vicente

On Mon, Feb 25, 2013 at 6:21 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 16:27 Mon 25 Feb     , Fabio Porcedda wrote:
>> On Mon, Feb 25, 2013 at 2:16 PM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>> > On 13:23 Mon 25 Feb     , Fabio Porcedda wrote:
>> >> On Mon, Feb 25, 2013 at 1:02 PM, Jean-Christophe PLAGNIOL-VILLARD
>> >> <plagnioj@jcrosoft.com> wrote:
>> >> > On 09:31 Thu 21 Feb     , Fabio Porcedda wrote:
>> >> >> Use puts() because printf() isn't necessary,
>> >> >> to fix the following compiler warnings:
>> >> >>
>> >> >> /barebox/common/menu.c: In function ‘menu_show’:
>> >> >> /barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
>> >> >>
>> >> >> /barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
>> >> >> /barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
>> >> >
>> >> > Sascha revert this please this add a "\n" that we do not want
>> >> > specially on the menu
>> >>
>> >> I've already sent a patch to fix the newline problem and the warning too.
>> >> Reverting the patch doesn't fix the warning.
>> > the patch is wrong we revert you send the write one
>>
>> I understand that the patch is wrong but the patch cannot be simply
>> reverted because in master there is already a partial fix for it:
>> "OMAP4 USB BOOT: remove double line endings".
>>
>> Only half of the patch can be reverted but instead of reverting it we
>> can fix it.
>> I've already sent the patch to fix the remaining part:
>> " menu: fix remove superfluous newline: change puts() -> printf("%s, )"
>>
>> What do you think about that patch?
>
> I'm sorry NACK this break git bisect not acceptable
>
> for just warnings

You are right but the patch is already in branch master:
http://git.pengutronix.de/?p=barebox.git;a=commit;h=638f91bd166fe4aa8ee7c046c6102dab6d44ee0b

Only a git rebase -i can change that, but a rebase is not good for master.

Best regards
Fabio Porcedda

> Best Regards,
> J.
>>
>> Best regards
>> Fabio Porcedda
>>
>> > Best Regards,
>> > J.
>> >>
>> >> Best regards
>> >> Fabio Porcedda
>> >>
>> >> > Best Regards,
>> >> > J.
>> >> >>
>> >> >> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
>> >> >> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> >> >> Cc: Vicente <vicencb@gmail.com>
>> >> >> ---
>> >> >>  common/menu.c           | 2 +-
>> >> >>  scripts/omap4_usbboot.c | 2 +-
>> >> >>  2 files changed, 2 insertions(+), 2 deletions(-)
>> >> >>
>> >> >> diff --git a/common/menu.c b/common/menu.c
>> >> >> index ce93838..30dced7 100644
>> >> >> --- a/common/menu.c
>> >> >> +++ b/common/menu.c
>> >> >> @@ -274,7 +274,7 @@ int menu_show(struct menu *m)
>> >> >>                       printf("Auto Select in");
>> >> >>               } else {
>> >> >>                       auto_display_len = strlen(m->auto_display);
>> >> >> -                     printf(m->auto_display);
>> >> >> +                     puts(m->auto_display);
>> >> >>               }
>> >> >>               printf(" %2d", countdown--);
>> >> >>       }
>> >> >> diff --git a/scripts/omap4_usbboot.c b/scripts/omap4_usbboot.c
>> >> >> index 8c5775d..34e53c0 100644
>> >> >> --- a/scripts/omap4_usbboot.c
>> >> >> +++ b/scripts/omap4_usbboot.c
>> >> >> @@ -98,7 +98,7 @@ int read_asic_id(struct usb_handle *usb)
>> >> >>                       sprintf(line+4+j*3, "%02X ", id[i+j]);
>> >> >>               line[4+j*3+0] = '\n';
>> >> >>               line[4+j*3+1] = 0;
>> >> >> -             printf(line);
>> >> >> +             puts(line);
>> >> >>       }
>> >> >>       ret = 0;
>> >> >>       for (i = 1, j = 0; i < sizeof(id) && j < id[0]; i += 2+id[i+1], j++) {
>> >> >> --
>> >> >> 1.8.1.1
>> >> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Fabio Porcedda
>>
>>
>>
>> --
>> Fabio Porcedda



--
Fabio Porcedda

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-25 17:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-21  8:31 [PATCH] fix compiler warnings: use puts() instead of printf() Fabio Porcedda
2013-02-21 13:26 ` Sascha Hauer
2013-02-25 12:02 ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-25 12:23   ` Fabio Porcedda
2013-02-25 13:16     ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-25 15:27       ` Fabio Porcedda
2013-02-25 17:21         ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-25 17:38           ` Fabio Porcedda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox