Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2904716pxp; Tue, 8 Mar 2022 04:23:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyw3/fZNQidGQs5yK1jOBYoqMtSD7fPxq76sjLw6alZ8UreQA+3pCECD0KKURwv4x/N/dQ4 X-Received: by 2002:a05:6402:174a:b0:415:ce98:9feb with SMTP id v10-20020a056402174a00b00415ce989febmr16079105edx.109.1646742179962; Tue, 08 Mar 2022 04:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646742179; cv=none; d=google.com; s=arc-20160816; b=UzZDfFqlUgEUh0hnNl6KPtJ5oodaHmP9o1JeDyvjO0dY1CzOjJKmsfnE0/oVqYS6V8 KzUhrZz9KCaQinbSARPJI9hMr/SM863rKfTwSUPxkhNtybb3J1vDqYa+FWdQXyS5WVIX cKHUhzzgMWhf1hzEygnHrSF+Ei5k40DLCHW6QMnmXL0kw4pIc1QiCuHS73+AgVirFZJR CMtknOP6VN6OASp+PDZNBHoYkWcXugXtyW1AN0j57JmMUnRbrwzyb+3nXMxnV/N2/k5k 4Zx+92ADf1Qc131CBzr8ZgXS/RzneORBXSBPaqgn14+jlq6q4Ib/uxCzUMRA6aJI6MDL Vbpw== 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:subject:cc:to:from:date :dkim-signature; bh=6yEEEOjhk3+01g/KDxIO2w0MZJxUEROJ4PlIvFrdSyk=; b=liL/LsEHQpVKObWy2nti/616YEaPN2a1bX/PWxTgnOQYnWvddDc6bOJXGn+YOmgjJL Rt6yxODkKVxb5Cj9N8zeHI6GHir4mVzFhjmdWGW4qJD7HVoAJYeZhX3Rj7S1i3gD6vxo 4iXLd8FpgIDV4IiZgTYHQlVcZU3OiAxj1LY8fIUBUcs0lbyBlPQWkgZ1WEZiwefwKUJi 6Y+oYj4nr+1BibMDkBNDugL87x8Yf/s/zEcf6QKFH8DbKQ2U9AMI4YzB9eNdVSYHN57m RmdTRZb5mi0X9uLbuEmaTXcfBHqNsOjjCsUy7AtKjUZNCPb8NawSfrZiRR2gr51+4G84 a5Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FsfiOkbQ; 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 c12-20020a05640227cc00b0041649af58a7si4141937ede.19.2022.03.08.04.22.36; Tue, 08 Mar 2022 04:22:59 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FsfiOkbQ; 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 S243332AbiCHF0U (ORCPT + 99 others); Tue, 8 Mar 2022 00:26:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237923AbiCHF0T (ORCPT ); Tue, 8 Mar 2022 00:26:19 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC7A3B56E for ; Mon, 7 Mar 2022 21:25:23 -0800 (PST) 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 EDEDF61578 for ; Tue, 8 Mar 2022 05:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2072FC340EB; Tue, 8 Mar 2022 05:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646717122; bh=KXzmZyEZ7u0umWi8Wmg3jgarR7t2v/kSfkqx99RMKdI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FsfiOkbQenTIwm/kRsex+SaJWDpa0M8Feo4v2jegV82BN3EY1FYyXXx2bze8656cE OQwuR3fybLuA8nx5TfxF6ZNofhV9WSMMjHi7jBiBXSpSywjM/Nh7n+HPQOebm+olt9 JEMCjfCYrgzPuDMVfpHG5GrzODzPCmDVeSLdOs/mCZPhnUC/heLZ6lNZh26Lz8TNjZ Q+GBJZ019Oqf9lzwidQ9N7H6NQZaKLe+rfWuWEB+ipEJy6NCDIBEVZXd73klH6g7qZ q1OSf0flPtR+yquptlzP+FO6roORBlokRkjUICkpgFYIVDt81S+6St9fxBxYTqaEn1 GikOeoW+3uwLA== Date: Mon, 7 Mar 2022 21:25:20 -0800 From: Jakub Kicinski To: "dust.li" 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: <20220307212520.176fce24@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20220308051655.GF35207@linux.alibaba.com> References: <202203081012.KgONXWsS-lkp@intel.com> <20220308051655.GF35207@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 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 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: 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 */