Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6128809iog; Thu, 23 Jun 2022 11:58:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1um8q9Ac+oGeROwR6JnS9CkLfihB5whAqV9aVocVc75s/7lO3GriOEWfaijGyC4z8YRd3L4 X-Received: by 2002:a63:5155:0:b0:400:14af:a1e6 with SMTP id r21-20020a635155000000b0040014afa1e6mr8664470pgl.71.1656010695280; Thu, 23 Jun 2022 11:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010695; cv=none; d=google.com; s=arc-20160816; b=yx4eWIpKt5Q+Ia0r4oqGEKiNdBdHaIr8N8Ixjx4um+Pwxk7qLImIaRFhubO0X21QLk pcQYXPLWUrw5FcPTpyqT2Z+lYjTErRjHrDxGBhe0ZT7Jusc4kvyYB07XdXqTevJJ4nUc RTIZOI9vqfMpFct8v5Ob19LpYm109lzeUHFX9iesnckFXbxvz0uss46FkwUq2DE10h6h ItEddY1Yk+bC5/T8Vpir9hi1lLUoYbgfJmA/cgSg+MxR9wY8lSrThIZLGMTpKJKScWEw 6LGAyCorDPOQxiJHV51e9fZkMpO/VlgSfNaqbN7tb/pdwdmUxpEEWpSlzb0a+FlvFSS8 +LIA== 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=IxXCMZP+kxWwRtnK2qDWMuNg1RcQ2gfwPx0T02taeeQ=; b=ugT44Iop+JUDc7ZnUsOf2W2cBekibCkSb6PrT9CqeJfIl8ZrM+zd3/GnhHrpKiM5EN EAkaV+HuqU1rrcZV7nx1NIBuuR/2ltfL+ERFQ/uC1lY35L/G9f6wHz+7llWW9o52RTax Dj8/Ll1l8h7MeoBDHshUykKBATay1z5mvt2naT1OQV5dgoBfgANK8RrR/ZhdPkiVRYkO NK9KWrhzHxHR5/aEuYmv/UjzpcbWCkpEW8Z1Mh9YXCWl9/+UTyBRi6o7l9F6GEmw7mKD E9pLQCjzALsey55bVYrFCDcPUtmLGEZaGW3ZSKHg+y74KUw21zciS3hbRmQby2gFtWAh LAFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oOlUGwiX; 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 g25-20020a635219000000b003fcaefeeec8si28405954pgb.115.2022.06.23.11.58.03; Thu, 23 Jun 2022 11:58:15 -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=oOlUGwiX; 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 S232827AbiFWQ6u (ORCPT + 99 others); Thu, 23 Jun 2022 12:58:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233346AbiFWQur (ORCPT ); Thu, 23 Jun 2022 12:50:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726174AE1F; Thu, 23 Jun 2022 09:48:40 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8E66D61FA3; Thu, 23 Jun 2022 16:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 628F3C3411B; Thu, 23 Jun 2022 16:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656002918; bh=veDQwILYuYD77O/PWU+fYo0AeKKkbMgMDyW8CYhs+zQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oOlUGwiXDFjcg6eRkCxRhD/q/hDUyxLARr4NcIfSLGwkdIFMFYGq8nkysXQh4hA0f eMt/VN6mh+Zp7CipTFXIGoiGBlms4pJmIka1ibqz+mjZ0utFnQ5peIKgia7u3/8mBR UvW05sdvL48n9kxlbNBXkfNyIWijFIjeURvlxO+g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Mark Rutland , Theodore Tso , "Jason A. Donenfeld" Subject: [PATCH 4.9 068/264] random: avoid warnings for !CONFIG_NUMA builds Date: Thu, 23 Jun 2022 18:41:01 +0200 Message-Id: <20220623164345.995818273@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: Mark Rutland commit ab9a7e27044b87ff2be47b8f8e095400e7fccc44 upstream. As crng_initialize_secondary() is only called by do_numa_crng_init(), and the latter is under ifdeffery for CONFIG_NUMA, when CONFIG_NUMA is not selected the compiler will warn that the former is unused: | drivers/char/random.c:820:13: warning: 'crng_initialize_secondary' defined but not used [-Wunused-function] | 820 | static void crng_initialize_secondary(struct crng_state *crng) | | ^~~~~~~~~~~~~~~~~~~~~~~~~ Stephen reports that this happens for x86_64 noallconfig builds. We could move crng_initialize_secondary() and crng_init_try_arch() under the CONFIG_NUMA ifdeffery, but this has the unfortunate property of separating them from crng_initialize_primary() and crng_init_try_arch_early() respectively. Instead, let's mark crng_initialize_secondary() as __maybe_unused. Link: https://lore.kernel.org/r/20200310121747.GA49602@lakrids.cambridge.arm.com Fixes: 5cbe0f13b51a ("random: split primary/secondary crng init paths") Reported-by: Stephen Rothwell Signed-off-by: Mark Rutland Cc: Theodore Ts'o Signed-off-by: Theodore Ts'o Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -801,7 +801,7 @@ static bool crng_init_try_arch(struct cr return arch_init; } -static void crng_initialize_secondary(struct crng_state *crng) +static void __maybe_unused crng_initialize_secondary(struct crng_state *crng) { memcpy(&crng->state[0], "expand 32-byte k", 16); _get_random_bytes(&crng->state[4], sizeof(__u32) * 12);