From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E349C388F9 for ; Wed, 11 Nov 2020 14:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8C31205ED for ; Wed, 11 Nov 2020 14:03:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UccXZMT9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbgKKODa (ORCPT ); Wed, 11 Nov 2020 09:03:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29759 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727235AbgKKODW (ORCPT ); Wed, 11 Nov 2020 09:03:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605103401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9esnXIxru8+RNVWB1D49REf+6KCKaBBBFOJUSavGUik=; b=UccXZMT9TpBIv+Q1X76kGHNaIrRSENmZA55Zi8de8xYTeVfYdI3PTMUd7YOhBxfOasNnna NOSSMI5jpA1gK5Pff52hJ2G33KgQxMEILy1a0xMq+R9gOc/eA154ZjmG7o97C11OemoU9o nPZxQYP5GPD1E7cBIYSoCKU5U1lxGqA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-249-nXoT7eWxMHiz0r_o4PNLwA-1; Wed, 11 Nov 2020 09:03:17 -0500 X-MC-Unique: nXoT7eWxMHiz0r_o4PNLwA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A6FC51017DC8; Wed, 11 Nov 2020 14:03:15 +0000 (UTC) Received: from ovpn-66-204.rdu2.redhat.com (ovpn-66-204.rdu2.redhat.com [10.10.66.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF6085DA74; Wed, 11 Nov 2020 14:03:14 +0000 (UTC) Message-ID: <288207f247a2e1c6c7940f87e337d3b881c7de17.camel@redhat.com> Subject: Re: linux-next: build warning after merge of the bpf-next tree From: Qian Cai To: Stephen Rothwell , Daniel Borkmann , Alexei Starovoitov , Networking Cc: Andrii Nakryiko , Linux Kernel Mailing List , Linux Next Mailing List Date: Wed, 11 Nov 2020 09:03:14 -0500 In-Reply-To: <20201111120121.48dd970d@canb.auug.org.au> References: <20201111120121.48dd970d@canb.auug.org.au> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Wed, 2020-11-11 at 12:01 +1100, Stephen Rothwell wrote: > Hi all, > > After merging the bpf-next tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > kernel/bpf/btf.c:4481:20: warning: 'btf_parse_module' defined but not used [- > Wunused-function] > 4481 | static struct btf *btf_parse_module(const char *module_name, const > void *data, unsigned int data_size) > | ^~~~~~~~~~~~~~~~ > > Introduced by commit > > 36e68442d1af ("bpf: Load and verify kernel module BTFs") > It loos like btf_parse_module() is only used when CONFIG_DEBUG_INFO_BTF_MODULES=y, so this should fix it. diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 0f1fd2669d69..e877eeebc616 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -4478,6 +4478,7 @@ struct btf *btf_parse_vmlinux(void) return ERR_PTR(err); } +#ifdef CONFIG_DEBUG_INFO_BTF_MODULES static struct btf *btf_parse_module(const char *module_name, const void *data, unsigned int data_size) { struct btf_verifier_env *env = NULL; @@ -4546,6 +4547,7 @@ static struct btf *btf_parse_module(const char *module_name, const void *data, u } return ERR_PTR(err); } +#endif /* CONFIG_DEBUG_INFO_BTF_MODULES */ struct btf *bpf_prog_get_target_btf(const struct bpf_prog *prog) {