Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2145042rwd; Wed, 17 May 2023 06:25:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4heTeBGN3kfpHDOYMBRxuoDyMnJEM9pG+mUrtveHOywV8qvKjEA1ijbjrbhDHNxHWtBJme X-Received: by 2002:a05:6a00:16cd:b0:63d:38db:60ef with SMTP id l13-20020a056a0016cd00b0063d38db60efmr1067648pfc.26.1684329955341; Wed, 17 May 2023 06:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329955; cv=none; d=google.com; s=arc-20160816; b=y40vyXMKVPDwrhKpyFbw7SE5FaN7tW+Cvrc/1sckt2/59Wjb3kuz37Ojo7T473BwUA ITdH3kLXRgg9pHC1xGO5YsrAlOJ3X9VP6UFzX42pjbhEsuPVHOR6txI765u4dLTiE4QZ ZXSVV1RNRhUuf3K/gDXwhOSwx8zwia+p3cYFDwAXg7p4dDWFnqf5K1T3KKU1z3fAbJEc uB52k/sV6B/5ewsr6Uqz7CnavQXm8G4IxyLT5Gua15ftR88c4g/jkOq7dwyxaoQZmCD0 dTq9X0w1V8SkTIQoHrpTAsM1ocdbE8MqspNAzl8VPTxywKsaFInBWLS6SQI0YjqvEmX5 KJgA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CDYpwW1Fx9PeUZeLZC70UUWKtmFBuyf8tKpF+icN7uA=; b=HIyxogZ3x4040cl5Ly8EFyGTeWh7RlI3WRKnWhGpeZZ+k/gWulSFe6qQAtpmIc0Bue /IvwI6bG7+87c1rJvY6BxDgulag+iwRTp/TbpjVTbdrbZgKtmHHZysob9KdM2yPNHSKE oRXcXS++ePdu8bjMhArmirne5Jgp3EXwn8xiH/MIZmfF5mE++GiSW6xNaHFNIrQ8hwpZ kv7NeOV1BhZnjGepz+axfmGll+6V8d8xFodMdtmVlUROMjiZh73pxw7moJbKI2eEXYz9 Ew0sG2s+pCM81RfC40TyiJ7JftY2Hww6YUgCvaWRyZNkY168A+FbwB2VhaNYUHhVnqxw 4cTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sXIvKHQg; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020aa7988c000000b0063b8b3519besi21712376pfl.32.2023.05.17.06.25.42; Wed, 17 May 2023 06:25:55 -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=@kernel.org header.s=k20201202 header.b=sXIvKHQg; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbjEQNNF (ORCPT + 99 others); Wed, 17 May 2023 09:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbjEQNMz (ORCPT ); Wed, 17 May 2023 09:12:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F295365AA; Wed, 17 May 2023 06:12:35 -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 E5FDA64714; Wed, 17 May 2023 13:12:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 335BEC433EF; Wed, 17 May 2023 13:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684329152; bh=wIpq6dQ3SrZ+OFpGPswN9m0xaTqULZnHSrUinkSrQZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sXIvKHQgTrqznMJvGuTDhX84E9WFuYptr8V3Ek7xw2qzSKUVOylJd5AIRFHWD43cs rY9FXAfbijzhcRJ7xB3TlUNAPXZltMOT2Gu4HfBs6rSenBQe9xDB/DkigljyzJ5y0q NqniEOZEjINgmXRhB2DOJQVMCw6aB5m5fkNbmxq0hQ2kjVyy2Rz5uAkz1lxR6GK/pc kmDhZQgZnArP9xfDPRLQii+MbSH3WYm82+2YK1Gsm9qH0+4zeAr7ziGBnxhAtpe3t7 S5c12dcl36AQVcUIP/lTS5gtzL2FAYQNXRSkp6OFpQMsIrlhIqSx17r+jWyW/eaEgJ v4/2vi76yp1wQ== From: Arnd Bergmann To: Andrew Morton Cc: linux-mm@kvack.org, Arnd Bergmann , Russell King , Catalin Marinas , Will Deacon , Michal Simek , Thomas Bogendoerfer , Helge Deller , Michael Ellerman , Palmer Dabbelt , Heiko Carstens , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "Rafael J. Wysocki" , Paul Moore , Eric Paris , Dennis Zhou , Tejun Heo , Christoph Lameter , Pavel Machek , Peter Zijlstra , Waiman Long , Boqun Feng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, audit@vger.kernel.org, linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: [PATCH 07/14] panic: hide unused global functions Date: Wed, 17 May 2023 15:10:55 +0200 Message-Id: <20230517131102.934196-8-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230517131102.934196-1-arnd@kernel.org> References: <20230517131102.934196-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: Arnd Bergmann Building with W=1 shows warnings about two functions that have no declaration or caller in certain configurations: kernel/panic.c:688:6: error: no previous prototype for 'warn_slowpath_fmt' [-Werror=missing-prototypes] kernel/panic.c:710:6: error: no previous prototype for '__warn_printk' [-Werror=missing-prototypes] Enclose the definition in the same #ifdef check as the declaration. Signed-off-by: Arnd Bergmann --- kernel/panic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index 886d2ebd0a0d..10effe40a3fa 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -684,6 +684,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint, add_taint(taint, LOCKDEP_STILL_OK); } +#ifdef CONFIG_BUG #ifndef __WARN_FLAGS void warn_slowpath_fmt(const char *file, int line, unsigned taint, const char *fmt, ...) @@ -722,8 +723,6 @@ void __warn_printk(const char *fmt, ...) EXPORT_SYMBOL(__warn_printk); #endif -#ifdef CONFIG_BUG - /* Support resetting WARN*_ONCE state */ static int clear_warn_once_set(void *data, u64 val) -- 2.39.2