[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initializatio
From: |
Prasad Pandit |
Subject: |
Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config() |
Date: |
Mon, 18 Mar 2024 16:48:58 +0530 |
Hello,
On Mon, 18 Mar 2024 at 13:23, Zhao Liu <zhao1.liu@linux.intel.com> wrote:
> Indeed, as you say, these items are initialized to 0 by default.
>
> I think, however, that the initialization is so far away from where the
> smp is currently parsed that one can't easily confirm it (thanks for
> your confirmation!).
>
> From a code readability view, the fact that we're explicitly
> initializing to 0 again here brings little overhead, but makes the code
> more readable as well as easier to maintain. I think the small redundancy
> here is worth it.
>
> Also, in other use cases people always relies on fields marked by has_*,
> and there is no (or less?) precedent for direct access to places where
> has_* is not set. I understand that this is also a habit, i.e., fields
> with a has_* of False by default are unreliable and avoid going directly
> to them.
* Ummn...okay. (I'm not fully convinced, but that's fine, I'm okay to
go with you on this.)
Thank you.
---
- Prasad
- [PATCH 02/14] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations, (continued)
- [PATCH 02/14] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations, Zhao Liu, 2024/03/06
- [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Zhao Liu, 2024/03/06
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Thomas Huth, 2024/03/08
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Zhao Liu, 2024/03/08
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Prasad Pandit, 2024/03/10
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Zhao Liu, 2024/03/11
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Prasad Pandit, 2024/03/13
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(), Zhao Liu, 2024/03/18
- Re: [PATCH 03/14] hw/core/machine-smp: Simplify variables' initialization in machine_parse_smp_config(),
Prasad Pandit <=
[PATCH 04/14] hw/core/machine-smp: Calculate total CPUs once in machine_parse_smp_config(), Zhao Liu, 2024/03/06
[PATCH 05/14] tests/unit/test-smp-parse: Drop the unsupported "dies=1" case, Zhao Liu, 2024/03/06
[PATCH 06/14] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case, Zhao Liu, 2024/03/06
[PATCH 07/14] tests/unit/test-smp-parse: Bump max_cpus to 4096, Zhao Liu, 2024/03/06
[PATCH 08/14] tests/unit/test-smp-parse: Make test cases aware of the book/drawer, Zhao Liu, 2024/03/06
[PATCH 09/14] tests/unit/test-smp-parse: Test "books" parameter in -smp, Zhao Liu, 2024/03/06