Re: [PATCH] staging: comedi: shrink comedi_compat32.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-06-19 10:38, Ian Abbott wrote:
"comedi_compat32.h" #include's <linux/compat.h>, but that is only needed
by "comedi_compat32.c" so move the #include to that file.  Also,
"comedi_compat.h" doesn't really need the '#include <linux/fs.h>' just
to declare 'struct file' as it only uses it to construct a pointer to
that type.  Replace that #include with an incomplete declaration of
'struct file'.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
  drivers/staging/comedi/comedi_compat32.c |    1 +
  drivers/staging/comedi/comedi_compat32.h |    4 +---
  2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
index 41a7a62..137d086 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -26,6 +26,7 @@

  #define __NO_VERSION__
  #include <linux/uaccess.h>
+#include <linux/compat.h>
  #include "comedi.h"
  #include "comedi_compat32.h"

diff --git a/drivers/staging/comedi/comedi_compat32.h b/drivers/staging/comedi/comedi_compat32.h
index 0340a89..5dd6c73 100644
--- a/drivers/staging/comedi/comedi_compat32.h
+++ b/drivers/staging/comedi/comedi_compat32.h
@@ -27,11 +27,9 @@
  #ifndef _COMEDI_COMPAT32_H
  #define _COMEDI_COMPAT32_H

-#include <linux/compat.h>
-#include <linux/fs.h>
-
  #ifdef CONFIG_COMPAT

+struct file;
  extern long comedi_compat_ioctl(struct file *file, unsigned int cmd,
  				unsigned long arg);

Actually, because I removed '#include <linux/fs.h>' from "comedi_compat32.h", I should probably add it to "comedi_compat32.c", even though it seems to compile fine without it. Better safe than sorry! Expect a v2 version of this patch shortly.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux