Skip to contentSkip to conversation

rtc: efi: fixed typo in efi_procfs()

PATCH Applied Maxim Korotkov 2 participants 3 messages Oct 6, 2023 – Oct 15, 2023 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: efi: fixed typo in efi_procfs()

After the first check of the value of the "eft" variable it does not change, it is obvious that a copy-paste error was made here and the value of variable "alm" should be checked here.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 101ca8d05913 ("rtc: efi: Enable SET/GET WAKEUP services as optional")
---
 drivers/rtc/rtc-efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-efi.c +1 -1
index dc6b0f4a54e2..fa8bf82df948 100644
@@ -227,7 +227,7 @@ static int efi_procfs(struct device *dev, struct seq_file *seq)
 			   enabled == 1 ? "yes" : "no",
 			   pending == 1 ? "yes" : "no");
 
-		if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE)
+		if (alm.timezone == EFI_UNSPECIFIED_TIMEZONE)
 			seq_puts(seq, "Timezone\t: unspecified\n");
 		else
 			/* XXX fixme: convert to string? */
Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Maxim Korotkov

After the first check of the value of the "eft" variable it does not change, it is obvious that a copy-paste error was made here and the value of variable "alm" should be checked here.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 101ca8d05913 ("rtc: efi: Enable SET/GET WAKEUP services as optional")

I had a look at the history and this is actually a bug that predates v2.6.12-rc2 and so its introduction is not in the main git repo history.

I guess nobody actually cares and I'm very tempted to just rip out this procfs file.

Quoted 21 lines
---
 drivers/rtc/rtc-efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-efi.c +1 -1
index dc6b0f4a54e2..fa8bf82df948 100644
@@ -227,7 +227,7 @@ static int efi_procfs(struct device *dev, struct seq_file *seq)
 			   enabled == 1 ? "yes" : "no",
 			   pending == 1 ? "yes" : "no");
 
-		if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE)
+		if (alm.timezone == EFI_UNSPECIFIED_TIMEZONE)
 			seq_puts(seq, "Timezone\t: unspecified\n");
 		else
 			/* XXX fixme: convert to string? */
Signature · 1 line
2.34.1
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
maintainer Applied
#2 lore raw
In reply to Maxim Korotkov
Quoted 8 lines · Maxim Korotkov

After the first check of the value of the "eft" variable it does not change, it is obvious that a copy-paste error was made here and the value of variable "alm" should be checked here.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

[...]

I changed the fixes tag to:

Fixes 501385f2a783 ("rtc: efi: add efi_procfs in efi_rtc_ops")

Applied, thanks!

[1/1] rtc: efi: fixed typo in efi_procfs()

      commit: f5f4c982f7c8a8cffb2663078a40ecd7d82b534d

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com