From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Sat, 27 Aug 2016 03:18:06 +0000 Subject: Re: [PATCH] mx3fb: Fix print format string Message-Id: <1472267886.26978.3.camel@perches.com> List-Id: References: <1472267137-810445-1-git-send-email-green@linuxhacker.ru> In-Reply-To: <1472267137-810445-1-git-send-email-green@linuxhacker.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Oleg Drokin , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "Luis R. Rodriguez" Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org 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. >=20 > 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) > =A0 if (fbi->var.sync & FB_SYNC_SHARP_MODE) > =A0 mode =3D IPU_PANEL_SHARP_TFT; > =A0 > - dev_dbg(fbi->device, "pixclock =3D %ul Hz\n", > + dev_dbg(fbi->device, "pixclock =3D %u Hz\n", > =A0 (u32) (PICOS2KHZ(fbi->var.pixclock) * 1000UL)); > =A0 > =A0 if (sdc_init_panel(mx3fb, mode, From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755003AbcH0DSM (ORCPT ); Fri, 26 Aug 2016 23:18:12 -0400 Received: from smtprelay0155.hostedemail.com ([216.40.44.155]:42638 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754832AbcH0DSL (ORCPT ); Fri, 26 Aug 2016 23:18:11 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:857:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3872:4321:5007:6117:6119:7974:10004:10400:10848:11026:11232:11473:11658:11914:12048:12296:12740:13069:13311:13357:13439:13894:14181:14659:14721:21080:21325:30054:30056:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: sense75_815445f216942 X-Filterd-Recvd-Size: 1904 Message-ID: <1472267886.26978.3.camel@perches.com> Subject: Re: [PATCH] mx3fb: Fix print format string From: Joe Perches To: Oleg Drokin , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "Luis R. Rodriguez" Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 26 Aug 2016 20:18:06 -0700 In-Reply-To: <1472267137-810445-1-git-send-email-green@linuxhacker.ru> References: <1472267137-810445-1-git-send-email-green@linuxhacker.ru> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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,