Skip to contentSkip to conversation

headers: remove fs.h from poll.h

PATCH In review Alexey Dobriyan 2 participants 3 messages Aug 16, 2014 – Aug 17, 2014 1 message not in the archive

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 headers: remove fs.h from poll.h

* remove fs.h from poll.h
it is not necessary to include full header,

* fixup compilation with additional includes where needed.

Cross-compile tested on hundreds of configs across 15 archs.

---

 arch/m68k/bvme6000/rtc.c                    |    1 +
 arch/m68k/mvme16x/rtc.c                     |    1 +
 drivers/gpu/vga/vgaarb.c                    |    1 +
 drivers/input/serio/serio_raw.c             |    1 +
 drivers/misc/mic/host/mic_fops.c            |    1 +
 drivers/platform/goldfish/goldfish_pipe.c   |    1 +
 drivers/pps/pps.c                           |    1 +
 drivers/rtc/interface.c                     |    1 +
 drivers/rtc/rtc-dev.c                       |    1 +
 drivers/s390/char/monwriter.c               |    1 +
 drivers/staging/comedi/drivers/serial2002.c |    1 +
 drivers/vfio/pci/vfio_pci_intrs.c           |    1 +
 include/linux/poll.h                        |    3 ++-
 include/media/videobuf-core.h               |    2 ++
 include/sound/pcm.h                         |    1 +
 include/uapi/linux/rtc.h                    |    1 +
 sound/core/control.c                        |    1 +
 sound/core/hwdep.c                          |    1 +
 sound/core/init.c                           |    1 +
 sound/core/oss/mixer_oss.c                  |    1 +
 sound/core/rawmidi.c                        |    1 +
 sound/core/seq/oss/seq_oss.c                |    1 +
 sound/core/seq/oss/seq_oss_init.c           |    1 +
 sound/core/seq/seq_clientmgr.c              |    1 +
 sound/core/sound.c                          |    1 +
 sound/core/timer.c                          |    1 +
 sound/isa/wavefront/wavefront_fx.c          |    1 +
 sound/isa/wavefront/wavefront_synth.c       |    1 +
 28 files changed, 30 insertions(+), 1 deletion(-)
arch/m68k/bvme6000/rtc.c +1 -0
@@ -12,6 +12,7 @@
 #include <linux/ioport.h>
 #include <linux/capability.h>
 #include <linux/fcntl.h>
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/module.h>
arch/m68k/mvme16x/rtc.c +1 -0
@@ -12,6 +12,7 @@
 #include <linux/ioport.h>
 #include <linux/capability.h>
 #include <linux/fcntl.h>
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <linux/mc146818rtc.h>	/* For struct rtc_time and ioctls, etc */
drivers/gpu/vga/vgaarb.c +1 -0
@@ -29,6 +29,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
drivers/input/serio/serio_raw.c +1 -0
@@ -9,6 +9,7 @@
  * the Free Software Foundation.
  */
 
+#include <linux/fs.h>
 #include <linux/kref.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
drivers/misc/mic/host/mic_fops.c +1 -0
@@ -18,6 +18,7 @@
  * Intel MIC Host driver.
  *
  */
+#include <linux/fs.h>
 #include <linux/poll.h>
 #include <linux/pci.h>
 
drivers/platform/goldfish/goldfish_pipe.c +1 -0
@@ -45,6 +45,7 @@
  * exchange is properly mapped during a transfer.
  */
 
+#include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
drivers/pps/pps.c +1 -0
@@ -21,6 +21,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/rtc/interface.c +1 -0
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
 */
 
+#include <linux/fs.h>
 #include <linux/rtc.h>
 #include <linux/sched.h>
 #include <linux/module.h>
drivers/rtc/rtc-dev.c +1 -0
@@ -13,6 +13,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/rtc.h>
 #include <linux/sched.h>
drivers/s390/char/monwriter.c +1 -0
@@ -9,6 +9,7 @@
 #define KMSG_COMPONENT "monwriter"
 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
 
+#include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
drivers/staging/comedi/drivers/serial2002.c +1 -0
@@ -26,6 +26,7 @@ Status: in development
 
 */
 
+#include <linux/fs.h>
 #include <linux/module.h>
 #include "../comedidev.h"
 
drivers/vfio/pci/vfio_pci_intrs.c +1 -0
@@ -14,6 +14,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/eventfd.h>
 #include <linux/pci.h>
