From 5fc06ad92eaeb20e3b0afbc47a2436bf9038d942 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 30 Nov 2019 10:07:43 -0800
Subject: [PATCH] chromium: Fix build on 32bit arches with 64bit time_t

time element is deprecated on new input_event structure in kernel's
input.h [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 chromium/ui/events/ozone/evdev/event_converter_evdev.h     | 5 +++++
 chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/chromium/ui/events/ozone/evdev/event_converter_evdev.h b/chromium/ui/events/ozone/evdev/event_converter_evdev.h
index 2d184811a00..fb2ba0069f1 100644
--- a/chromium/ui/events/ozone/evdev/event_converter_evdev.h
+++ b/chromium/ui/events/ozone/evdev/event_converter_evdev.h
@@ -20,6 +20,11 @@
 #include "ui/events/ozone/evdev/event_dispatch_callback.h"
 #include "ui/gfx/geometry/size.h"
 
+#ifndef input_event_sec
+#define input_event_sec time.tv_sec
+#define input_event_usec time.tv_usec
+#endif
+
 struct input_event;
 
 namespace ui {
diff --git a/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc b/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc
index b8d089f7381..5d2d08b1ec6 100644
--- a/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc
+++ b/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc
@@ -62,8 +62,7 @@ void TouchEventLogEvdev::DumpLog(const char* filename) {
       continue;
     std::string event_string = base::StringPrintf(
         "E: %ld.%06ld %04x %04x %d %d\n", te->ev.input_event_sec,
-        te->ev.input_event_usec, te->ev.type, te->ev.code, te->ev.value,
-        te->slot);
+        te->ev.input_event_usec, te->ev.type, te->ev.code, te->ev.value, te->slot);
     report_content += event_string;
   }
   file.Write(0, report_content.c_str(), report_content.length());
