All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: Daniel Kiper <dkiper@net-space.pl>,
	grub-devel@gnu.org,
	"Vladimir 'phcoder' Serbinenko" <phcoder@gmail.com>,
	Daniel Axtens <dja@axtens.net>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH] Revert "iee1275/datetime: Fix off-by-1 error."
Date: Mon, 24 Jan 2022 20:10:51 -0600	[thread overview]
Message-ID: <20220125021051.721464-1-development@efficientek.com> (raw)

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 <development@efficientek.com>
---
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



             reply	other threads:[~2022-01-25  2:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  2:10 Glenn Washburn [this message]
2022-02-08  4:51 ` [PATCH] Revert "iee1275/datetime: Fix off-by-1 error." Daniel Axtens
2022-02-08 21:38   ` Glenn Washburn
2022-02-11  5:38     ` Daniel Axtens
2022-02-09 20:40   ` Daniel Kiper

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=20220125021051.721464-1-development@efficientek.com \
    --to=development@efficientek.com \
    --cc=dja@axtens.net \
    --cc=dkiper@net-space.pl \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /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.