Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4823365rwd; Tue, 23 May 2023 13:07:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6W1H0VEL/eFK7Kygbtaqtad3GtMxtiPRdMBLeAFKCQTry8+QdUpG9wmrGPb6onIBI9dsaM X-Received: by 2002:a17:902:e751:b0:1ab:f74:a111 with SMTP id p17-20020a170902e75100b001ab0f74a111mr18054295plf.63.1684872470040; Tue, 23 May 2023 13:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684872470; cv=none; d=google.com; s=arc-20160816; b=aCj7bhBFmgkGDD5N445W3QkybAnjhZ+lNXgdZESx/9ppSzLgYgPdWQHjSp9YNFxqBS 6JyR72s50f+FVXAkiqAWOh76CNzbpv3l8FIUWmyOsa0v+Koccrfq3PdJYCUOWQCM9lec z2B8NCSgTo6kSXFiKVTLHqSyJyjtsV0uuWctPTHG9yyyDHazbxUFim5cVPE12sRH5NY2 FT+eHafNdhLjNnoCteFVAZWEO3kIQg7x5/hP3zZgX25v+B2T8AWO8nce3YDVR5LLgi9b 0vN8D+igsdSXLupSX6E37U9W2q82dOoFQ6BCKF0rA5YJfdb8tsMVE9ycQJ7zdJ6XTY+a APxg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Bl6pRDDZOVD4/aU6DjrpsuXdhJzQ2AzCYc1yewqByow=; b=tpDRVITeGCOHPAGMir+v7AZET1Xw4GAUd+j678iR0xbICmxbZy8Y5pPequGm+arnuk HKB+URQNy1XGWaHO1UxAIDjPdaw1iJ5TNxlivtJ5+i2BGhCpS08zJBwOq9WduESs6chf fRKGB7EARwIDJ606H89sPYqw/Gf6I+nk5dEKTd+gH7MXbMSC/6tRdsk70LRPDtkT5h+F GmJj6yo5wc1Z4NdmUHHrMN0mcA+nV+kg8a1nf/iLHPbbWVwRkUIG1XQl0Q5zIUp9tcA+ qmZ3I40kG5e0GeDrFteAPDyaWHkTsMl5L8a5MhBJzypDpNWU5sAhYwGeecCj9Ovxxjng OZ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oMQbKI0N; 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 x1-20020a170902ec8100b001afb96f4b8fsi325241plg.519.2023.05.23.13.07.36; Tue, 23 May 2023 13:07:50 -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=oMQbKI0N; 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 S238487AbjEWTtl (ORCPT + 99 others); Tue, 23 May 2023 15:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjEWTtj (ORCPT ); Tue, 23 May 2023 15:49:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26E2119 for ; Tue, 23 May 2023 12:49:38 -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 7C81162701 for ; Tue, 23 May 2023 19:49:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3827C433D2; Tue, 23 May 2023 19:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684871377; bh=wGtFDXPE8CltQmJ9Fbh/aecZq2T4bSX/gGoZYsF+49Q=; h=From:To:Cc:Subject:Date:From; b=oMQbKI0Nj0UwqawJ3TbFjDbSkvvztGzzZjp2YrN7OJvYD+vJFcZCyydU6kdAJQjhu NAlf2lrJzRw5flZWTMAMVarPR/j+i1+s333STkNgcKC2cmhqD+TV/lxHwaAyeRWBqH PRfd5PM1IShFAHDWpWoSLNJVVA0y3J/bpB5eLiyu4bdEVMMrA65OVDUwgFr05NZUFT u8C+RcCuK4Knv0x+eE6T3SxhPx50u5Mncc97c4i2rY4v9dMbN2QRaj4dFiP8oDHsC9 kaDktqxoy/vLFovbKxqjj00KfGQLlupsY3cYfXtMJNNNst74ncHlF+ag5Vyt0i3npL cASbX5JTIUp/Q== From: Arnd Bergmann To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Arnd Bergmann , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "Jason A. Donenfeld" , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] [v2] bpf: hide unused bpf_patch_call_args Date: Tue, 23 May 2023 21:43:06 +0200 Message-Id: <20230523194930.2116181-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Arnd Bergmann This function has no callers and no declaration when CONFIG_BPF_JIT_ALWAYS_ON is enabled: kernel/bpf/core.c:2075:6: error: no previous prototype for 'bpf_patch_call_args' [-Werror=missing-prototypes] Hide the definition as well. Signed-off-by: Arnd Bergmann --- v2: change indentation to align arguments better. Still not great as the line is just too long --- kernel/bpf/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 7421487422d4..0926714641eb 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -2064,14 +2064,16 @@ EVAL4(PROG_NAME_LIST, 416, 448, 480, 512) }; #undef PROG_NAME_LIST #define PROG_NAME_LIST(stack_size) PROG_NAME_ARGS(stack_size), -static u64 (*interpreters_args[])(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5, - const struct bpf_insn *insn) = { +static __maybe_unused +u64 (*interpreters_args[])(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5, + const struct bpf_insn *insn) = { EVAL6(PROG_NAME_LIST, 32, 64, 96, 128, 160, 192) EVAL6(PROG_NAME_LIST, 224, 256, 288, 320, 352, 384) EVAL4(PROG_NAME_LIST, 416, 448, 480, 512) }; #undef PROG_NAME_LIST +#ifdef CONFIG_BPF_SYSCALL void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth) { stack_depth = max_t(u32, stack_depth, 1); @@ -2080,6 +2082,7 @@ void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth) __bpf_call_base_args; insn->code = BPF_JMP | BPF_CALL_ARGS; } +#endif #else static unsigned int __bpf_prog_ret0_warn(const void *ctx, -- 2.39.2