v4l: videodev2: Include linux/time.h for timeval and timespec structs
PATCH 1/1 v4l: videodev2: Include linux/time.h for timeval and timespec structs
struct timeval and struct timespec are defined in linux/time.h. Explicitly include the header if __KERNEL__ is defined.
--- include/uapi/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/videodev2.h +1 -0
@@ -61,6 +61,7 @@#endif #include <linux/compiler.h> #include <linux/ioctl.h> +#include <linux/time.h> #include <linux/types.h> #include <linux/v4l2-common.h> #include <linux/v4l2-controls.h>
Signature · 1 line
2.7.4
Em Thu, 27 Oct 2016 13:50:51 +0300
Sakari Ailus <[email protected]> escreveu:
Quoted 2 lines
struct timeval and struct timespec are defined in
linux/time.h. Explicitly include the header if__KERNEL__is defined.
The patch below doesn't do what you're mentioned above. It unconditionally include linux/time.h, and, for userspace, it will *also* include sys/time.h...
I suspect that this would cause problems on userspace.
Btw, you didn't mention on your description what's the bug you're trying to fix.
Quoted 11 lines
Signed-off-by Sakari Ailus <[email protected]>--- include/uapi/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+)include/uapi/linux/videodev2.h +0
-0
include/uapi/linux/videodev2.h line 67
Quoted 7 lines
include/uapi/linux/videodev2.h +1
-0@@ -61,6 +61,7 @@#endif #include <linux/compiler.h> #include <linux/ioctl.h> +#include <linux/time.h> #include <linux/types.h> #include <linux/v4l2-common.h> #include <linux/v4l2-controls.h>
Thanks,
Mauro
Hi Mauro,
Quoted 9 lines · Mauro Carvalho Chehab
Em Thu, 27 Oct 2016 13:50:51 +0300
Sakari Ailus <[email protected]> escreveu:Quoted 2 lines
struct timeval and struct timespec are defined in
linux/time.h. Explicitly include the header if__KERNEL__is defined.The patch below doesn't do what you're mentioned above. It unconditionally include
linux/time.h, and, for userspace, it will *also* includesys/time.h...
My bad... I thought writing a single line patch would be easy. ;-) Will fix.
Quoted 5 lines
I suspect that this would cause problems on userspace.
Btw, you didn't mention on your description what's the bug you're trying to fix.
The problem is a compiler error due to lacking defition for a struct. I'll add that to v2.
Signature · 4 lines
Regards, Sakari Ailus [email protected]
Em Mon, 21 Nov 2016 15:51:56 +0200
Sakari Ailus <[email protected]> escreveu:
Quoted 16 lines
Hi Mauro,
Quoted 9 lines · Mauro Carvalho Chehab
Em Thu, 27 Oct 2016 13:50:51 +0300
Sakari Ailus <[email protected]> escreveu:Quoted 2 lines
struct timeval and struct timespec are defined in
linux/time.h. Explicitly include the header if__KERNEL__is defined.The patch below doesn't do what you're mentioned above. It unconditionally include
linux/time.h, and, for userspace, it will *also* includesys/time.h...My bad... I thought writing a single line patch would be easy. ;-) Will fix.
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I suspect that this would cause problems on userspace.
Btw, you didn't mention on your description what's the bug you're trying to fix.
The problem is a compiler error due to lacking defition for a struct. I'll add that to v2.
On userspace or Kernelspace? Please be clear at version 2, adding the relevant info about how you got it.
Thanks,
Mauro