mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
bulk: Access existing variables initialized to &S->F when available
When a variable is initialized to &struct->field, use it in place. Rationale: while this makes the code more concise, this also helps static analyzers. Mechanical change using the following Coccinelle spatch script: @@ type S, F; identifier s, m, v; @@ S *s; ... F *v = &s->m; <+... - &s->m + v ...+> Inspired-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240129164514.73104-2-philmd@linaro.org> Acked-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Anthony PERARD <anthony.perard@citrix.com> [thuth: Dropped hunks that need a rebase, and fixed sizeof() in pmu_realize()] Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
46ff64a826
commit
ee1004bba6
15 changed files with 34 additions and 35 deletions
|
@ -175,7 +175,7 @@ static void cxl_rp_realize(DeviceState *dev, Error **errp)
|
|||
|
||||
cxl_cstate->dvsec_offset = CXL_ROOT_PORT_DVSEC_OFFSET;
|
||||
cxl_cstate->pdev = pci_dev;
|
||||
build_dvsecs(&crp->cxl_cstate);
|
||||
build_dvsecs(cxl_cstate);
|
||||
|
||||
cxl_component_register_block_init(OBJECT(pci_dev), cxl_cstate,
|
||||
TYPE_CXL_ROOT_PORT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue