From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nCBLB-0002HF-Tf for mharc-grub-devel@gnu.org; Mon, 24 Jan 2022 21:13:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCBLA-0002Dl-5l for grub-devel@gnu.org; Mon, 24 Jan 2022 21:13:48 -0500 Received: from [2607:f8b0:4864:20::432] (port=36618 helo=mail-pf1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCBL8-0007Yk-7e for grub-devel@gnu.org; Mon, 24 Jan 2022 21:13:47 -0500 Received: by mail-pf1-x432.google.com with SMTP id 192so14494158pfz.3 for ; Mon, 24 Jan 2022 18:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qqnfsBBzcJ7UIVFRcKrrMjOkCdBem+gxZaJKMMLYPBY=; b=zbHVCecu+yDY/WdX90xid9n4NXoauVFoMb+zEqPQ2WC+2meqWfDislZ1SBCdu9fJSK 5TSb0EkLWpuW1/rzBg4tTcbFKlkrL+pJwa7a9p7e9gldYss0P0n+WEmoY6COKLlKD4Z9 EunefhIubM1vxNLnV6/e07Zevu9B1ZQpOccpFhkJqGoGCXTMh9hPf/Td5AhDtesSL3Vo VPnRQ+wq8eMmdIOOrJ+zuznIPcenGxGmvz5TVL6srjRQtYBLi8uh3eQOuP7TBqmmx826 0yPfqTaUGodwDdz0gYcxoirZ57QH755RuAhceDGbS0ZI5vkNCmloyHSxEUrsrcqVj+t3 L/Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qqnfsBBzcJ7UIVFRcKrrMjOkCdBem+gxZaJKMMLYPBY=; b=yZM6WCi+TFgA4UMyAEceRaBuieoV+OntbQb/W2moKw9EgylgeATD5Q3yvgq3Gj1dSS xFYm8h8SBitbn2Q8rYICQsi4CV8tTSpP7ejg+13VC/NZ+hm4WZSsSQ/ENsOLymNoABNU iebuNcg5pU81WbBRvpCz7hieE3JM4LfRK23LJlb7/vkPZDMDyEC049tA5KqMkS+BF13G NdonbuRK8yopfCfHDjzuU2Zo4sZZOugJzPuXNUI1SHzitk1haC6SZDKjHnOFVRKtlOJL LHgvMA59pz99MnOUEqXM9WQTcDskBT5+HoOvGPjLHjBdXQxpq0yFxzv/Fz/jqPafvXO2 QyLA== X-Gm-Message-State: AOAM533av1CeR8JNX/kJUbI/qQnsPv1iTLw9Hf0Iuq31EHutoAEZJN8f rQNFRbOeamaDveT2e8vy/VG9zw== X-Google-Smtp-Source: ABdhPJyoEAQXJMmjpWU583uc6qfcrQlLwf9indBQ9HwXV3m1lo6jczddfrfXRuJxNKf0iZHqce+sfA== X-Received: by 2002:a62:503:0:b0:4bc:764c:5524 with SMTP id 3-20020a620503000000b004bc764c5524mr16255514pff.25.1643076824460; Mon, 24 Jan 2022 18:13:44 -0800 (PST) Received: from localhost.localdomain (yal.riseup.net. [199.58.83.9]) by smtp.gmail.com with ESMTPSA id d18sm18526018pfv.173.2022.01.24.18.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 18:13:43 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org, "Vladimir 'phcoder' Serbinenko" , Daniel Axtens , John Paul Adrian Glaubitz Cc: Glenn Washburn Subject: [PATCH] Revert "iee1275/datetime: Fix off-by-1 error." Date: Mon, 24 Jan 2022 20:10:51 -0600 Message-Id: <20220125021051.721464-1-development@efficientek.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::432 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=development@efficientek.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2022 02:13:48 -0000 This is causing the test grub_cmd_date to fail because the returned date is one day more than it should be. This reverts commit 607d66116a67e5a13eb0d46076f26dedc988e6a4. Signed-off-by: Glenn Washburn --- Hi all, Reverting this commit allows the grub_cmd_date test to pass. It appears that this commit is (now) causing an off-by-1 error in QEMU and the latest OpenBIOS. What I'm unsure of is if the original commit is actually correct on real hardware and that potentially OpenBIOS has a bug. Adrian and Daniel A, could you test the reverting of this commit on real hardware and see if date does in fact produce the expected date (and do current builds show a date one day ahead of what it should be)? Can anyone point to documentation saying that the original commit is in fact what should be done? If the issue is in OpenBIOS I'd like to have some documentation to back up a bug report. Vladimir, do you have any thoughts on this? Glenn --- grub-core/lib/ieee1275/datetime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/lib/ieee1275/datetime.c b/grub-core/lib/ieee1275/datetime.c index b81fba2ed..74578f15a 100644 --- a/grub-core/lib/ieee1275/datetime.c +++ b/grub-core/lib/ieee1275/datetime.c @@ -95,7 +95,7 @@ grub_get_datetime (struct grub_datetime *datetime) datetime->year = args.year; datetime->month = args.month; - datetime->day = args.day + 1; + datetime->day = args.day; datetime->hour = args.hour; datetime->minute = args.minute; datetime->second = args.second; @@ -140,7 +140,7 @@ grub_set_datetime (struct grub_datetime *datetime) args.year = datetime->year; args.month = datetime->month; - args.day = datetime->day - 1; + args.day = datetime->day; args.hour = datetime->hour; args.minute = datetime->minute; args.second = datetime->second; -- 2.27.0