Message ID | adc33d6c7dd01e29c848b9519b6a601219ba6780.1670086158.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1445905wrr; Sat, 3 Dec 2022 08:53:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf6hKSSzd13BMpdwdCpYQwSvVAWoN61bk23DeFzhG0jmYcLyYIHnwDVHI9tIxhriJZnGHlEM X-Received: by 2002:a17:903:28f:b0:189:8a36:1b70 with SMTP id j15-20020a170903028f00b001898a361b70mr31927437plr.12.1670086414231; Sat, 03 Dec 2022 08:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670086414; cv=none; d=google.com; s=arc-20160816; b=pzMMEont6yBzLoRI2VfQWxbVssIxUiDehSHTZzFpdYvpu+Q4qRyCVCiLpsDRvsssjj d5No2qiDx9LUIGrtf8jIY0SqLdV3sAwY8SQJG7434aYRsnug7ChEDiY3BHPEBVAyuhZX CSYi6ucUawozZDoeBUPsu+OsVK3ALpALAvcSgS7vv1wzZwwP1F+lOWO5CgE/rjdevQy7 K/xuQZRIO/EwSorsGUE/z2VfIl9HC13Qt0zdJVOHYHptigk6YGT0TYAIM62U/RpJ/bHk suLbnIcYW6LpifXa4WPwSfF/L5uJSTJlUy0Wwq8ZP03BTlZJOhCM0ETX/11o22HiV6Ye NDZA== 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 :message-id:date:subject:cc:to:from; bh=laARktXzsCWWxQ47wAwjRlPa+Mst81sopb4J1Rps3oc=; b=BGbULc3QupolYyp2aAJZFl57DupYDHSrciAijpuLFSNd2wfALRPG7I2MEhwLQgF9tp KyT9nPajBGt13UYD+YuHU1W1swYtuP7p/hYzgfLnKRh0vOxcTxkFst3vFdDZcjIQfVy6 hRONIIeHuC9tgE7eF/+rQhhmyQDKfBjY9/o9OdcAcFaGBiUJVuhntP//G6MsEa/ii3QP gPHYfhx3p4PJIpWqGPnBgHshmr7cOvKoU6xGqmOVS0GJmrEXKJKGqp0Rw6GvLVIqrMMT bJ8ry+pr+pQRVW/EZiM+jxs5tINjcjPo93zm6RqmIvMNF2pzP94WL79oZLSPB5q7xRra 3eeA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a170902f78e00b00186fb907e27si9979037pln.552.2022.12.03.08.53.21; Sat, 03 Dec 2022 08:53:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229436AbiLCQty (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Sat, 3 Dec 2022 11:49:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbiLCQtx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 3 Dec 2022 11:49:53 -0500 Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CAE820BD4 for <linux-kernel@vger.kernel.org>; Sat, 3 Dec 2022 08:49:50 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 1VhypqniCap0Y1VhypzTXS; Sat, 03 Dec 2022 17:49:48 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 03 Dec 2022 17:49:48 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, netdev@vger.kernel.org Subject: [PATCH] packet: Don't include <linux/rculist.h> Date: Sat, 3 Dec 2022 17:49:44 +0100 Message-Id: <adc33d6c7dd01e29c848b9519b6a601219ba6780.1670086158.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751212531984640646?= X-GMAIL-MSGID: =?utf-8?q?1751212531984640646?= |
Series |
packet: Don't include <linux/rculist.h>
|
|
Commit Message
Christophe JAILLET
Dec. 3, 2022, 4:49 p.m. UTC
There is no need to include <linux/rculist.h> here.
Prefer the less invasive <linux/types.h> which is needed for 'hlist_head'.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Let see if build-bots agree with me!
Just declaring 'struct mutex' and 'struct hlist_head' would also be an
option.
It would remove the need of any include, but is more likely to break
something.
---
include/net/netns/packet.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Dec 3, 2022 at 5:49 PM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > There is no need to include <linux/rculist.h> here. > > Prefer the less invasive <linux/types.h> which is needed for 'hlist_head'. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > Let see if build-bots agree with me! > net/packet/af_packet.c does not explicitly include linux/rculist.h It might be provided by include/linux/netdevice.h, but I wonder if this is best practice. > Just declaring 'struct mutex' and 'struct hlist_head' would also be an > option. I do not get it, see [1] > It would remove the need of any include, but is more likely to break > something. I do not see why you are even trying this ? > --- > include/net/netns/packet.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h > index aae69bb43cde..74750865df36 100644 > --- a/include/net/netns/packet.h > +++ b/include/net/netns/packet.h > @@ -5,8 +5,8 @@ > #ifndef __NETNS_PACKET_H__ > #define __NETNS_PACKET_H__ > > -#include <linux/rculist.h> > #include <linux/mutex.h> > +#include <linux/types.h> > > struct netns_packet { > struct mutex sklist_lock; [1] Definition of 'struct mutex' is definitely needed here. > -- > 2.34.1 >
Le 05/12/2022 à 06:24, Eric Dumazet a écrit : > On Sat, Dec 3, 2022 at 5:49 PM Christophe JAILLET > <christophe.jaillet@wanadoo.fr> wrote: >> >> There is no need to include <linux/rculist.h> here. >> >> Prefer the less invasive <linux/types.h> which is needed for 'hlist_head'. >> >> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> >> --- >> Let see if build-bots agree with me! >> > > net/packet/af_packet.c does not explicitly include linux/rculist.h > > It might be provided by include/linux/netdevice.h, but I wonder if > this is best practice. At least, it is not what I expect. My goal is to avoid some unneeded includes AND the related indirect needed includes that are buried somewhere in the dependency hell. I missed the one in af_packet.c I'll repost a v2 with the fix for af_packet.c (and double-check if some other are also needed) > >> Just declaring 'struct mutex' and 'struct hlist_head' would also be an >> option. > > I do not get it, see [1] Just forget about it. Requirement for: struct my_struct { struct another_struct x; and struct my_struct { struct another_struct *x; ~~~ are not the same, even if 'my_struct' is not used at all... (*ashamed *) CJ > >> It would remove the need of any include, but is more likely to break >> something. > > I do not see why you are even trying this ? > >> --- >> include/net/netns/packet.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h >> index aae69bb43cde..74750865df36 100644 >> --- a/include/net/netns/packet.h >> +++ b/include/net/netns/packet.h >> @@ -5,8 +5,8 @@ >> #ifndef __NETNS_PACKET_H__ >> #define __NETNS_PACKET_H__ >> >> -#include <linux/rculist.h> >> #include <linux/mutex.h> >> +#include <linux/types.h> >> >> struct netns_packet { >> struct mutex sklist_lock; > > [1] Definition of 'struct mutex' is definitely needed here. > >> -- >> 2.34.1 >> >
diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h index aae69bb43cde..74750865df36 100644 --- a/include/net/netns/packet.h +++ b/include/net/netns/packet.h @@ -5,8 +5,8 @@ #ifndef __NETNS_PACKET_H__ #define __NETNS_PACKET_H__ -#include <linux/rculist.h> #include <linux/mutex.h> +#include <linux/types.h> struct netns_packet { struct mutex sklist_lock;