public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] [media] remove include/linux/dvb/dmx.h
@ 2012-10-19 10:43 Mauro Carvalho Chehab
  2012-10-19 10:43 ` [PATCH 2/2] [media] Remove include/linux/dvb/ stuff Mauro Carvalho Chehab
       [not found] ` <20121019082116.145ebe92@redhat.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2012-10-19 10:43 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

The only reason for this header is to make sure that include
linux/time.h were added before uapi/*/dmx.h. Just push down the
time.h header on the few places where this is used, and drop
this new header.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb-core/dmxdev.h    |  1 +
 drivers/media/firewire/firedtv.h   |  1 +
 drivers/media/pci/ttpci/av7110.h   |  1 +
 drivers/media/usb/tlg2300/pd-dvb.c |  1 +
 include/linux/dvb/dmx.h            | 29 -----------------------------
 5 files changed, 4 insertions(+), 29 deletions(-)
 delete mode 100644 include/linux/dvb/dmx.h

diff --git a/drivers/media/dvb-core/dmxdev.h b/drivers/media/dvb-core/dmxdev.h
index 02ebe28..48c6cf9 100644
--- a/drivers/media/dvb-core/dmxdev.h
+++ b/drivers/media/dvb-core/dmxdev.h
@@ -26,6 +26,7 @@
 #include <linux/types.h>
 #include <linux/spinlock.h>
 #include <linux/kernel.h>
+#include <linux/time.h>
 #include <linux/timer.h>
 #include <linux/wait.h>
 #include <linux/fs.h>
diff --git a/drivers/media/firewire/firedtv.h b/drivers/media/firewire/firedtv.h
index 4fdcd8c..c2ba085 100644
--- a/drivers/media/firewire/firedtv.h
+++ b/drivers/media/firewire/firedtv.h
@@ -13,6 +13,7 @@
 #ifndef _FIREDTV_H
 #define _FIREDTV_H
 
+#include <linux/time.h>
 #include <linux/dvb/dmx.h>
 #include <linux/dvb/frontend.h>
 #include <linux/list.h>
diff --git a/drivers/media/pci/ttpci/av7110.h b/drivers/media/pci/ttpci/av7110.h
index 88b3b2d..a378662 100644
--- a/drivers/media/pci/ttpci/av7110.h
+++ b/drivers/media/pci/ttpci/av7110.h
@@ -6,6 +6,7 @@
 #include <linux/netdevice.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
+#include <linux/time.h>
 
 #include <linux/dvb/video.h>
 #include <linux/dvb/audio.h>
diff --git a/drivers/media/usb/tlg2300/pd-dvb.c b/drivers/media/usb/tlg2300/pd-dvb.c
index 30fcb11..ca4994a 100644
--- a/drivers/media/usb/tlg2300/pd-dvb.c
+++ b/drivers/media/usb/tlg2300/pd-dvb.c
@@ -1,6 +1,7 @@
 #include "pd-common.h"
 #include <linux/kernel.h>
 #include <linux/usb.h>
+#include <linux/time.h>
 #include <linux/dvb/dmx.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
deleted file mode 100644
index 0be6d8f..0000000
--- a/include/linux/dvb/dmx.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * dmx.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
- *                  & Ralph  Metzler <ralph@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-#ifndef _DVBDMX_H_
-#define _DVBDMX_H_
-
-#include <linux/time.h>
-#include <uapi/linux/dvb/dmx.h>
-
-#endif /*_DVBDMX_H_*/
-- 
1.7.11.7


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

* [PATCH 2/2] [media] Remove include/linux/dvb/ stuff
  2012-10-19 10:43 [PATCH 1/2] [media] remove include/linux/dvb/dmx.h Mauro Carvalho Chehab
@ 2012-10-19 10:43 ` Mauro Carvalho Chehab
       [not found] ` <20121019082116.145ebe92@redhat.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2012-10-19 10:43 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

The only file left there is include/linux/dvb/video.h. The
only function for it is to include linux/compiler.h, but this
is already indirectly included. So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 include/linux/dvb/video.h | 29 -----------------------------
 1 file changed, 29 deletions(-)
 delete mode 100644 include/linux/dvb/Kbuild
 delete mode 100644 include/linux/dvb/video.h

diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild
deleted file mode 100644
index e69de29..0000000
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
deleted file mode 100644
index 85c20d9..0000000
--- a/include/linux/dvb/video.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * video.h
- *
- * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
- *                  & Ralph  Metzler <ralph@convergence.de>
- *                    for convergence integrated media GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- */
-#ifndef _DVBVIDEO_H_
-#define _DVBVIDEO_H_
-
-#include <linux/compiler.h>
-#include <uapi/linux/dvb/video.h>
-
-#endif /*_DVBVIDEO_H_*/
-- 
1.7.11.7


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

* [RFC] linux/time.h vs. sys/time.h mess (was [PATCH 1/2] [media] remove include/linux/dvb/dmx.h)
       [not found] ` <20121019082116.145ebe92@redhat.com>
@ 2012-10-19 12:20   ` Laurent Pinchart
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2012-10-19 12:20 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-kernel, Linux Media Mailing List

Hi Mauro,

(CC'ing LKML)

On Friday 19 October 2012 08:21:16 Mauro Carvalho Chehab wrote:
> Em Fri, 19 Oct 2012 07:43:11 -0300
> 
> Mauro Carvalho Chehab <mchehab@redhat.com> escreveu:
> > -#include <linux/time.h>
> > -#include <uapi/linux/dvb/dmx.h>
> > -
> > -#endif /*_DVBDMX_H_*/
> 
> Just to not discard a valid comment on IRC, Laurent proposed that we
> should investigate if we can, instead, move:
> 
> 	#include <linux/time.h>
> 
> to both dmx.h and videodev2.h, letting it to be included by both userspace
> and Kernelspace.
> 
> I remember this used to cause compilation breakage in the past, as some
> userspace programs need to include <sys/time.h> and this used to conflict
> with <linux/time.h>.
> 
> I'm not sure if this got fixed there. if so, Laurent has a point.

It's still not solved, but that's what the proper fix should be.

Several UAPI headers use struct timeval or struct timespec. Kernel code and 
user space code thus need to include the header(s) that define those 
structures, either directly or indirectly.

In kernel space struct timeval and struct timespec are defined in 
include/uapi/linux/time.h. In user space they're defined in <sys/time.h>. No 
proper conditional compilation exists in those headers to guard against 
multiple definitions, so they can't be included together.

On the kernel side <sys/time.h> isn't available, so we can include 
<linux/time.h> in the headers that use the timeval and timespec structures. 
This "self-contained" headers mechanism avoids forcing all users of those 
headers to explicitly include <linux/time.h>.

However, this then breaks user space applications that include both 
<sys/time.h> and a kernel header that includes <linux/time.h>. The way we've 
dealt with that until now is by including either <linux/time.h> or 
<sys/time.h> depending on __KERNEL__

#ifdef __KERNEL__
#include <linux/time.h>
#else
#include <sys/kernel.h>
#endif

in our user-facing headers. The recent UAPI disintegration patches resulted in 
nearly empty headers in include/linux/ that just #include both <linux/time.h> 
and the corresponding UAPI header. For instance include/linux/videodev2.h is 
now just

#ifndef __LINUX_VIDEODEV2_H
#define __LINUX_VIDEODEV2_H

#include <linux/time.h>     /* need struct timeval */
#include <uapi/linux/videodev2.h>

#endif /* __LINUX_VIDEODEV2_H */

Patches have been posted to remove those headers and push the #include 
<linux/time.h> one level up, which breaks the "self-contained" headers 
concept.

How could we fix this ? Are there legitimate users of <linux/time.h> in user 
space ? A quick grep in glibc doesn't reveal anything.

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2012-10-19 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 10:43 [PATCH 1/2] [media] remove include/linux/dvb/dmx.h Mauro Carvalho Chehab
2012-10-19 10:43 ` [PATCH 2/2] [media] Remove include/linux/dvb/ stuff Mauro Carvalho Chehab
     [not found] ` <20121019082116.145ebe92@redhat.com>
2012-10-19 12:20   ` [RFC] linux/time.h vs. sys/time.h mess (was [PATCH 1/2] [media] remove include/linux/dvb/dmx.h) Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox