Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2357332pxb; Mon, 20 Sep 2021 20:00:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ++gl9cIDdbEMHVXzd88xmbFWfaL9U1Obtyz9+1oIJP8tRYzUG7vZXj5P1/cP8LcrNjql X-Received: by 2002:a50:dac2:: with SMTP id s2mr3745539edj.141.1632193208421; Mon, 20 Sep 2021 20:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632193208; cv=none; d=google.com; s=arc-20160816; b=DnoK499eqLqJBPsZJIcifcvCUi8KN0wcj19ATb30REVbhRc98w5MQnGG+9h7LbLAmO 8u02M3Y4mWP1g3USEZEj+mB1hlZYNZ46JbSQgLfd7fZNHyoKwwMZ2qbbU7o/ZR+NQEwp s0hfBuoqaTkn3X5iPUSa8oVU/rySrt/+ywPVg2rB8uluSiy8cwViZEi8/8f6cdTttOjP lyK/7QKFoQBQGYYj4L7/1JCRl2l0iSz+57xQg9XkJpIfwgwTkkQNu0Ixb3eBRyODiyJg yrMrejX8qFX65mFexxKgiXYAxKSxphfn7tAaEuTDlIr6BCGrSVt93QmVXFF9YN+Ot8ye 6aSQ== 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=nKboeR4UkUoOb4sXRqrDpdGGG7vBO7J4vGjzFTM6sJA=; b=g37lRKKAeNESZ5qthwatr6ZFOqYHqnQ61whkFdIXNHFCbxNpF5OZBFVoTXFxiayVjx CoRSBxa1gws9jjxdocRWsuuU7xvBqXLmxM2TU/YHwmvwrZ+JtwCIlzlUJv1ofZdcgAYr TqaNLAyfpnee77qpLWTK6s77QSbeyPzShszIEF46IRd0FeqT65g+ylMe3OzBJCzhP5gE 9wMrtpU1CKLayjcz3cbkzve2A99eDcMfepOhT0zyH4uwllTFQLTnm/RI1+zrzq6cHeAw O7H7OrgNE0q3M8ntyalWqFAsWSL60IRg3m5HkUi/qE7VIxiCxmFHMRYQYKbqnayxRibI xyVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IeFVef4x; 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 m15si18113929ejn.484.2021.09.20.19.59.44; Mon, 20 Sep 2021 20:00:08 -0700 (PDT) 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=IeFVef4x; 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 S240019AbhITVGF (ORCPT + 99 others); Mon, 20 Sep 2021 17:06:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232273AbhITVED (ORCPT ); Mon, 20 Sep 2021 17:04:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 02B2361107; Mon, 20 Sep 2021 21:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632171756; bh=yhw6MJGdpGrujZvqXR9hMEFV24CcnnxvNrfXDRNVGdU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IeFVef4xe6+fbrMgbNzoKSGTUtC+6Sm70dWJlI+zDrFly+TkL1qs844wYpvA3wF8X ifmYicMFMFAA7GMsErtEeoeopKnfcAAjg2zpvBYOP4o9VI/xxTAZWPJDy8YZxCLyCo xzbppS3ndw1jpV/vFQkKu+wjAqPGEgDKqd0TsYQ72XAC4bd89ege7ktgefYcSaxInT DtvOFQ9S00n9T2MCzcpG6WP7+8UtZ/LDtyZrVXcUUkXaAlMQXELoPYX4ABiX5fAI0K e1owMedN8czGJv9HiBFGewMe0ccz2Ad6s1csmOFopq3IbirTRmsZuQYDTdqj1LpqEO gYmMgYr2gho6Q== Date: Mon, 20 Sep 2021 14:02:35 -0700 From: Jakub Kicinski To: Mianhan Liu Cc: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , , Subject: Re: [PATCH -next] net/ipv4/sysctl_net_ipv4.c: remove superfluous header files from sysctl_net_ipv4.c Message-ID: <20210920140235.49b887fa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210920134200.31481-1-liumh1@shanghaitech.edu.cn> References: <20210920134200.31481-1-liumh1@shanghaitech.edu.cn> 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 Mon, 20 Sep 2021 21:42:00 +0800 Mianhan Liu wrote: > sysctl_net_ipv4.c hasn't use any macro or function declared in mm.h, module.h, > igmp.h, inetdevice.h, swap.h, slab.h, nsproxy.h, snmp.h, route.h and inet_frag.h. > Thus, these files can be removed from sysctl_net_ipv4.c safely without affecting > the compilation of the net module. How did you arrive at this conclusion? It certainly uses linux/slab.h as it calls kmalloc(). Please don't introduce dependencies on second-order includes. If file uses a function, define, struct etc. from a header it should directly include that header. Just because the code still compiles doesn't mean the change is for good. > diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c > index 6f1e64d49..f8e39d00b 100644 > --- a/net/ipv4/sysctl_net_ipv4.c > +++ b/net/ipv4/sysctl_net_ipv4.c > @@ -6,25 +6,15 @@ > * Added /proc/sys/net/ipv4 directory entry (empty =) ). [MS] > */ > > -#include > -#include > #include > -#include > -#include > #include > #include > -#include > -#include > -#include > -#include > #include > #include > #include > -#include > #include > #include > #include > -#include > #include > #include > #include