include/linux/poll.h +2 -1
@@ -6,11 +6,12 @@
 #include <linux/ktime.h>
 #include <linux/wait.h>
 #include <linux/string.h>
-#include <linux/fs.h>
 #include <linux/sysctl.h>
 #include <asm/uaccess.h>
 #include <uapi/linux/poll.h>
 
+struct file;
+
 extern struct ctl_table epoll_table[]; /* for sysctl */
 /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
    additional memory. */
include/media/videobuf-core.h +2 -0
@@ -16,6 +16,7 @@
 #ifndef _VIDEOBUF_CORE_H
 #define _VIDEOBUF_CORE_H
 
+#include <linux/mutex.h>
 #include <linux/poll.h>
 #include <linux/videodev2.h>
 
@@ -24,6 +25,7 @@
 
 struct videobuf_buffer;
 struct videobuf_queue;
+struct vm_area_struct;
 
 /* --------------------------------------------------------------------- */
 
include/sound/pcm.h +1 -0
@@ -26,6 +26,7 @@
 #include <sound/asound.h>
 #include <sound/memalloc.h>
 #include <sound/minors.h>
+#include <linux/fs.h>
 #include <linux/poll.h>
 #include <linux/mm.h>
 #include <linux/bitops.h>
include/uapi/linux/rtc.h +1 -0
@@ -10,6 +10,7 @@
  */
 #ifndef _UAPI_LINUX_RTC_H_
 #define _UAPI_LINUX_RTC_H_
+#include <linux/ioctl.h>
 
 /*
  * The struct used to pass data via the following ioctl. Similar to the
sound/core/control.c +1 -0
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/threads.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
sound/core/hwdep.c +1 -0
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/major.h>
 #include <linux/init.h>
 #include <linux/slab.h>
sound/core/init.c +1 -0
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/module.h>
sound/core/oss/mixer_oss.c +1 -0
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/time.h>
sound/core/rawmidi.c +1 -0
@@ -20,6 +20,7 @@
  */
 
 #include <sound/core.h>
+#include <linux/fs.h>
 #include <linux/major.h>
 #include <linux/init.h>
 #include <linux/sched.h>
sound/core/seq/oss/seq_oss.c +1 -0
@@ -20,6 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
sound/core/seq/oss/seq_oss_init.c +1 -0
@@ -27,6 +27,7 @@
 #include "seq_oss_readq.h"
 #include "seq_oss_timer.h"
 #include "seq_oss_event.h"
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/moduleparam.h>
sound/core/seq/seq_clientmgr.c +1 -0
@@ -21,6 +21,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/slab.h>
sound/core/sound.c +1 -0
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/time.h>
sound/core/timer.c +1 -0
@@ -20,6 +20,7 @@
  */
 
 #include <linux/delay.h>
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/time.h>
sound/isa/wavefront/wavefront_fx.c +1 -0
@@ -17,6 +17,7 @@
  */
 
 #include <asm/io.h>
+#include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/wait.h>
sound/isa/wavefront/wavefront_synth.c +1 -0
@@ -21,6 +21,7 @@
  */
 
 #include <asm/io.h>
+#include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/delay.h>

A message that is not in the archive (sent off-list or not yet received): CA+55aFw3B=USNMLdehm+hv9fVWE1yaR42a2y8udcE8QvJfbSPA@mail.gmail.com

#2 lore raw
Quoted 6 lines · Linus Torvalds

Doors this actually help anything? fs.h tends to get included other ways anyway, and the double inclusion protection means that the compiler doesn't even spend extra time on it..

IOW, I'd like to see "this improves compile times by xyz" or some other explanation.

This particular patch doesn't change situation because it is so small and removes only one header from one file.

I can send bigger patch removing fs.h from many possible places.

Alexey

#3 lore raw
Quoted 4 lines · Alexey Dobriyan
Quoted 4 lines

Doors this actually help anything? fs.h tends to get included other ways anyway, and the double inclusion protection means that the compiler doesn't even spend extra time on it..

Quoted 8 lines
Quoted 2 lines

IOW, I'd like to see "this improves compile times by xyz" or some other explanation.

This particular patch doesn't change situation because it is so small and removes only one header from one file.

I can send bigger patch removing fs.h from many possible places.

I extensively build tested your series before and reported the single point of failure. Once that's fixed and the patches have appropriate changelogs and signed-off-by lines then I can build test and push them for either Andrew or Linus.