netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: drop unnecessary networking includes
@ 2023-02-03 23:31 Jakub Kicinski
  2023-02-15  2:41 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2023-02-03 23:31 UTC (permalink / raw)
  To: mchehab
  Cc: netdev, Jakub Kicinski, hverkuil, gregkh, linux-media, linux-staging

dvb_net.h includes a bunch of core networking headers which increases
the number of objects rebuilt when we touch them. They are unnecessary
for the header itself and only one driver has an indirect dependency.

tveeprom.h includes if_packet to gain access to ETH_ALEN. This
is a bit of an overkill because if_packet.h pulls in skbuff.h.
The definition of ETH_ALEN is in the uAPI header, which is
very rarely touched, so switch to including that.

This results in roughly 250 fewer objects built when skbuff.h
is touched (6028 -> 5788).

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: mchehab@kernel.org
CC: hverkuil@xs4all.nl
CC: gregkh@linuxfoundation.org
CC: linux-media@vger.kernel.org
CC: linux-staging@lists.linux.dev
---
 drivers/media/usb/dvb-usb/pctv452e.c                       | 2 ++
 drivers/staging/media/deprecated/saa7146/ttpci/budget-av.c | 1 +
 include/media/dvb_net.h                                    | 6 ++----
 include/media/tveeprom.h                                   | 2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/pctv452e.c b/drivers/media/usb/dvb-usb/pctv452e.c
index f0794c68c622..da42c989e071 100644
--- a/drivers/media/usb/dvb-usb/pctv452e.c
+++ b/drivers/media/usb/dvb-usb/pctv452e.c
@@ -26,6 +26,8 @@
 #include <media/dvb_ca_en50221.h>
 #include "ttpci-eeprom.h"
 
+#include <linux/etherdevice.h>
+
 static int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
diff --git a/drivers/staging/media/deprecated/saa7146/ttpci/budget-av.c b/drivers/staging/media/deprecated/saa7146/ttpci/budget-av.c
index 0c61a2dec221..3cc762100498 100644
--- a/drivers/staging/media/deprecated/saa7146/ttpci/budget-av.c
+++ b/drivers/staging/media/deprecated/saa7146/ttpci/budget-av.c
@@ -31,6 +31,7 @@
 #include "dvb-pll.h"
 #include "../common/saa7146_vv.h"
 #include <linux/module.h>
+#include <linux/etherdevice.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
diff --git a/include/media/dvb_net.h b/include/media/dvb_net.h
index 5e31d37f25fa..9980b1dd750b 100644
--- a/include/media/dvb_net.h
+++ b/include/media/dvb_net.h
@@ -19,13 +19,11 @@
 #define _DVB_NET_H_
 
 #include <linux/module.h>
-#include <linux/netdevice.h>
-#include <linux/inetdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
 
 #include <media/dvbdev.h>
 
+struct net_device;
+
 #define DVB_NET_DEVICES_MAX 10
 
 #ifdef CONFIG_DVB_NET
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index b56eaee82aa5..f37c9b15ffdb 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -5,7 +5,7 @@
  *	      eeproms.
  */
 
-#include <linux/if_ether.h>
+#include <uapi/linux/if_ether.h>
 
 /**
  * enum tveeprom_audio_processor - Specifies the type of audio processor
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: drop unnecessary networking includes
  2023-02-03 23:31 [PATCH] media: drop unnecessary networking includes Jakub Kicinski
@ 2023-02-15  2:41 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2023-02-15  2:41 UTC (permalink / raw)
  To: mchehab; +Cc: netdev, hverkuil, gregkh, linux-media, linux-staging

On Fri,  3 Feb 2023 15:31:29 -0800 Jakub Kicinski wrote:
> dvb_net.h includes a bunch of core networking headers which increases
> the number of objects rebuilt when we touch them. They are unnecessary
> for the header itself and only one driver has an indirect dependency.
> 
> tveeprom.h includes if_packet to gain access to ETH_ALEN. This
> is a bit of an overkill because if_packet.h pulls in skbuff.h.
> The definition of ETH_ALEN is in the uAPI header, which is
> very rarely touched, so switch to including that.
> 
> This results in roughly 250 fewer objects built when skbuff.h
> is touched (6028 -> 5788).
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Hi Mauro! Could you take this in for 6.3?
Is it okay if we queue it via the networking tree otherwise?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-15  2:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-03 23:31 [PATCH] media: drop unnecessary networking includes Jakub Kicinski
2023-02-15  2:41 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).