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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 21CCBC3F68F for ; Mon, 3 Feb 2020 08:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EDB1320721 for ; Mon, 3 Feb 2020 08:16:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727801AbgBCIQw (ORCPT ); Mon, 3 Feb 2020 03:16:52 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:39146 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727540AbgBCIQv (ORCPT ); Mon, 3 Feb 2020 03:16:51 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 71800479F7C0A6080A88; Mon, 3 Feb 2020 16:16:48 +0800 (CST) Received: from [127.0.0.1] (10.57.71.8) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Mon, 3 Feb 2020 16:16:38 +0800 Subject: Re: [PATCH -next] bpf: make btf_check_func_type_match() static To: Yonghong Song , , CC: , , , , , , , References: <20200203020220.117152-1-yaohongbo@huawei.com> From: Yao HongBo Message-ID: Date: Mon, 3 Feb 2020 16:16:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.57.71.8] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/3/2020 2:20 PM, Yonghong Song wrote: > > > On 2/2/20 6:02 PM, Hongbo Yao wrote: >> Fix sparse warning: >> kernel/bpf/btf.c:4131:5: warning: symbol 'btf_check_func_type_match' was >> not declared. Should it be static? > > Yes, static is better since the function is only used in one file. > > Please use the tag "[PATCH bpf-next]" instead of "[PATCH -next]". > Since this is to fix a sparse warning, I think it should be okay > to target bpf-next. Please resubmit after bpf-next reopens in > about a week. OK. >> >> Reported-by: Hulk Robot >> Signed-off-by: Hongbo Yao >> --- >>   kernel/bpf/btf.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c >> index 8c9d8f266bef..83d3d92023af 100644 >> --- a/kernel/bpf/btf.c >> +++ b/kernel/bpf/btf.c >> @@ -4144,7 +4144,7 @@ int btf_distill_func_proto(struct bpf_verifier_log *log, >>    * EFAULT - verifier bug >>    * 0 - 99% match. The last 1% is validated by the verifier. >>    */ >> -int btf_check_func_type_match(struct bpf_verifier_log *log, >> +static int btf_check_func_type_match(struct bpf_verifier_log *log, >>                     struct btf *btf1, const struct btf_type *t1, >>                     struct btf *btf2, const struct btf_type *t2) > > Please also align >   struct btf *btf1, const struct btf_type *t1, >   struct btf *btf2, const struct btf_type *t2) > properly after you added 'static' before the function declaration. I'll fix it, thanks. >>   { >> > > . >