Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6046437iog; Thu, 23 Jun 2022 10:11:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1saN1ZFjTFBIGFSMXSzi+FqSaJrTDU2+JJN1XG/6bpnJ7wamiopQEa8liW+HG6+kCLeGaX1 X-Received: by 2002:a17:906:5305:b0:712:388c:2bf5 with SMTP id h5-20020a170906530500b00712388c2bf5mr9405756ejo.559.1656004319067; Thu, 23 Jun 2022 10:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656004319; cv=none; d=google.com; s=arc-20160816; b=dBvCFgEGg2bKRPgUWqZyL7cAuVuR927EtE/x8LSzjpGat6J0Hi17PDzr8lEa819SiH POwKMRdCTtxKsknZBFjRhMibqy9LvewP7Ye3PZq9XU6zazndyA7MzGGDOPNmp8j3Fc+j zGI4EUkT6vr/PONLRPA4Q6poty53paEJSqaqSfLi+l1kXslH/r8X7MdrAfpg6BGC6/Le NFp3rJbXKyuCUbQ+/H3Z4yhkRdSfjoY8sfq933iOlR13I299oP5rublR4MAcEnHx5ocm JuGhzf3CY2PRoJktV9nnv2eg603Q3gen+chGsDawVWl82PxbtaAPnkgyUu8fwA1dWWI0 nLKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=baTe7odor2da2iOak67GMoxfJBstI6cOyZSrZqI24sU=; b=0P0OGTBJAXG8pm+ntmrP5hEdbIsDKtuElKYG0ZPuZTg2AE/o4jEMRvtavtii/mv/nm 2xEt4+h5mj930AZzYVdN0xfKKN/Zx2f50r0vPEt3HShgCrU1Ngx/Rh6y2ocDeXrX8WeN 9RmBZwzA8wPV4xR5Rj0Z8SWa5o3ZM7z94Sw4MbmMK4ytOIP4Fg3+ot/Ljhnv8EJggROx zDo9jxjwWZPmy6SwLpH6+VauWjeOID8XJZKt3EMtUqr5nR2H1V0rQqLO8l8sx7IUoSMx Wz2KHi6qGrmqKYDbw3DDkDBlAdABYwpz5PGnL8gdJDf+QevI99lOFfVlAF9CHRownZoA AURQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bdlAYi3q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z18-20020a17090674d200b00722eb684a60si6610116ejl.979.2022.06.23.10.11.34; Thu, 23 Jun 2022 10:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bdlAYi3q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbiFWQ71 (ORCPT + 99 others); Thu, 23 Jun 2022 12:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233225AbiFWQuf (ORCPT ); Thu, 23 Jun 2022 12:50:35 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDCCE4EF66; Thu, 23 Jun 2022 09:48:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 58900CE25DE; Thu, 23 Jun 2022 16:48:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AD0FC3411B; Thu, 23 Jun 2022 16:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656002903; bh=dwgis79Iq3XDBqEKp85Jnr1FviUanhT9HG3BccEBB6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdlAYi3qGwkS2cJgfoyswnwLJ1nYBPkAJXjxzu4YjYTAzDfsdX4K2nftvv/WSWVcr SnYdlJWhX9WrzyFFeap1Je66hYGJeL+c84Bby7IwOOuQYQopD5ac02le5cIT7GwmkG OqdDzqFQnUqBDb5EWrKPFoecycyQtIotsS/6kmQg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yangtao Li , Theodore Tso , "Jason A. Donenfeld" Subject: [PATCH 4.9 064/264] random: Add and use pr_fmt() Date: Thu, 23 Jun 2022 18:40:57 +0200 Message-Id: <20220623164345.883111393@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yangtao Li commit 12cd53aff5ea0359b1dac91fcd9ddc7b9e646588 upstream. Prefix all printk/pr_ messages with "random: " to make the logging a bit more consistent. Miscellanea: o Convert a printks to pr_notice o Whitespace to align to open parentheses o Remove embedded "random: " from pr_* as pr_fmt adds it Signed-off-by: Yangtao Li Link: https://lore.kernel.org/r/20190607182517.28266-3-tiny.windzz@gmail.com Signed-off-by: Theodore Ts'o Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -307,6 +307,8 @@ * Eastlake, Steve Crocker, and Jeff Schiller. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -740,7 +742,7 @@ retry: } if (WARN_ON(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); entropy_count = 0; } else if (entropy_count > pool_size) @@ -833,7 +835,7 @@ static void crng_initialize(struct crng_ } if (trust_cpu && arch_init) { crng_init = 2; - pr_notice("random: crng done (trusting CPU's manufacturer)\n"); + pr_notice("crng done (trusting CPU's manufacturer)\n"); } crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1; } @@ -857,14 +859,12 @@ static void crng_finalize_init(struct cr kill_fasync(&fasync, SIGIO, POLL_IN); 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; } @@ -945,7 +945,7 @@ static int crng_fast_load(const char *cp if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) { invalidate_batched_entropy(); crng_init = 1; - pr_notice("random: fast init done\n"); + pr_notice("fast init done\n"); } return 1; } @@ -1432,7 +1432,7 @@ retry: ibytes = 0; if (WARN_ON(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); entropy_count = 0; } @@ -1857,9 +1857,8 @@ urandom_read(struct file *file, char __u if (!crng_ready() && maxwarn > 0) { maxwarn--; if (__ratelimit(&urandom_warning)) - printk(KERN_NOTICE "random: %s: uninitialized " - "urandom read (%zd bytes read)\n", - current->comm, nbytes); + pr_notice("%s: uninitialized urandom read (%zd bytes read)\n", + current->comm, nbytes); spin_lock_irqsave(&primary_crng.lock, flags); crng_init_cnt = 0; spin_unlock_irqrestore(&primary_crng.lock, flags);