Message ID | e6152a631d3bb6ad4c798fe9d795b360100d63f5.1702982442.git.maria.celeste.cesario@bugseng.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xen: address violations of MISRA C:2012 Rule 11.8 | expand |
On 19.12.2023 12:05, Simone Ballarin wrote: > From: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com> > > Function ERR_CAST contains a violation of MISRA C:2012 Rule 11.8, > whose headline states: > "A conversion shall not remove any const, volatile or _Atomic qualification > from the type pointed to by a pointer". > > Since the function has no users, it is appropriate to remove it. > > Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> Acked-by: Jan Beulich <jbeulich@suse.com>
On Tue, 19 Dec 2023, Simone Ballarin wrote: > From: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com> > > Function ERR_CAST contains a violation of MISRA C:2012 Rule 11.8, > whose headline states: > "A conversion shall not remove any const, volatile or _Atomic qualification > from the type pointed to by a pointer". > > Since the function has no users, it is appropriate to remove it. > > Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@bugseng.com> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
diff --git a/xen/include/xen/err.h b/xen/include/xen/err.h index 2f29b57d28..cbdd1bf7f8 100644 --- a/xen/include/xen/err.h +++ b/xen/include/xen/err.h @@ -36,19 +36,6 @@ static inline long __must_check IS_ERR_OR_NULL(const void *ptr) return !ptr || IS_ERR_VALUE((unsigned long)ptr); } -/** - * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type - * @ptr: The pointer to cast. - * - * Explicitly cast an error-valued pointer to another pointer type in such a - * way as to make it clear that's what's going on. - */ -static inline void * __must_check ERR_CAST(const void *ptr) -{ - /* cast away the const */ - return (void *)ptr; -} - static inline int __must_check PTR_RET(const void *ptr) { return IS_ERR(ptr) ? PTR_ERR(ptr) : 0;