On 5/8/20 2:49 PM, Markus Armbruster wrote:
Philippe Mathieu-Daudé <[email protected]> writes:
The OBJECT() macro is defined as:
#define OBJECT(obj) ((Object *)(obj))
which expands to:
((Object *)object_dynamic_cast_assert((Object *)(obj), (name),
__FILE__, __LINE__, __func__))
Nope :)
This assertion can only fail when @obj points to something other
than its stated type, i.e. when we're in undefined behavior country.
There is no assertion.
Remove the unnecessary OBJECT() casts when we already know the
pointer is of Object type.
Patch created mechanically using spatch with this script:
@@
typedef Object;
Object *o;
@@
- OBJECT(o)
+ o
Acked-by: Cornelia Huck <[email protected]>
Acked-by: Corey Minyard <[email protected]>
Acked-by: John Snow <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
v2: Reword (Markus)
My rewording suggestion applied to PATCH 3, not to this one.
OK.
With v2's commit message;
Reviewed-by: Markus Armbruster <[email protected]>
Are you willing to take these patches? In that case, are you OK to take
1 & 3 and I resend 2?
Thanks,
Phil.