From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E32BC4338F for ; Sun, 25 Jul 2021 05:46:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F8AD60720 for ; Sun, 25 Jul 2021 05:46:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0F8AD60720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jRBvly8LXs3Q45NSePz9U4DzuODGyjRzxVuDiBfdKFw=; b=MHWy30DTqVgxdw Dt6O2y4F2r71x/HrVYFbDWLYOJr7E4mvQjiTkBkYmxBOz6Xr9BKRK2g6cE0qE0MPJwscYnCej7Dzx pJMjHptjwT6XYlf9cVZ6PsvJYhG0QmyXCUc7V827JJKmv3kqbkTpy1e7Mo3SP3+WAeVOVSQ+pcLys 8043lrvbC+4u5blfjiHcZ4xHFA3xyJAmQ5ieVKr2xEk1uNsyPXFHK6+yPyzMBM5Le7ZCbJnudxKCy e10OnTz9Dejh/KUKeoJNUiBNUW3JKYK3A0ycnTyyqYIYbsnabsIEtFmXueGL86KScLLwA/5frNBa9 EBGHih/frWn3IrQHqJ7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7Wvs-008Efd-GR; Sun, 25 Jul 2021 05:44:12 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7Wvp-008EfF-EJ for linux-arm-kernel@lists.infradead.org; Sun, 25 Jul 2021 05:44:10 +0000 Received: by mail-ej1-x636.google.com with SMTP id nb11so10209268ejc.4 for ; Sat, 24 Jul 2021 22:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QY+0BMkWlbBZLf8NjCu4UdB1W7Kp1V1Npts+uGib5k0=; b=OfKZvg5r05dTZaCPK0J/uk+0iq15RC9aVhh+9wIn3Do1byv+UFxgsOcGbtaLwKOvpj shkfpu7yLasiWRO875xuBO62BFWrWFuO12hDAb9oIitKl6xaeQ2eOIcnOq3kKyn5OHi6 NHqT/DyjCwv/DuaZedahmVWF5bXGePbfEs5ECMtoLG9jQsAdWnhwhk3mAr5jYPVBx72H WpK5Oszt+rWg/JjqOyMhNNsDj2XrcVlb8ChRzP/klbouEavFxiQpqBaNg+aOgDnBHf40 5/f6yhT4HkfaqkTHQltP/s7TgsLx+J/WyNWFnLlSzJssNNFZ6eLwsgpnEnHG4G2tG+t6 CWsA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=QY+0BMkWlbBZLf8NjCu4UdB1W7Kp1V1Npts+uGib5k0=; b=kbvM1RuVFtIZ3z3+Lv2iz2tbn/zeiiQc4Iq2pZb/VTHy9rEGJQGgmpexRm0z91sin2 GW7IhQKXkYpAmTUZYyh4l9sG8Y9+IrNX7lvvtMTcwa7FczXn6ABhCCF7HQ6dz29XyCa9 TeM+tBU+FjMhvdTMrw/OvKqqhxrfXod9FUL0YYrtS5cVTuE4aqivF8aLmTooFLCuoN2j 8KzwhnpAazALNHVtejveIU+WBmka1jtVqpiETXfl2K3R5fVCL1FzSR7nvx/RPGfE0r9T LSSoiqP/Hc1SeTeJEtfAiwa/xS/cqbDIV9d0EvBUySDB/KYo6QFVohhbxL/O1g/sEE4z KMFw== X-Gm-Message-State: AOAM530NG+Mb5DkWWXo32Ma1tsMoOAjLjUz8iX+yyNCBVtvzC8K+ywdk 8pdckFiU5PbUF4WbBGhlbD8= X-Google-Smtp-Source: ABdhPJznzroxcAGpmNL3owvGqD5iDjbHdakw9PGzF8T5rjlETybHcPm7OqrxGEby6yJN4NtOxlbqsA== X-Received: by 2002:a17:906:24d3:: with SMTP id f19mr654767ejb.391.1627191847250; Sat, 24 Jul 2021 22:44:07 -0700 (PDT) Received: from kista.localnet (cpe-86-58-46-198.static.triera.net. [86.58.46.198]) by smtp.gmail.com with ESMTPSA id op23sm13069188ejb.7.2021.07.24.22.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 22:44:06 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Maxime Ripard , Chen-Yu Tsai , Andre Przywara Cc: Rob Herring , Icenowy Zheng , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Ondrej Jirman , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: Re: [PATCH v8 03/11] rtc: sun6i: Fix time overflow handling Date: Sun, 25 Jul 2021 07:44:05 +0200 Message-ID: <2672991.hCPy0aSqvS@kista> In-Reply-To: <20210723153838.6785-4-andre.przywara@arm.com> References: <20210723153838.6785-1-andre.przywara@arm.com> <20210723153838.6785-4-andre.przywara@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210724_224409_556270_FE794D8E X-CRM114-Status: GOOD ( 16.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andre! Dne petek, 23. julij 2021 ob 17:38:30 CEST je Andre Przywara napisal(a): > Using "unsigned long" for UNIX timestamps is never a good idea, and > comparing the value of such a variable against U32_MAX does not do > anything useful on 32-bit systems. > > Use the proper time64_t type when dealing with timestamps, and avoid > cutting down the time range unnecessarily. This also fixes the flawed > check for the alarm time being too far into the future. > > The check for this condition is actually somewhat theoretical, as the > RTC counts till 2033 only anyways, and 2^32 seconds from now is not > before the year 2157 - at which point I hope nobody will be using this > hardware anymore. > > Signed-off-by: Andre Przywara > --- > drivers/rtc/rtc-sun6i.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) Reviewed-by: Jernej Skrabec Best regards, Jernej _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel