Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1471088

Re: [PATCH] mx3fb: Fix print format string

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mx3fb: Fix print format string
Date 2016-08-27 05:20 +0200
Message-ID <saCk1-7AH-7@gated-at.bofh.it> (permalink)
References <saCam-7xx-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2016-08-26 at 23:05 -0400, Oleg Drokin wrote:
> %ul was probably meant as %lu since the former would print
> an unsigned value and a letter l.
> 
> But in fact the whole value we are printing in u32 anyway, so
> we don't need the format to be long. Therefore just drop the l
> altogether.
[]
> Also do we really need 1000UL specification if we
> cast to u32 anyway? Or should we drop away the cast instead?
> Are pixelclocks over 4GHz possible here?

It's a debugging printk, it doesn't matter much.
Why not use "%u kHz" and drop the "* 1000UL"?

> diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
[]
> @@ -845,7 +845,7 @@ static int __set_par(struct fb_info *fbi, bool lock)
>  		if (fbi->var.sync & FB_SYNC_SHARP_MODE)
>  			mode = IPU_PANEL_SHARP_TFT;
>  
> -		dev_dbg(fbi->device, "pixclock = %ul Hz\n",
> +		dev_dbg(fbi->device, "pixclock = %u Hz\n",
>  			(u32) (PICOS2KHZ(fbi->var.pixclock) * 1000UL));
>  
>  		if (sdc_init_panel(mx3fb, mode,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mx3fb: Fix print format string Oleg Drokin <green@linuxhacker.ru> - 2016-08-27 05:10 +0200
  Re: [PATCH] mx3fb: Fix print format string Joe Perches <joe@perches.com> - 2016-08-27 05:20 +0200
    Re: [PATCH] mx3fb: Fix print format string Oleg Drokin <green@linuxhacker.ru> - 2016-08-27 06:10 +0200
  Re: [PATCH] mx3fb: Fix print format string Tomi Valkeinen <tomi.valkeinen@ti.com> - 2016-08-30 11:00 +0200

csiph-web