Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1226803pxu; Wed, 6 Jan 2021 16:33:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDa9HwwsbVJkMfWzexqiRn9KPDxRjirtSN/PObFjJKntKU46APmZyOUHBjX7aoFT+G5kkb X-Received: by 2002:a17:906:653:: with SMTP id t19mr341775ejb.44.1609979597822; Wed, 06 Jan 2021 16:33:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609979597; cv=none; d=google.com; s=arc-20160816; b=i2PpWzPct8nnI24MMOkgFa4zutX3ZwMIqFvlMj0iv4vr+kv/b0V4GpFYNlz3UvW5Mm BNxkf6XxcuAgx9GGHvteSe0e8JLSQW4L/N90DIddufWMFiLjadYHYqWAB+TBdKGAI1/K AQOqIc6xq4WqpxLcpdMeAX/Ix6VT89LmXG3R+8zRx7niD9VdT2Q57JBHcuEty2JJm/mc ASX7mkd6U2d1ilnSWmsDut47S5fQYdPIf/2s9kWGTCpUqwurPpdfnYXLCbcHaMAJM8d/ xfYwdMMsT+QaEWwbyqBCqxTtbLbMwW+32Jq6RWx0mEPBNsNA7kgMOB0Ib/t4SkLRRYrL 7hWA== 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=5hjQiVmQ1AQGHvadHeoWnhLAPazVLDC2EFggvzvWRF8=; b=ssOb3qWdSfqIMDd+vAo6xPyvpIJzRXTt7nYNJAc5A1In88rBlrXj/rnuJlFPIEGT+I kIMUK/pSyz7Qfv5vxkQgsg6ECtpyPjwATSSOd/CUFOKn5wsfbXrznAzRY9RLuJOkhD6c EXK4C5g9V78lCBfmNqBdy/e1M/LZx8OQ61MYwqLnrL0/l+oLwVWqIxmRrtkKPFYztzCw cwTUbAXvG0tz0J1+NEeNLjihTyn9GUrM2q6DkTTRAbSVSfNYELBoKMZMKzSTaFCkmJPd lMWOe8EEhUD6bYvrVie+kOhEGW0ZLBnFeTfC23kXV7qh+3RLkY0QacyogZ1YdLLKO8q2 r6zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cYF3/ZLg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si1589635edw.310.2021.01.06.16.32.30; Wed, 06 Jan 2021 16:33:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cYF3/ZLg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726343AbhAGAbj (ORCPT + 99 others); Wed, 6 Jan 2021 19:31:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:56226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbhAGAbi (ORCPT ); Wed, 6 Jan 2021 19:31:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 296A722E03; Thu, 7 Jan 2021 00:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609979458; bh=5hjQiVmQ1AQGHvadHeoWnhLAPazVLDC2EFggvzvWRF8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cYF3/ZLg7oQEjxZcuLJb37TOi1b9nEZYqkngw8lgl7UBgBE6XvkrkkOEfHgQ7HO6N dyrQlTtub4fFJ+OrJC7ZLnfSI7EXU7mo8UpwShPHhJTIpxgWTffaPVNQeYNlYuWp/F 00XA4oI9WclQ9CIBfxpxlFdVM8cdmR0PsXqK7Uk1u+aK6YaU0ga+CheHQLfY5HHMoa 38W9ZI6MKsbekr6wE6Eui9iQl7d0M7iKw7tfDxCDScb2flhbhvag/rL8B81M+gecy/ +e3PfIgAnyx5i82XRknQZ3sRCBCmmH1DbRyHMN61GoMWDmsSUETbDvzk1Lw4p0YCpJ PGq5kQnf1laSw== Date: Wed, 6 Jan 2021 16:30:56 -0800 From: Jakub Kicinski To: Alexander Lobakin Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: sysctl: cleanup net_sysctl_init() Message-ID: <20210106163056.79d75ffa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210106204014.34730-1-alobakin@pm.me> References: <20210106204014.34730-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 06 Jan 2021 20:40:28 +0000 Alexander Lobakin wrote: > 'net_header' is not used outside of this function, so can be moved > from BSS onto the stack. > Declarations of one-element arrays are discouraged, and there's no > need to store 'empty' in BSS. Simply allocate it from heap at init. Are you sure? It's passed as an argument to register_sysctl() so it may well need to be valid for the lifetime of net_header.