From nobody Sun May 19 13:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601625443; cv=none; d=zohomail.com; s=zohoarc; b=U1Aym+9bX7p0nHSDHMNh6F4qq/r1swND3kMJOAwWs5jEy23RBYK1oOm0dyLGuhbNVTwdcTCz/G7LUw7EEinjJoSLYmtPz3vNQZyXFaC7x2kYEp46Q/hrJZuXfGbJK7q80ZD7tFpA/h0B7+d6s9STykRR01mcZAmrpxY9aO2FKrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601625443; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=GUZ3nahLtsN6ysOXUaTD5/IBM8hbjZ2M6e1FnNyYS/s=; b=EDLw9B6tDSiMQaGzamumjbDHx65njBOIC4z4/uGjdsVmv6N8ZzrLX2SoEY8nxY9D7adsRQ9NQgQFEZmHEuEIkv1bGb8Ne0dSQ6pY1/dk20PYHvhISdmhiD41k/87EF4FVPWEXSzxNT03d2ANB5m8Vi7O7QDFcFILkpwmPMzCLMU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601625443566280.3952715921439; Fri, 2 Oct 2020 00:57:23 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-78-im7j9RBFNQ6BDilKWNkdZw-1; Fri, 02 Oct 2020 03:57:20 -0400 Received: by mail-wr1-f71.google.com with SMTP id u15so257221wrn.4 for ; Fri, 02 Oct 2020 00:57:20 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id g14sm802943wrv.25.2020.10.02.00.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 00:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601625442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GUZ3nahLtsN6ysOXUaTD5/IBM8hbjZ2M6e1FnNyYS/s=; b=csaxUOVskfS9eCJ9PeJYDvrbo0uBTQgRmFXGj+cq1ngBVzaPrCjJt5P2siBiAGY0kGsFCi Zzv0GdpvQ57ykO0Cb2qP5cg6J0aKMuT34aNMqqcWVZE/dqR/pjUOUV3UIDR/ztzfoRcFdD Lwlin61W9sOWHdrB5JCCijR7TfGncWA= X-MC-Unique: im7j9RBFNQ6BDilKWNkdZw-1 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=GUZ3nahLtsN6ysOXUaTD5/IBM8hbjZ2M6e1FnNyYS/s=; b=M0GRyVEQpCgPMkSorp2NYR2bUsWGj23s18+gbba9SbXmlwVDzP77VeSfRNdBU5PLZe i1D+ix6SOdHhUC3e42hE68UaToTbNTkFfqouLvq/YvDNJaBI/7TbLkYcCApHhBgoROUo QfKF79kus1mWOJGqoLpUdFo1NQOI2tyxSoMDDP2vVlm7PnqpM4yDN/Ea1zfHS66ihXx2 DU0P7cz/JZ4EayrlJopShaozMEEv1H4maaaoTpYMJhixSZGywe9WEsrFvPtiP8RaYQ4C qcJgrp9qWjdoMyhIKPmmdy9zuM7HAvRvM/qzouSNhpfqtr1MdkFdP3NGwe1PjBcDnjeK JeLA== X-Gm-Message-State: AOAM532udhLyJb6E9qS+fs2pBzmgeskCYnT8Y3Kl2n2jtxd7yurKDOcQ yz42s61s9TKuL7biqUlAfMXeJ1XVJcc50URvZPzfII0ClZp1Q8F1OVrO/1SSuyU3Yd84grLbl+F DZK/YkVtk8hWbhA== X-Received: by 2002:adf:e690:: with SMTP id r16mr1484177wrm.15.1601625439425; Fri, 02 Oct 2020 00:57:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkCX3qCe54u1P+ctBCOUhXnodSBAE5w3a9lLFpCTlRGMggsdzPcKIlXvdsYjWUyoKNcccwFA== X-Received: by 2002:adf:e690:: with SMTP id r16mr1484163wrm.15.1601625439195; Fri, 02 Oct 2020 00:57:19 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Keith Busch , Max Reitz , Klaus Jensen , Kevin Wolf , qemu-block@nongnu.org, qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] hw/block/nvme: Simplify timestamp sum Date: Fri, 2 Oct 2020 09:57:16 +0200 Message-Id: <20201002075716.1657849-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) As the 'timestamp' variable is declared as a 48-bit bitfield, we do not need to wrap the sum result. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Klaus Jensen --- hw/block/nvme.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 63078f6009..44fa5b9076 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1280,12 +1280,7 @@ static inline uint64_t nvme_get_timestamp(const Nvme= Ctrl *n) =20 union nvme_timestamp ts; ts.all =3D 0; - - /* - * If the sum of the Timestamp value set by the host and the elapsed - * time exceeds 2^48, the value returned should be reduced modulo 2^48. - */ - ts.timestamp =3D (n->host_timestamp + elapsed_time) & 0xffffffffffff; + ts.timestamp =3D n->host_timestamp + elapsed_time; =20 /* If the host timestamp is non-zero, set the timestamp origin */ ts.origin =3D n->host_timestamp ? 0x01 : 0x00; --=20 2.26.2