Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: Joe Perches <joe@perches.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	"Luis R. Rodriguez" <mcgrof@suse.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mx3fb: Fix print format string
Date: Sat, 27 Aug 2016 03:28:35 +0000	[thread overview]
Message-ID: <19CCD264-3BFB-4F06-8360-2A05AE628013@linuxhacker.ru> (raw)
In-Reply-To: <1472267886.26978.3.camel@perches.com>


On Aug 26, 2016, at 11:18 PM, Joe Perches wrote:

> 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"?

I have no strong opinion on this since it's not my debugging code.

But XXX000l Hz makes zero sense either way.

>> 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,
>>                                    (PICOS2KHZ(fbi->var.pixclock)) * 1000UL,

I guess it's printed like that to match sdc_init_panel argument exactly?


  reply	other threads:[~2016-08-27  3:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27  3:05 [PATCH] mx3fb: Fix print format string Oleg Drokin
2016-08-27  3:18 ` Joe Perches
2016-08-27  3:28   ` Oleg Drokin [this message]
2016-08-30  8:57 ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19CCD264-3BFB-4F06-8360-2A05AE628013@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=joe@perches.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox