x86/MCE-telem: adjust cookie definition
PATCH 1/1 x86/MCE-telem: adjust cookie definition
struct mctelem_ent is opaque outside of mcetelem.c; the cookie abstraction exists - afaict - just to achieve this opaqueness. Then it is irrelevant though which kind of pointer mctelem_cookie_t resolves to. IOW we can as well use struct mctelem_ent there, allowing to remove the casts from COOKIE2MCTE() and MCTE2COOKIE(). Their removal addresses Misra C:2012 rule 11.2 ("Conversions shall not be performed between a pointer to an incomplete type and any other type") violations.
No functional change intended.
xen/arch/x86/cpu/mcheck/mctelem.c +2 -2
@@ -64,8 +64,8 @@ struct mctelem_ent {#define MC_NENT (MC_URGENT_NENT + MC_NONURGENT_NENT) -#define COOKIE2MCTE (c) ((struct mctelem_ent *)(c)) -#define MCTE2COOKIE (tep) ((mctelem_cookie_t)(tep)) +#define COOKIE2MCTE (c) (c) +#define MCTE2COOKIE (tep) (tep) static struct mc_telem_ctl { /* Linked lists that thread the array members together.
xen/arch/x86/cpu/mcheck/mctelem.h +1 -1
@@ -52,7 +52,7 @@* the element from the processing list. */ -typedef struct mctelem_cookie *mctelem_cookie_t ; +typedef struct mctelem_ent *mctelem_cookie_t ; typedef enum mctelem_class { MC_URGENT,
Quoted 11 lines · Jan Beulich
struct
mctelem_entis opaque outside ofmcetelem.c; the cookie abstraction exists - afaict - just to achieve this opaqueness. Then it is irrelevant though which kind of pointermctelem_cookie_tresolves to. IOW we can as well use structmctelem_entthere, allowing to remove the casts fromCOOKIE2MCTE()andMCTE2COOKIE(). Their removal addresses Misra C:2012 rule 11.2 ("Conversions shall not be performed between a pointer to an incomplete type and any other type") violations.No functional change intended.
Signed-off-by Jan Beulich <[email protected]>
https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/9181587757
Eclair does appear to be happy with this approach (assuming I stripped down to only checking R11.2 correctly, and making it fatal).
For the change itself, it's an almost identical binary, differing only in the string section which I expect means some embedded line numbers.
Quoted 13 lines · Andrew Cooper
Quoted 11 lines · Jan Beulich
struct
mctelem_entis opaque outside ofmcetelem.c; the cookie abstraction exists - afaict - just to achieve this opaqueness. Then it is irrelevant though which kind of pointermctelem_cookie_tresolves to. IOW we can as well use structmctelem_entthere, allowing to remove the casts fromCOOKIE2MCTE()andMCTE2COOKIE(). Their removal addresses Misra C:2012 rule 11.2 ("Conversions shall not be performed between a pointer to an incomplete type and any other type") violations.No functional change intended.
Signed-off-by Jan Beulich <[email protected]>
Quoted 7 lines
https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/9181587757
Eclair does appear to be happy with this approach (assuming I stripped down to only checking R11.2 correctly, and making it fatal).
For the change itself, it's an almost identical binary, differing only in the string section which I expect means some embedded line numbers.
Line number changes would be odd, given the patch doesn't add or remove any lines. I expect its internal kind-of-sequence numbers of the compiler, used to e.g. generate local label names.
Quoted 1 line
Reviewed-by Andrew Cooper <[email protected]>
Thanks.
Jan
Quoted 9 lines · Andrew Cooper
Quoted 8 lines · Jan Beulich
struct
mctelem_entis opaque outside ofmcetelem.c; the cookie abstraction exists - afaict - just to achieve this opaqueness. Then it is irrelevant though which kind of pointermctelem_cookie_tresolves to. IOW we can as well use structmctelem_entthere, allowing to remove the casts fromCOOKIE2MCTE()andMCTE2COOKIE(). Their removal addresses Misra C:2012 rule 11.2 ("Conversions shall not be performed between a pointer to an incomplete type and any other type") violations.
Quoted 9 lines
Quoted 3 lines
No functional change intended.
Signed-off-by Jan Beulich <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/9181587757
Eclair does appear to be happy with this approach (assuming I stripped down to only checking R11.2 correctly, and making it fatal).
The analysis settings are correct.
Quoted 4 lines
For the change itself, it's an almost identical binary, differing only in the string section which I expect means some embedded line numbers.
Reviewed-by Andrew Cooper <[email protected]>
Signature · 4 lines
Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
Quoted 15 lines · Andrew Cooper
Quoted 11 lines · Jan Beulich
struct
mctelem_entis opaque outside ofmcetelem.c; the cookie abstraction exists - afaict - just to achieve this opaqueness. Then it is irrelevant though which kind of pointermctelem_cookie_tresolves to. IOW we can as well use structmctelem_entthere, allowing to remove the casts fromCOOKIE2MCTE()andMCTE2COOKIE(). Their removal addresses Misra C:2012 rule 11.2 ("Conversions shall not be performed between a pointer to an incomplete type and any other type") violations.No functional change intended.
Signed-off-by Jan Beulich <[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/9181587757
Quoted 7 lines
Eclair does appear to be happy with this approach (assuming I stripped down to only checking R11.2 correctly, and making it fatal).
For the change itself, it's an almost identical binary, differing only in the string section which I expect means some embedded line numbers.
Reviewed-by Andrew Cooper <[email protected]>
Thank you very much Jan for writing the patch, and thank you Andrew for running the pipeline. It is great that resolves all the 11.2 issues!
Oleksii, may I ask for a release-ack? I'll follow up with a patch to mark 11.2 as clean.
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Andrew Cooper
Quoted 11 lines · Jan Beulich
struct
mctelem_entis opaque outside ofmcetelem.c; the cookie abstraction exists - afaict - just to achieve this opaqueness. Then it is irrelevant though which kind of pointermctelem_cookie_tresolves to. IOW we can as well use structmctelem_entthere, allowing to remove the casts fromCOOKIE2MCTE()andMCTE2COOKIE(). Their removal addresses Misra C:2012 rule 11.2 ("Conversions shall not be performed between a pointer to an incomplete type and any other type") violations.No functional change intended.
Signed-off-by Jan Beulich<[email protected]>https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/9181587757
Eclair does appear to be happy with this approach (assuming I stripped down to only checking R11.2 correctly, and making it fatal).
For the change itself, it's an almost identical binary, differing only in the string section which I expect means some embedded line numbers.
Quoted 6 lines
Quoted 1 line
Reviewed-by Andrew Cooper<[email protected]>Thank you very much Jan for writing the patch, and thank you Andrew for running the pipeline. It is great that resolves all the 11.2 issues!
Oleksii, may I ask for a release-ack? I'll follow up with a patch to mark 11.2 as clean.
~ Oleksii