From nobody Sat May 4 05:49:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1605732006; cv=none; d=zohomail.com; s=zohoarc; b=D26S491VU+w4f7CVFDr6qGOe1LcJIPwtGvUSIEkWDSD8oir1qlVpGDOWOIK+wxS8BnyiUGwSiNRGLKQ2q64+o5K2KcODLhjFru0k7IlL70dK1dMBluxuhJV1B0Ud+TokntMJDILfNxi6GDGS+1ky51ZudzHQtOY2YNhRaujGBNI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605732006; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=dvR09NMMf4PZ1neOM0o3Gmh0k5nrtY9nkMGmznVxYeI=; b=K437NvGHrDssaL3HIgrEW17cD2mmvDYXtKbU7sBchIYM43pydtBWs+KWLJEDdKzNmBZV4G0OShdx06n7gkbkspxStnTZWPIa+cMZ5G/w4zl8FK21VSypPk0//zUPmyU85EcuTkVoDOngmZjO0y/KZqOnClBXGX7ETVVVEzv+F8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605732006900560.6246103675088; Wed, 18 Nov 2020 12:40:06 -0800 (PST) Received: from localhost ([::1]:39416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfUFJ-0001J4-70 for importer@patchew.org; Wed, 18 Nov 2020 15:40:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfUEJ-0000r5-0w for qemu-devel@nongnu.org; Wed, 18 Nov 2020 15:39:04 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:34395) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfUEE-00043S-Na for qemu-devel@nongnu.org; Wed, 18 Nov 2020 15:39:02 -0500 Received: by mail-wr1-x441.google.com with SMTP id r17so3569386wrw.1 for ; Wed, 18 Nov 2020 12:38:56 -0800 (PST) Received: from kali.home (2a01cb0881b76d00c2afd0dfa851d2b9.ipv6.abo.wanadoo.fr. [2a01:cb08:81b7:6d00:c2af:d0df:a851:d2b9]) by smtp.gmail.com with ESMTPSA id 34sm36508340wrq.27.2020.11.18.12.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 12:38:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dvR09NMMf4PZ1neOM0o3Gmh0k5nrtY9nkMGmznVxYeI=; b=b4vdHNDcZw4N4hYTMD0GiWlZCeZzhq8nMj9PgP76DC/REx0NO4mpgbGs1XJmrDcK4Z ipII2LTv1eBA+6+8SditO9C9hnQtqhbTyfZ8ubMIOHpYOhICYyC2ozKchsK3Ou5ou1f4 J4yyChR2o2HsI5+4NplzIYCKEyrukjzN8VxvsW+WvMZlyKdt+n/GFvJiHgxlp2artt3/ Njf0ZOYX9M2wckQcB5DlmlcIS7Ohg3nbBJnWA3zD9GdFIuRtP11hqsjs100njtEvVxMh spWHEsFshgMuTSCYEobJke+8DhF1IoIlPC0G6w2JVTdapbTMWGgSWZdmmWvufRGVzk6j p/0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dvR09NMMf4PZ1neOM0o3Gmh0k5nrtY9nkMGmznVxYeI=; b=jmuazjSGbTYLGHVpfkIJWAax9xceqZn7MvemhooPDrnltL7GBTiMoybY0nU26l2vCd xcjFH37e+p6XXI+lTqeTAK15U1YdgYSlSpm75EhSahh5VJIKBUhdTDU15WZd4bz9Pe2a WK3H2/er8blMXQbBtPtIWTytecP8NbvfjCFgRl1tvg6f2V0PvQ/ktLqFHvBo3hkLbClk T/NURDTYKxA1m3wtU+3Vdq7P6B8GGqD8mlur3jYPEIfNGE3i1nE6khSf7PDt8q7BqSY+ p32n51r2T3KePvP4QdoNAG6DJ3rhIFIhWEYzcywsu6PiCXX91iK6amGqqlekiyJO/BFW L20A== X-Gm-Message-State: AOAM530BWEIzPTRyAHJOeUgONMTCJREWN/IejxiekRrrQe++wQ17Dxq/ Nl4ayMiLY7KtBvoZNwmaRusYuamFe/uSfg== X-Google-Smtp-Source: ABdhPJy4BlaPbnB1HxByl7nK8SYHzpopCU5KJD3uMzbrUajftNL4qpM3DeVyv5eGNEnZKB+MIOx8Gw== X-Received: by 2002:a5d:4ec4:: with SMTP id s4mr6434617wrv.31.1605731934909; Wed, 18 Nov 2020 12:38:54 -0800 (PST) From: Fabrice Fontaine To: qemu-devel@nongnu.org Subject: [PATCH v2] Fix build with 64 bits time_t Date: Wed, 18 Nov 2020 21:38:24 +0100 Message-Id: <20201118203824.1624924-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=fontaine.fabrice@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine , Gerd Hoffmann , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" time element is deprecated on new input_event structure in kernel's input.h [1] This will avoid the following build failure: hw/input/virtio-input-host.c: In function 'virtio_input_host_handle_status': hw/input/virtio-input-host.c:198:28: error: 'struct input_event' has no mem= ber named 'time' 198 | if (gettimeofday(&evdev.time, NULL)) { | ^ Fixes: - http://autobuild.buildroot.org/results/a538167e288c14208d557cd45446df86d= 3d599d5 - http://autobuild.buildroot.org/results/efd4474fb4b6c0ce0ab3838ce130429c5= 1e43bbb [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it?id=3D152194fe9c3f Signed-off-by: Fabrice Fontaine --- Changes v1 -> v2 (after review of Michael S. Tsirkin): - Drop define of input_event_{sec,usec} as it is already done in=20 include/standard-headers/linux/input.h contrib/vhost-user-input/main.c | 5 ++++- hw/input/virtio-input-host.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/mai= n.c index 6020c6f33a..84de1f0b87 100644 --- a/contrib/vhost-user-input/main.c +++ b/contrib/vhost-user-input/main.c @@ -115,13 +115,16 @@ vi_evdev_watch(VuDev *dev, int condition, void *data) static void vi_handle_status(VuInput *vi, virtio_input_event *event) { struct input_event evdev; + struct timeval tval; int rc; =20 - if (gettimeofday(&evdev.time, NULL)) { + if (gettimeofday(&tval, NULL)) { perror("vi_handle_status: gettimeofday"); return; } =20 + evdev.input_event_sec =3D tval.tv_sec; + evdev.input_event_usec =3D tval.tv_usec; evdev.type =3D le16toh(event->type); evdev.code =3D le16toh(event->code); evdev.value =3D le32toh(event->value); diff --git a/hw/input/virtio-input-host.c b/hw/input/virtio-input-host.c index 85daf73f1a..137efba57b 100644 --- a/hw/input/virtio-input-host.c +++ b/hw/input/virtio-input-host.c @@ -193,13 +193,16 @@ static void virtio_input_host_handle_status(VirtIOInp= ut *vinput, { VirtIOInputHost *vih =3D VIRTIO_INPUT_HOST(vinput); struct input_event evdev; + struct timeval tval; int rc; =20 - if (gettimeofday(&evdev.time, NULL)) { + if (gettimeofday(&tval, NULL)) { perror("virtio_input_host_handle_status: gettimeofday"); return; } =20 + evdev.input_event_sec =3D tval.tv_sec; + evdev.input_event_usec =3D tval.tv_usec; evdev.type =3D le16_to_cpu(event->type); evdev.code =3D le16_to_cpu(event->code); evdev.value =3D le32_to_cpu(event->value); --=20 2.29.2