From patchwork Thu May 10 15:45:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 10392029 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 3D69C60353 for ; Thu, 10 May 2018 15:55:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DF9528C2F for ; Thu, 10 May 2018 15:55:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21FA828C3A; Thu, 10 May 2018 15:55:54 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA34E28C2F for ; Thu, 10 May 2018 15:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965537AbeEJPzx (ORCPT ); Thu, 10 May 2018 11:55:53 -0400 Received: from smtprelay0028.hostedemail.com ([216.40.44.28]:43517 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965033AbeEJPzw (ORCPT ); Thu, 10 May 2018 11:55:52 -0400 Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave06.hostedemail.com (Postfix) with ESMTP id 2181E800433B for ; Thu, 10 May 2018 15:46:28 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 3FC81180A8CBF; Thu, 10 May 2018 15:46:25 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: snow87_1ac3b99d23622 X-Filterd-Recvd-Size: 4834 Received: from joe-laptop.perches.com (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA; Thu, 10 May 2018 15:46:23 +0000 (UTC) From: Joe Perches To: Matt Mackall , Herbert Xu , "Theodore Ts'o" , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/18] random: Remove pr_fmt duplicate logging prefixes Date: Thu, 10 May 2018 08:45:34 -0700 Message-Id: <25a039fce9e2f58d05f976ea32b7415085d35b57.1525964385.git.joe@perches.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Converting pr_fmt from a simple define to use KBUILD_MODNAME added some duplicate logging prefixes to existing uses. Remove them. Signed-off-by: Joe Perches --- drivers/char/hw_random/via-rng.c | 10 +++++----- drivers/char/random.c | 16 +++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c index ffe9b0c6c647..b9367e055468 100644 --- a/drivers/char/hw_random/via-rng.c +++ b/drivers/char/hw_random/via-rng.c @@ -24,6 +24,8 @@ * warranty of any kind, whether express or implied. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -137,8 +139,7 @@ static int via_rng_init(struct hwrng *rng) * register */ if (((c->x86 == 6) && (c->x86_model >= 0x0f)) || (c->x86 > 6)){ if (!boot_cpu_has(X86_FEATURE_XSTORE_EN)) { - pr_err(PFX "can't enable hardware RNG " - "if XSTORE is not enabled\n"); + pr_err("can't enable hardware RNG if XSTORE is not enabled\n"); return -ENODEV; } return 0; @@ -176,7 +177,7 @@ static int via_rng_init(struct hwrng *rng) unneeded */ rdmsr(MSR_VIA_RNG, lo, hi); if ((lo & VIA_RNG_ENABLE) == 0) { - pr_err(PFX "cannot enable VIA C3 RNG, aborting\n"); + pr_err("cannot enable VIA C3 RNG, aborting\n"); return -ENODEV; } @@ -202,8 +203,7 @@ static int __init mod_init(void) pr_info("VIA RNG detected\n"); err = hwrng_register(&via_rng); if (err) { - pr_err(PFX "RNG registering failed (%d)\n", - err); + pr_err("RNG registering failed (%d)\n", err); goto out; } out: diff --git a/drivers/char/random.c b/drivers/char/random.c index cd888d4ee605..d1e35cfcce8e 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -693,7 +693,7 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits) } if (unlikely(entropy_count < 0)) { - pr_warn("random: negative entropy/overflow: pool %s count %d\n", + pr_warn("negative entropy/overflow: pool %s count %d\n", r->name, entropy_count); WARN_ON(1); entropy_count = 0; @@ -857,7 +857,7 @@ static int crng_fast_load(const char *cp, size_t len) invalidate_batched_entropy(); crng_init = 1; wake_up_interruptible(&crng_init_wait); - pr_notice("random: fast init done\n"); + pr_notice("fast init done\n"); } return 1; } @@ -942,16 +942,14 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r) crng_init = 2; process_random_ready_list(); wake_up_interruptible(&crng_init_wait); - pr_notice("random: crng init done\n"); + pr_notice("crng init done\n"); if (unseeded_warning.missed) { - pr_notice("random: %d get_random_xx warning(s) missed " - "due to ratelimiting\n", + pr_notice("%d get_random_xx warning(s) missed due to ratelimiting\n", unseeded_warning.missed); unseeded_warning.missed = 0; } if (urandom_warning.missed) { - pr_notice("random: %d urandom warning(s) missed " - "due to ratelimiting\n", + pr_notice("%d urandom warning(s) missed due to ratelimiting\n", urandom_warning.missed); urandom_warning.missed = 0; } @@ -1380,7 +1378,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min, ibytes = 0; if (unlikely(entropy_count < 0)) { - pr_warn("random: negative entropy count: pool %s count %d\n", + pr_warn("negative entropy count: pool %s count %d\n", r->name, entropy_count); WARN_ON(1); entropy_count = 0; @@ -1596,7 +1594,7 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, print_once = true; #endif if (__ratelimit(&unseeded_warning)) - pr_notice("random: %s called from %pS with crng_init=%d\n", + pr_notice("%s called from %pS with crng_init=%d\n", func_name, caller, crng_init); }