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.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-By: Oleksii Kurochko<oleksii.kurochko@gmail.com>
#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.
* 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,