Skip to contentSkip to conversation

hw/i386/pc: fix code comment on cumulative flash size

PATCH Applied Laszlo Ersek 3 participants 4 messages Sep 12, 2023 – Sep 13, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hw/i386/pc: fix code comment on cumulative flash size

- The comment is incorrectly indented / formatted.

- The comment states a 8MB limit, even though the code enforces a 16MB limit.

Both of these warts come from commit 0657c657eb37 ("hw/i386/pc: add max combined fw size as machine configuration option", 2020-12-09); clean them up.

Arguably, it's also better to be consistent with the binary units (such as "MiB") that QEMU uses nowadays.

Cc "Michael S. Tsirkin" <[email protected]> (supporter:PC)
Cc Marcel Apfelbaum <[email protected]> (supporter:PC)
Cc Paolo Bonzini <[email protected]> (maintainer:X86 TCG CPUs)
Cc Richard Henderson <[email protected]> (maintainer:X86 TCG CPUs)
Cc Eduardo Habkost <[email protected]> (maintainer:X86 TCG CPUs)
Fixes 0657c657eb37

---

Notes:
v2:

- use the binary units MiB, KiB, GiB comprehensively in the comment

 hw/i386/pc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
hw/i386/pc.c +6 -6
index 54838c0c411d..0b642e8af590 100644
@@ -1746,12 +1746,12 @@ static void pc_machine_set_max_fw_size(Object *obj, Visitor *v,
     }
 
     /*
-    * We don't have a theoretically justifiable exact lower bound on the base
-    * address of any flash mapping. In practice, the IO-APIC MMIO range is
-    * [0xFEE00000..0xFEE01000] -- see IO_APIC_DEFAULT_ADDRESS --, leaving free
-    * only 18MB-4KB below 4G. For now, restrict the cumulative mapping to 8MB in
-    * size.
-    */
+     * We don't have a theoretically justifiable exact lower bound on the base
+     * address of any flash mapping. In practice, the IO-APIC MMIO range is
+     * [0xFEE00000..0xFEE01000] -- see IO_APIC_DEFAULT_ADDRESS --, leaving free
+     * only 18MiB-4KiB below 4GiB. For now, restrict the cumulative mapping to
+     * 16MiB in size.
+     */
     if (value > 16 * MiB) {
         error_setg(errp,
                    "User specified max allowed firmware size %" PRIu64 " is "
Reviewed-by on v2 1/1
#1 lore raw
Quoted 20 lines · Laszlo Ersek

- The comment is incorrectly indented / formatted.

- The comment states a 8MB limit, even though the code enforces a 16MB limit.

Both of these warts come from commit 0657c657eb37 ("hw/i386/pc: add max combined fw size as machine configuration option", 2020-12-09); clean them up.

Arguably, it's also better to be consistent with the binary units (such as "MiB") that QEMU uses nowadays.

Cc "Michael S. Tsirkin" <[email protected]> (supporter:PC)
Cc Marcel Apfelbaum <[email protected]> (supporter:PC)
Cc Paolo Bonzini <[email protected]> (maintainer:X86 TCG CPUs)
Cc Richard Henderson <[email protected]> (maintainer:X86 TCG CPUs)
Cc Eduardo Habkost <[email protected]> (maintainer:X86 TCG CPUs)
Fixes 0657c657eb37
Quoted 6 lines

---

Notes:
v2:

- use the binary units MiB, KiB, GiB comprehensively in the comment

I was going to suggest that ;)

Quoted 3 lines
  hw/i386/pc.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
#2 lore raw
Quoted 26 lines · Philippe Mathieu-Daudé
Quoted 25 lines · Laszlo Ersek

- The comment is incorrectly indented / formatted.

- The comment states a 8MB limit, even though the code enforces a 16MB limit.

Both of these warts come from commit 0657c657eb37 ("hw/i386/pc: add max combined fw size as machine configuration option", 2020-12-09); clean them
up.

Arguably, it's also better to be consistent with the binary units (such as
"MiB") that QEMU uses nowadays.

Cc: "Michael S. Tsirkin" <[email protected]> (supporter:PC)
Cc: Marcel Apfelbaum <[email protected]> (supporter:PC)
Cc: Paolo Bonzini <[email protected]> (maintainer:X86 TCG CPUs)
Cc: Richard Henderson <[email protected]> (maintainer:X86 TCG CPUs)

Cc Eduardo Habkost <[email protected]> (maintainer:X86 TCG CPUs)
Fixes 0657c657eb37

---

Quoted 8 lines
Quoted 4 lines

Notes:
     v2:
          - use the binary units MiB, KiB, GiB comprehensively in the comment

I was going to suggest that ;)

And when I was writing the patch, I was 100% sure that you were going to be my first reviewer. :)

Thanks!
Laszlo

Quoted 5 lines
Quoted 4 lines

  hw/i386/pc.c | 12 ++++++------

  1 file changed, 6 insertions(+), 6 deletions(-)
#3 lore raw
In reply to Laszlo Ersek

12.09.2023 18:55, Laszlo Ersek:

Quoted 11 lines

- The comment is incorrectly indented / formatted.

- The comment states a 8MB limit, even though the code enforces a 16MB limit.

Both of these warts come from commit 0657c657eb37 ("hw/i386/pc: add max combined fw size as machine configuration option", 2020-12-09); clean them up.

Arguably, it's also better to be consistent with the binary units (such as "MiB") that QEMU uses nowadays.

Applied to my trivial-patches tree. Thanks!

/mjt