]> Git Repo - qemu.git/commit
target: Remove unnecessary CPU() cast
authorPhilippe Mathieu-Daudé <[email protected]>
Tue, 12 May 2020 07:00:18 +0000 (09:00 +0200)
committerMarkus Armbruster <[email protected]>
Fri, 15 May 2020 05:08:14 +0000 (07:08 +0200)
commit96449e4a30a56e3303d6d0407aca130c71671754
tree7b89cb76afd183356f59d4935a7d887b9c232422
parentdf4fe0b291b2baf1694517a4a67be7525102656b
target: Remove unnecessary CPU() cast

The CPU() macro is defined as:

  #define CPU(obj) ((CPUState *)(obj))

which expands to:

  ((CPUState *)object_dynamic_cast_assert((Object *)(obj), (name),
                                          __FILE__, __LINE__, __func__))

This assertion can only fail when @obj points to something other
than its stated type, i.e. when we're in undefined behavior country.

Remove the unnecessary CPU() casts when we already know the pointer
is of CPUState type.

Patch created mechanically using spatch with this script:

  @@
  typedef CPUState;
  CPUState *s;
  @@
  -   CPU(s)
  +   s

Acked-by: David Gibson <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200512070020[email protected]>
target/ppc/mmu_helper.c
This page took 0.024815 seconds and 4 git commands to generate.