From patchwork Mon Apr 17 19:00:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9684091 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87762601C2 for ; Mon, 17 Apr 2017 19:00:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BDB126E39 for ; Mon, 17 Apr 2017 19:00:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7088028178; Mon, 17 Apr 2017 19:00:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 183AD26E39 for ; Mon, 17 Apr 2017 19:00:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB21B9D437; Mon, 17 Apr 2017 19:00:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DB21B9D437 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DB21B9D437 Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 967EA1F8; Mon, 17 Apr 2017 19:00:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1AED55ED68; Mon, 17 Apr 2017 19:00:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v3HJ0Xrc024128 for ; Mon, 17 Apr 2017 15:00:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 963507D54C; Mon, 17 Apr 2017 19:00:33 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E9707D54E; Mon, 17 Apr 2017 19:00:23 +0000 (UTC) Received: from smtprelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD5A09D509; Mon, 17 Apr 2017 19:00:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BD5A09D509 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=joe@perches.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BD5A09D509 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id A825C351F75; Mon, 17 Apr 2017 19:00:17 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: sheep60_59bac6be24544 X-Filterd-Recvd-Size: 4054 Received: from joe-laptop.perches.com (unknown [47.151.132.55]) (Authenticated sender: joe@perches.com) by omf12.hostedemail.com (Postfix) with ESMTPA; Mon, 17 Apr 2017 19:00:16 +0000 (UTC) From: Joe Perches To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Date: Mon, 17 Apr 2017 12:00:14 -0700 Message-Id: <265c09d8869388ced29b91fcae8d6f936ed2ad13.1492455602.git.joe@perches.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 19:00:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 19:00:21 +0000 (UTC) for IP:'216.40.44.219' DOMAIN:'smtprelay0219.hostedemail.com' HELO:'smtprelay.hostedemail.com' FROM:'joe@perches.com' RCPT:'' X-RedHat-Spam-Score: 0.67 (BAYES_50, DCC_REPUT_13_19, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL) 216.40.44.219 smtprelay0219.hostedemail.com 216.40.44.219 smtprelay0219.hostedemail.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: dm-devel@redhat.com Cc: linux-kernel@vger.kernel.org Subject: [dm-devel] [PATCH] device-mapper: Convert printks to pr_ macros X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 19:00:41 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Using pr_ is the more common logging style. In addition, using the pr_ macros could shrink the kernel image if/when the macros are converted to functions. Miscellanea: o Standardize style and use pr_fmt to prefix the output o Standardize the DMDEBUG and DMDEBUG_LIMIT output prefix Signed-off-by: Joe Perches --- include/linux/device-mapper.h | 81 ++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index b7ab76ed8e11..759a1a0c72dc 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -533,48 +533,51 @@ extern struct ratelimit_state dm_ratelimit_state; #define dm_ratelimit() 0 #endif -#define DMCRIT(f, arg...) \ - printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) - -#define DMERR(f, arg...) \ - printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) -#define DMERR_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ - f "\n", ## arg); \ - } while (0) - -#define DMWARN(f, arg...) \ - printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) -#define DMWARN_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ - f "\n", ## arg); \ - } while (0) - -#define DMINFO(f, arg...) \ - printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) -#define DMINFO_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ - "\n", ## arg); \ - } while (0) +#ifdef pr_fmt +#undef pr_fmt +#endif + +#define pr_fmt(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt + +#define DMCRIT(fmt, ...) \ + pr_crit(fmt "\n", ##__VA_ARGS__) + +#define DMERR(fmt, ...) \ + pr_err(fmt "\n", ##__VA_ARGS__) +#define DMERR_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMERR(fmt, ##__VA_ARGS__); \ +} while (0) + +#define DMWARN(fmt, ...) \ + pr_warn(fmt "\n", ##__VA_ARGS__) +#define DMWARN_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMWARN(fmt, ##__VA_ARGS__); \ +} while (0) + +#define DMINFO(fmt, ...) \ + pr_info(fmt "\n", ##__VA_ARGS__) +#define DMINFO_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMINFO(fmt, ##__VA_ARGS__); \ +} while (0) #ifdef CONFIG_DM_DEBUG -# define DMDEBUG(f, arg...) \ - printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) -# define DMDEBUG_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ - "\n", ## arg); \ - } while (0) +# define DMDEBUG(fmt, ...) \ + printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " fmt "\n", \ + ##__VA_ARGS__) +# define DMDEBUG_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMDEBUG(fmt, ##__VA_ARGS__); \ +} while (0) #else -# define DMDEBUG(f, arg...) do {} while (0) -# define DMDEBUG_LIMIT(f, arg...) do {} while (0) +# define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__) +# define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__) #endif #define DMEMIT(x...) sz += ((sz >= maxlen) ? \