Skip to contentSkip to conversation

x86/early_printk: Fix comment for "pciserial" case

PATCH In review Andy Shevchenko 3 participants 4 messages Apr 7, 2025 – Apr 9, 2025 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/early_printk: Fix comment for "pciserial" case

The comment seem contains the copy'n'paste error when mentioning "serial" instead of "pciserial" (with double quotes). Fix this. With that, move it upper, so we don't calculate buf twice.

---
 arch/x86/kernel/early_printk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/early_printk.c +2 -2
index dc053641698c..4a9ba7cb7e5a 100644
@@ -442,9 +442,9 @@ static int __init setup_early_printk(char *buf)
 		}
 #ifdef CONFIG_PCI
 		if (!strncmp(buf, "pciserial", 9)) {
-			early_pci_serial_init(buf + 9);
+			buf += 9; /* Keep from match the above "pciserial" */
+			early_pci_serial_init(buf);
 			early_console_register(&early_serial_console, keep);
-			buf += 9; /* Keep from match the above "serial" */
 		}
 #endif
 		if (!strncmp(buf, "vga", 3) &&
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andy Shevchenko

The comment seem contains the copy'n'paste error when mentioning "serial" instead of "pciserial" (with double quotes). Fix this. With that, move it upper, so we don't calculate buf twice.

The change looks good to me, just in case:

Quoted 23 lines

---
arch/x86/kernel/early_printk.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/early_printk.c +2 -2
index dc053641698c..4a9ba7cb7e5a 100644
@@ -442,9 +442,9 @@ static int __init setup_early_printk(char buf)
 }
 #ifdef CONFIG_PCI
 if (!strncmp(buf, "pciserial", 9)) {
- early_pci_serial_init(buf + 9);
+ buf += 9; / Keep from match the above "pciserial" /
+ early_pci_serial_init(buf);
 early_console_register(&early_serial_console, keep);
- buf += 9; / Keep from match the above "serial" */
 }
 #endif

if (!strncmp(buf, "vga", 3) &&
--
2.47.2

#2 lore raw
In reply to Andy Shevchenko
Quoted 14 lines · Andy Shevchenko

The comment seem contains the copy'n'paste error when mentioning "serial" instead of "pciserial" (with double quotes). Fix this. With that, move it upper, so we don't calculate buf twice.

---
 arch/x86/kernel/early_printk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/early_printk.c +0 -0
index dc053641698c..4a9ba7cb7e5a 100644

arch/x86/kernel/early_printk.c static int __init setup_early_printk(char *buf) · line 447

Quoted 8 lines
arch/x86/kernel/early_printk.c +2 -2
@@ -442,9 +442,9 @@ static int __init setup_early_printk(char *buf)
 		}
 #ifdef CONFIG_PCI
 		if (!strncmp(buf, "pciserial", 9)) {
-			early_pci_serial_init(buf + 9);
+			buf += 9; /* Keep from match the above "pciserial" */
+			early_pci_serial_init(buf);
 			early_console_register(&early_serial_console, keep);
-			buf += 9; /* Keep from match the above "serial" */

Note that I merged this into the other fix, in part because the title isn't accurate anymore, this patch isn't purely fixing the comment.

Thanks,

Ingo

#3 lore raw
Quoted 4 lines · Ingo Molnar

* Andy Shevchenko <[email protected]> wrote:

Note that I merged this into the other fix, in part because the title isn't accurate anymore, this patch isn't purely fixing the comment.

Thank you for prompt act on this!

Signature · 2 lines
With Best Regards,
Andy Shevchenko