From patchwork Wed Feb 18 08:51:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 5842991 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 598D9BF440 for ; Wed, 18 Feb 2015 08:51:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4039520225 for ; Wed, 18 Feb 2015 08:51:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E130F201FE for ; Wed, 18 Feb 2015 08:51:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751562AbbBRIvo (ORCPT ); Wed, 18 Feb 2015 03:51:44 -0500 Received: from smtprelay0087.hostedemail.com ([216.40.44.87]:34590 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751050AbbBRIvn (ORCPT ); Wed, 18 Feb 2015 03:51:43 -0500 Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 2C2BAC2129; Wed, 18 Feb 2015 08:51:42 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::::, RULES_HIT:2:41:69:305:355:379:541:599:857:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1535:1593:1594:1605:1730:1747:1777:1792:1801:2393:2559:2562:2828:3138:3139:3140:3141:3142:3622:3865:3867:3868:3870:3871:3873:4049:4118:4321:4605:5007:6119:6261:7903:8603:10004:10848:11026:11232:11473:11658:11914:12043:12291:12296:12438:12517:12519:12555:12679:12683:12740:13972:21060:21080, 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 X-HE-Tag: beast57_48c9c0fc1703a X-Filterd-Recvd-Size: 7750 Received: from joe-X200MA.home (pool-71-103-235-196.lsanca.fios.verizon.net [71.103.235.196]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Wed, 18 Feb 2015 08:51:40 +0000 (UTC) Message-ID: <1424249497.25416.23.camel@perches.com> Subject: Re: [PATCH 1/3] Printk() is replaced with pr_* respective functions in efifb.c From: Joe Perches To: Parmeshwr Prasad Cc: pjones@redhat.com, plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 18 Feb 2015 00:51:37 -0800 In-Reply-To: <20150218082942.GB9820@linuxteamdev.amer.dell.com> References: <20150218082942.GB9820@linuxteamdev.amer.dell.com> X-Mailer: Evolution 3.12.7-0ubuntu1 Mime-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 2015-02-18 at 03:29 -0500, Parmeshwr Prasad wrote: > This is a trivial patch: > > I have replaced printk() with respective pr_* functions. Hi. A few suggestions: o Add this #define before any include #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt o Strip the embedded "efifb: " prefixes from the formats o Coalesce the formats o Don't change KERN_ uses unnecessarily If you do change logging levels, state why in the change log o Align the multiline arguments > diff --git a/drivers/video/fbdev/efifb.c b/diriveom rrs/video/fbdev/efifb.c [] > @@ -142,10 +142,10 @@ static int efifb_probe(struct platform_device *dev) > if (!screen_info.pages) > screen_info.pages = 1; > if (!screen_info.lfb_base) { > - printk(KERN_DEBUG "efifb: invalid framebuffer address\n"); > + pr_err("efifb: invalid framebuffer address\n"); Strip the "efifb: " prefix from all the pr_ uses pr_err("invalid framebuffer address\n"); > @@ -193,14 +193,14 @@ static int efifb_probe(struct platform_device *dev) > } else { > /* We cannot make this fatal. Sometimes this comes from magic > spaces our resource handlers simply don't know about */ > - printk(KERN_WARNING > + pr_warn( > "efifb: cannot reserve video memory at 0x%lx\n", > efifb_fix.smem_start); Move the format to the same line as pr_warn pr_warn("cannot reserve video memory at 0x%lx\n", > @@ -218,18 +218,18 @@ static int efifb_probe(struct platform_device *dev) > > info->screen_base = ioremap_wc(efifb_fix.smem_start, efifb_fix.smem_len); > if (!info->screen_base) { > - printk(KERN_ERR "efifb: abort, cannot ioremap video memory " > + pr_err("efifb: abort, cannot ioremap video memory " > "0x%x @ 0x%lx\n", > efifb_fix.smem_len, efifb_fix.smem_start); Coalesce the format and align the arguments pr_err("abort, cannot ioremap video memory 0x%x @ 0x%lx\n" efifb_fix.smem_len, efifb_fix.smem_start); You should end up with something like: --- drivers/video/fbdev/efifb.c | 57 +++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 4bfff34..2769bc9 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -6,6 +6,8 @@ * */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -142,10 +144,10 @@ static int efifb_probe(struct platform_device *dev) if (!screen_info.pages) screen_info.pages = 1; if (!screen_info.lfb_base) { - printk(KERN_DEBUG "efifb: invalid framebuffer address\n"); + pr_debug("invalid framebuffer address\n"); return -ENODEV; } - printk(KERN_INFO "efifb: probing for efifb\n"); + pr_info("probing for efifb\n"); /* just assume they're all unset if any are */ if (!screen_info.blue_size) { @@ -193,14 +195,13 @@ static int efifb_probe(struct platform_device *dev) } else { /* We cannot make this fatal. Sometimes this comes from magic spaces our resource handlers simply don't know about */ - printk(KERN_WARNING - "efifb: cannot reserve video memory at 0x%lx\n", + pr_warn("cannot reserve video memory at 0x%lx\n", efifb_fix.smem_start); } info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); if (!info) { - printk(KERN_ERR "efifb: cannot allocate framebuffer\n"); + pr_err("cannot allocate framebuffer\n"); err = -ENOMEM; goto err_release_mem; } @@ -218,26 +219,24 @@ static int efifb_probe(struct platform_device *dev) info->screen_base = ioremap_wc(efifb_fix.smem_start, efifb_fix.smem_len); if (!info->screen_base) { - printk(KERN_ERR "efifb: abort, cannot ioremap video memory " - "0x%x @ 0x%lx\n", - efifb_fix.smem_len, efifb_fix.smem_start); + pr_err("abort, cannot ioremap video memory 0x%x @ 0x%lx\n", + efifb_fix.smem_len, efifb_fix.smem_start); err = -EIO; goto err_release_fb; } - printk(KERN_INFO "efifb: framebuffer at 0x%lx, mapped to 0x%p, " - "using %dk, total %dk\n", - efifb_fix.smem_start, info->screen_base, - size_remap/1024, size_total/1024); - printk(KERN_INFO "efifb: mode is %dx%dx%d, linelength=%d, pages=%d\n", - efifb_defined.xres, efifb_defined.yres, - efifb_defined.bits_per_pixel, efifb_fix.line_length, - screen_info.pages); + pr_info("framebuffer at 0x%lx, mapped to 0x%p, using %dk, total %dk\n", + efifb_fix.smem_start, info->screen_base, + size_remap / 1024, size_total / 1024); + pr_info("mode is %dx%dx%d, linelength=%d, pages=%d\n", + efifb_defined.xres, efifb_defined.yres, + efifb_defined.bits_per_pixel, efifb_fix.line_length, + screen_info.pages); efifb_defined.xres_virtual = efifb_defined.xres; efifb_defined.yres_virtual = efifb_fix.smem_len / efifb_fix.line_length; - printk(KERN_INFO "efifb: scrolling: redraw\n"); + pr_info("scrolling: redraw\n"); efifb_defined.yres_virtual = efifb_defined.yres; /* some dummy values for timing to make fbset happy */ @@ -255,17 +254,15 @@ static int efifb_probe(struct platform_device *dev) efifb_defined.transp.offset = screen_info.rsvd_pos; efifb_defined.transp.length = screen_info.rsvd_size; - printk(KERN_INFO "efifb: %s: " - "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n", - "Truecolor", - screen_info.rsvd_size, - screen_info.red_size, - screen_info.green_size, - screen_info.blue_size, - screen_info.rsvd_pos, - screen_info.red_pos, - screen_info.green_pos, - screen_info.blue_pos); + pr_info("Truecolor: size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n", + screen_info.rsvd_size, + screen_info.red_size, + screen_info.green_size, + screen_info.blue_size, + screen_info.rsvd_pos, + screen_info.red_pos, + screen_info.green_pos, + screen_info.blue_pos); efifb_fix.ypanstep = 0; efifb_fix.ywrapstep = 0; @@ -276,11 +273,11 @@ static int efifb_probe(struct platform_device *dev) info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE; if ((err = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) { - printk(KERN_ERR "efifb: cannot allocate colormap\n"); + pr_err("cannot allocate colormap\n"); goto err_unmap; } if ((err = register_framebuffer(info)) < 0) { - printk(KERN_ERR "efifb: cannot register framebuffer\n"); + pr_err("cannot register framebuffer\n"); goto err_fb_dealoc; } fb_info(info, "%s frame buffer device\n", info->fix.id);