diff mbox series

[2/3] media: v4l2-core: combine code chunks under macro condition together

Message ID 20210728100624.16129-3-dafna.hirschfeld@collabora.com
State New
Headers show
Series media: v4l2-ctl: Add support to VIDIOC_DQEVENT_TIME32 on non x86_64 arch | expand

Commit Message

Dafna Hirschfeld July 28, 2021, 10:06 a.m. UTC
The struct v4l2_event32_time32 and the function put_v4l2_event32_time32
are both defined under the condition 'ifdef CONFIG_COMPAT_32BIT_TIME'.
In order to make the code more readable, move both definitions under
one 'ifdef'.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 30 +++++++++----------
 1 file changed, 14 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 47aff3b19742..5623003a9705 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -765,21 +765,6 @@  struct v4l2_event32 {
 	__u32				reserved[8];
 };
 
-#ifdef CONFIG_COMPAT_32BIT_TIME
-struct v4l2_event32_time32 {
-	__u32				type;
-	union {
-		compat_s64		value64;
-		__u8			data[64];
-	} u;
-	__u32				pending;
-	__u32				sequence;
-	struct old_timespec32		timestamp;
-	__u32				id;
-	__u32				reserved[8];
-};
-#endif
-
 static int put_v4l2_event32(struct v4l2_event *p64,
 			    struct v4l2_event32 __user *p32)
 {
@@ -796,6 +781,19 @@  static int put_v4l2_event32(struct v4l2_event *p64,
 }
 
 #ifdef CONFIG_COMPAT_32BIT_TIME
+struct v4l2_event32_time32 {
+	__u32				type;
+	union {
+		compat_s64		value64;
+		__u8			data[64];
+	} u;
+	__u32				pending;
+	__u32				sequence;
+	struct old_timespec32		timestamp;
+	__u32				id;
+	__u32				reserved[8];
+};
+
 static int put_v4l2_event32_time32(struct v4l2_event *p64,
 				   struct v4l2_event32_time32 __user *p32)
 {
@@ -811,7 +809,7 @@  static int put_v4l2_event32_time32(struct v4l2_event *p64,
 	return 0;
 }
 #endif
-#endif
+#endif /* CONFIG_X86_64 */
 
 struct v4l2_edid32 {
 	__u32 pad;