All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/mtdev2tuio: fix build with musl 1.2.0
Date: Sat, 25 Apr 2020 12:48:16 +0200	[thread overview]
Message-ID: <20200425104816.1229406-1-fontaine.fabrice@gmail.com> (raw)

Fixes:
 - http://autobuild.buildroot.org/results/a30823f1388f37820d8a4f29b9b2c1de9b3992ac

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...dev2tuio.c-fix-build-with-musl-1.2.0.patch | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 package/mtdev2tuio/0002-mtdev2tuio.c-fix-build-with-musl-1.2.0.patch

diff --git a/package/mtdev2tuio/0002-mtdev2tuio.c-fix-build-with-musl-1.2.0.patch b/package/mtdev2tuio/0002-mtdev2tuio.c-fix-build-with-musl-1.2.0.patch
new file mode 100644
index 0000000000..24ceff52ee
--- /dev/null
+++ b/package/mtdev2tuio/0002-mtdev2tuio.c-fix-build-with-musl-1.2.0.patch
@@ -0,0 +1,57 @@
+From 6fb492ba72b4ecbe5ebba44647e838fb998ee061 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 25 Apr 2020 12:19:32 +0200
+Subject: [PATCH] mtdev2tuio.c: fix build with musl 1.2.0
+
+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: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/olivopaolo/mtdev2tuio/pull/6]
+---
+ mtdev2tuio.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/mtdev2tuio.c b/mtdev2tuio.c
+index 3a9174f..fced70c 100644
+--- a/mtdev2tuio.c
++++ b/mtdev2tuio.c
+@@ -47,8 +47,13 @@
+ 
+ typedef __u64 nstime;
+ 
+-static inline __u64 timeval_to_ns(const struct timeval *tv) {
+-  return ((__u64) tv->tv_sec * NSEC_PER_SEC) + tv->tv_usec * NSEC_PER_USEC ;
++#ifndef input_event_sec
++#define input_event_sec time.tv_sec
++#define input_event_usec time.tv_usec
++#endif
++
++static inline __u64 timeval_to_ns(const struct input_event *ev) {
++  return ((__u64) ev->input_event_sec * NSEC_PER_SEC) + ev->input_event_usec * NSEC_PER_USEC ;
+ }
+ 
+ static float calc_speed(float s, float s_1, nstime t, nstime t_1) {
+@@ -159,7 +164,7 @@ static void process_event(struct state_t *s, struct device_t *d, const struct in
+       case ABS_MT_POSITION_X:
+ 	s->slot[s->cs].x_1 = s->slot[s->cs].x ;
+ 	s->slot[s->cs].x = (ev->value - d->x_ofs) * d->x_scale ;
+-	time = timeval_to_ns(&ev->time) ;
++	time = timeval_to_ns(ev) ;
+ 	s->slot[s->cs].X = calc_speed(s->slot[s->cs].x, s->slot[s->cs].x_1, time, s->slot[s->cs].t_x) ;
+ 	s->slot[s->cs].t_x = time ;
+ 	// this slot has been changed
+@@ -168,7 +173,7 @@ static void process_event(struct state_t *s, struct device_t *d, const struct in
+       case ABS_MT_POSITION_Y :
+ 	s->slot[s->cs].y_1 = s->slot[s->cs].y ;
+ 	s->slot[s->cs].y = (ev->value - d->y_ofs) * d->y_scale ;
+-	time = timeval_to_ns(&ev->time) ;
++	time = timeval_to_ns(ev) ;
+ 	s->slot[s->cs].Y = calc_speed(s->slot[s->cs].y, s->slot[s->cs].y_1, time, s->slot[s->cs].t_y) ;
+ 	s->slot[s->cs].t_y = time ;
+ 	// this slot has been changed
+-- 
+2.25.1
+
-- 
2.25.1

             reply	other threads:[~2020-04-25 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 10:48 Fabrice Fontaine [this message]
2020-04-25 20:16 ` [Buildroot] [PATCH 1/1] package/mtdev2tuio: fix build with musl 1.2.0 Thomas Petazzoni
2020-05-09 12:58   ` Stephan Hoffmann
2020-05-09 14:08     ` Fabrice Fontaine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200425104816.1229406-1-fontaine.fabrice@gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.