* [PATCH] video: fbdev: sis: sis_main.c: Cleaning up wrong type in format string
@ 2014-07-05 13:18 Rickard Strandqvist
2014-07-06 17:36 ` Rickard Strandqvist
0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-07-05 13:18 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Rickard Strandqvist, Jingoo Han,
Daniel Vetter, Joe Perches, Laurent Pinchart, linux-fbdev,
linux-kernel
From: Rickard Strandqvist <rickard.strandqvist@sonymobile.com>
Wrong type in printf format string, requires 'unsigned int'
but the argument type is 'int'
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/video/fbdev/sis/sis_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 22ad028..ab7e5e4 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -237,7 +237,7 @@ static void sisfb_get_vga_mode_from_kernel(void)
if(mydepth = 24) mydepth = 32;
- sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
+ sprintf(mymode, "%ux%ux%d", screen_info.lfb_width,
screen_info.lfb_height,
mydepth);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] video: fbdev: sis: sis_main.c: Cleaning up wrong type in format string
2014-07-05 13:18 [PATCH] video: fbdev: sis: sis_main.c: Cleaning up wrong type in format string Rickard Strandqvist
@ 2014-07-06 17:36 ` Rickard Strandqvist
2014-07-06 17:46 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-07-06 17:36 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter, Joe Perches,
linux-fbdev, linux-kernel
Wrong type in printf format string, requires 'unsigned int'
but the argument type is 'int'
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/video/fbdev/sis/sis_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 22ad028..ab7e5e4 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -237,7 +237,7 @@ static void sisfb_get_vga_mode_from_kernel(void)
if(mydepth = 24) mydepth = 32;
- sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
+ sprintf(mymode, "%ux%ux%d", screen_info.lfb_width,
screen_info.lfb_height,
mydepth);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] video: fbdev: sis: sis_main.c: Cleaning up wrong type in format string
2014-07-06 17:36 ` Rickard Strandqvist
@ 2014-07-06 17:46 ` Joe Perches
0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2014-07-06 17:46 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
Daniel Vetter, linux-fbdev, linux-kernel
On Sun, 2014-07-06 at 19:36 +0200, Rickard Strandqvist wrote:
> Wrong type in printf format string, requires 'unsigned int'
> but the argument type is 'int'
Perhaps it'd be better to change the type of mydepth
to __u16 as that's the type of lfb_depth
> diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
[]
> @@ -237,7 +237,7 @@ static void sisfb_get_vga_mode_from_kernel(void)
>
> if(mydepth = 24) mydepth = 32;
>
> - sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
> + sprintf(mymode, "%ux%ux%d", screen_info.lfb_width,
> screen_info.lfb_height,
> mydepth);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-06 17:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-05 13:18 [PATCH] video: fbdev: sis: sis_main.c: Cleaning up wrong type in format string Rickard Strandqvist
2014-07-06 17:36 ` Rickard Strandqvist
2014-07-06 17:46 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).