Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2860489pxp; Tue, 8 Mar 2022 03:26:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPY/1h0f9fjWO79BcaQimnq7M2CQ2EYDUziim+NyJrC0I+gVRu+RTcu9xMzQ7Ammq2FbbH X-Received: by 2002:a63:1554:0:b0:363:794c:9e31 with SMTP id 20-20020a631554000000b00363794c9e31mr13586212pgv.66.1646738774371; Tue, 08 Mar 2022 03:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646738774; cv=none; d=google.com; s=arc-20160816; b=uGl5Pgf3nzoF1JUeUsDLn/TxqFfmrHvEkcc2QKg17yrHk3zStB8R5TqRZS52FA0Sxo YEW3ni03wut28kQml+SSfa7X17WkDF4YAh4XmoAr7UxPaZOcvtwSCj+/oJ/29a2Knx1d ng3y9lPu2tapPhmtT0gV4a4ighOp/52zdCGHdm2q0K0FPmDT+gEpHhYUTcSbjPbToOVh L7pOrHm9BtmW6x5eAYYinEswl8pFa+OGZxQf2dzmQxus1rR/FiKi7y36uC2Tmno7txer ZOHJdyyqjuYAiv/SJV1/NVvBp3GrEOo222nOeXJqtFmOka8FQ/BArtscdKZQdtshgScR wTkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=VsRtXsnu8clWY/ESBXVj04ghPvjDluuGUnmcIOl46AY=; b=04YwIaemt97bnD8lut9pIc+C7njeUIAjWB7fVzLHyLY0lekWVegSr2DA8ruGMqcwkZ n6gmaa6AvcN54rB1s+GFvg3uTndmDT6YLr8kjNygk9TeA8KAIflh4ZnfBAfj6IRc/sAw bPO3u13T2FaYnKBhH7P3rRIWz72u99GajI2LjW8yQq6ywyAm1vYFgwTMvpuq1Y8gAYZ4 J98DqaSSnhTLQk3+DrhgAGdXuV6vE6vnJ/G05BliohdESWQudafhgCb5z9ffBpEBBObh JwIysblGo1tbafYed/0nvYiyTusB33kiBLB1WuMIzv7Q3Y+cKIztut9iE23IYKh0soaz FGvw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f29-20020a63101d000000b003658523c918si15849595pgl.781.2022.03.08.03.25.58; Tue, 08 Mar 2022 03:26:14 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344192AbiCHGZF (ORCPT + 99 others); Tue, 8 Mar 2022 01:25:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiCHGZE (ORCPT ); Tue, 8 Mar 2022 01:25:04 -0500 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20688369EF for ; Mon, 7 Mar 2022 22:24:07 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=dust.li@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0V6d1UNQ_1646720645; Received: from localhost(mailfrom:dust.li@linux.alibaba.com fp:SMTPD_---0V6d1UNQ_1646720645) by smtp.aliyun-inc.com(127.0.0.1); Tue, 08 Mar 2022 14:24:05 +0800 Date: Tue, 8 Mar 2022 14:24:04 +0800 From: "dust.li" To: Jakub Kicinski Cc: kernel test robot , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org Subject: Re: [saeed:net-next 154/185] net/smc/smc_sysctl.h:23:16: warning: no previous prototype for 'smc_sysctl_net_init' Message-ID: <20220308062404.GG35207@linux.alibaba.com> Reply-To: dust.li@linux.alibaba.com References: <202203081012.KgONXWsS-lkp@intel.com> <20220308051655.GF35207@linux.alibaba.com> <20220307212520.176fce24@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220307212520.176fce24@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 On Mon, Mar 07, 2022 at 09:25:20PM -0800, Jakub Kicinski wrote: >On Tue, 8 Mar 2022 13:16:55 +0800 dust.li wrote: >> >vim +/smc_sysctl_net_init +23 net/smc/smc_sysctl.h >> > >> > 22 >> > > 23 int __net_init smc_sysctl_net_init(struct net *net) >> > 24 { >> > 25 net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE; >> > 26 return 0; >> > 27 } >> > 28 >> > > 29 void __net_exit smc_sysctl_net_exit(struct net *net) { } >> > 30 >> >> Hi Jakub: >> >> Sorry to bother again on this ! >> Looks like we still need to add 'static inline' or add an extra >> declaration for these 2 functions if we want to get rid of these warnings. >> What do you think ? > >Sorry my comment was pretty unclear an unnecessary. > >I meant that you don't need the __net_init annotation, it still >needs to be a static inline. So this is what I meant: Ah, I see. Thanks for your detailed explanation. I will post another fix. > >diff --git a/net/smc/smc_sysctl.h b/net/smc/smc_sysctl.h >index 1d554300604d..0becc11bd2f4 100644 >--- a/net/smc/smc_sysctl.h >+++ b/net/smc/smc_sysctl.h >@@ -20,13 +20,13 @@ void __net_exit smc_sysctl_net_exit(struct net *net); > > #else > >-int __net_init smc_sysctl_net_init(struct net *net) >+static inline int smc_sysctl_net_init(struct net *net) > { > net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE; > return 0; > } > >-void __net_exit smc_sysctl_net_exit(struct net *net) { } >+static inline void smc_sysctl_net_exit(struct net *net) { } > > #endif /* CONFIG_SYSCTL */ > > > >But really it does not matter if the __net_init / exit is there, >so this works too: > >diff --git a/net/smc/smc_sysctl.h b/net/smc/smc_sysctl.h >index 1d554300604d..6979e7173669 100644 >--- a/net/smc/smc_sysctl.h >+++ b/net/smc/smc_sysctl.h >@@ -20,13 +20,13 @@ void __net_exit smc_sysctl_net_exit(struct net *net); > > #else > >-int __net_init smc_sysctl_net_init(struct net *net) >+static inline int __net_init smc_sysctl_net_init(struct net *net) > { > net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE; > return 0; > } > >-void __net_exit smc_sysctl_net_exit(struct net *net) { } >+static inline void __net_exit smc_sysctl_net_exit(struct net *net) { } > > #endif /* CONFIG_SYSCTL */ >