Received: by 10.223.185.116 with SMTP id b49csp3842552wrg; Mon, 19 Feb 2018 06:56:51 -0800 (PST) X-Google-Smtp-Source: AH8x224NZnEHAuDhcoqCxSe6H6iIxP2mcWVNZLHIpQrQRu/7LpiTjhHfwLDLpb1i/6gA6gmAaPkB X-Received: by 10.98.150.213 with SMTP id s82mr15011560pfk.10.1519052211258; Mon, 19 Feb 2018 06:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519052211; cv=none; d=google.com; s=arc-20160816; b=yty2LoNmAKcgrp0Ai8gk7SGVRHkdDQ6JlJ1BTMgB9iKzusothCfsxBQaEvY3J9e1ih IePTThil1fjdN2cLgssAWE+k9YM8NfKpFdWC6A1fA9rOXUmVtK0Rd/wDZ8OC5tm5JCBU K/USjoq1KSaixtP1JdwOWCVhucVoLUhtyo9lEtxdax20Ppgu4h3nAMrBpVfDSRLIxdxK 5cgLcBFWN63jdOLeFXm53Mp1dvH3Kz6xbnSDb8fGT7oyeXEMxRFDqdN0FkGEkd6PE9Ja R7IuMndjTAw712MNHhdArH1/Kr9qT0dnh0HI0xMynOiWj1xW/t0yaaAdV5ERDBte0bC1 VuRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ozdROVQdU8hvPLb7e16/Hl5jtvzMV++I7JVPnwPr2Rc=; b=MrwpeemLsYk2UqWNzPONA8NQpoV3UYSvBB+GE5kaJpYkdWMotpE78YAIcAayq35mEi m62MtGGppikP2al8Vh5w4ax4SaD6O9S60UE2jZy4xEcRyhSfBKb3osx3VQ7KkJZroHvS FPTR7DzaCcoy78/krIFwZ7XHu6bWTpfgrcFA3OCbUodlwCSr54cKkqP8TyGMAurFOP+7 pn9QugcIIN2q7gDTg4/HT6/JDUUaIsdZp+Cf868QpOBvFgvQVuFOF6U35S3VOehaQKyP VilWpKHV2A076gapij0QeFJG2c0CojTP1GLv+3+RPqdghKFQKYcMFvWYK3QrxdoGr6Zv c4bQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z78si3922771pfk.374.2018.02.19.06.56.37; Mon, 19 Feb 2018 06:56:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752930AbeBSOza (ORCPT + 99 others); Mon, 19 Feb 2018 09:55:30 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:37146 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbeBSOz3 (ORCPT ); Mon, 19 Feb 2018 09:55:29 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 1A3C420715; Mon, 19 Feb 2018 15:55:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id A4C0820146; Mon, 19 Feb 2018 15:55:16 +0100 (CET) Date: Mon, 19 Feb 2018 15:55:16 +0100 From: Boris Brezillon To: Shreeya Patel Cc: boris.brezillon@free-electrons.com, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, cyrille.pitchen@wedev4u.fr, maximlevitsky@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ezequiel@vanguardiasur.com.ar, outreachy-kernel@googlegroups.com Subject: Re: [PATCH NAND v2] mtd: nand: Replace printk() with appropriate pr_*macro() Message-ID: <20180219155516.7a67fade@bbrezillon> In-Reply-To: <20180219155115.3d9d1bd5@bbrezillon> References: <1519046025-9412-1-git-send-email-shreeya.patel23498@gmail.com> <20180219155115.3d9d1bd5@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oh, and in the subject 'pr_*macro()' -> 'pr_*() macro' On Mon, 19 Feb 2018 15:51:15 +0100 Boris Brezillon wrote: > Hi Shreeya, > > On Mon, 19 Feb 2018 18:43:45 +0530 > Shreeya Patel wrote: > > > The log levels embedded with the name are more concise than > > printk. > > Replace printks having a log level with the appropriate > > pr_*macro. > > > > Signed-off-by: Shreeya Patel > > --- > > > > Changes in v2: > > -Merge previous patches of the patchset regarding replacement > > of printk with pr_*macro, into single patch. > > > > > > drivers/mtd/nand/cs553x_nand.c | 9 ++--- > > drivers/mtd/nand/diskonchip.c | 76 +++++++++++++++++++++------------------- > > drivers/mtd/nand/fsl_elbc_nand.c | 2 +- > > drivers/mtd/nand/fsl_ifc_nand.c | 2 +- > > drivers/mtd/nand/mxc_nand.c | 2 +- > > drivers/mtd/nand/nand_bch.c | 12 +++---- > > drivers/mtd/nand/nandsim.c | 10 +++--- > > drivers/mtd/nand/r852.c | 2 +- > > drivers/mtd/nand/r852.h | 6 ++-- > > drivers/mtd/nand/sm_common.c | 5 ++- > > 10 files changed, 65 insertions(+), 61 deletions(-) > > > > [...] > > > > > diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c > > index c3aa53c..b97d88c 100644 > > --- a/drivers/mtd/nand/diskonchip.c > > +++ b/drivers/mtd/nand/diskonchip.c > > [...] > > > @@ -438,7 +438,7 @@ static void __init doc2000_count_chips(struct mtd_info *mtd) > > break; > > } > > doc->chips_per_floor = i; > > - printk(KERN_DEBUG "Detected %d chips per floor.\n", i); > > + pr_info("Detected %d chips per floor.\n", i); > > Should be pr_debug() here. > > > } > > > > [...] > > > diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c > > index 246b439..4e5f817 100644 > > --- a/drivers/mtd/nand/nandsim.c > > +++ b/drivers/mtd/nand/nandsim.c > > @@ -184,15 +184,15 @@ MODULE_PARM_DESC(bch, "Enable BCH ecc and set how many bits should " > > > > /* Simulator's output macros (logging, debugging, warning, error) */ > > #define NS_LOG(args...) \ > > - do { if (log) printk(KERN_DEBUG NS_OUTPUT_PREFIX " log: " args); } while(0) > > + do { if (log) pr_debug(NS_OUTPUT_PREFIX " log: " args); } while(0) > > You could define pr_fmt() to avoid passing NS_OUTPUT_PREFIX. Something > like: > > #define pr_fmt(fmt) "[nandsim]" fmt > > (remember to put this definition before include directives). > > Then, all you have to do is > > do { if (log) pr_debug(" log: " args); } while(0) > > > #define NS_DBG(args...) \ > > - do { if (dbg) printk(KERN_DEBUG NS_OUTPUT_PREFIX " debug: " args); } while(0) > > + do { if (dbg) pr_debug(NS_OUTPUT_PREFIX " debug: " args); } while(0) > > #define NS_WARN(args...) \ > > - do { printk(KERN_WARNING NS_OUTPUT_PREFIX " warning: " args); } while(0) > > + do { pr_warn(NS_OUTPUT_PREFIX " warning: " args); } while(0) > > #define NS_ERR(args...) \ > > - do { printk(KERN_ERR NS_OUTPUT_PREFIX " error: " args); } while(0) > > + do { pr_err(NS_OUTPUT_PREFIX " error: " args); } while(0) > > #define NS_INFO(args...) \ > > - do { printk(KERN_INFO NS_OUTPUT_PREFIX " " args); } while(0) > > + do { pr_info(NS_OUTPUT_PREFIX " " args); } while(0) > > > > /* Busy-wait delay macros (microseconds, milliseconds) */ > > #define NS_UDELAY(us) \ > > diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c > > index fc9287a..3d54c6a 100644 > > --- a/drivers/mtd/nand/r852.c > > +++ b/drivers/mtd/nand/r852.c > > @@ -935,7 +935,7 @@ static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) > > &dev->card_detect_work, 0); > > > > > > - printk(KERN_NOTICE DRV_NAME ": driver loaded successfully\n"); > > + pr_notice(DRV_NAME ": driver loaded successfully\n"); > > Same here: > > #define pr_fmt(fmt) DRV_NAME fmt > > > return 0; > > > > error10: > > diff --git a/drivers/mtd/nand/r852.h b/drivers/mtd/nand/r852.h > > index 8713c57..63de9b6 100644 > > --- a/drivers/mtd/nand/r852.h > > +++ b/drivers/mtd/nand/r852.h > > @@ -149,12 +149,12 @@ struct r852_device { > > > > #define dbg(format, ...) \ > > if (debug) \ > > - printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__) > > + pr_debug(DRV_NAME ": " format "\n", ## __VA_ARGS__) > > > > #define dbg_verbose(format, ...) \ > > if (debug > 1) \ > > - printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__) > > + pr_debug(DRV_NAME ": " format "\n", ## __VA_ARGS__) > > > > And here as well. > > Regards, > > Boris > -- Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com