All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Simone Ballarin <simone.ballarin@bugseng.com>
Subject: [PATCH v2 5/6] xen: remove unused function ERR_CAST
Date: Tue, 19 Dec 2023 12:05:13 +0100	[thread overview]
Message-ID: <e6152a631d3bb6ad4c798fe9d795b360100d63f5.1702982442.git.maria.celeste.cesario@bugseng.com> (raw)
In-Reply-To: <cover.1702982442.git.maria.celeste.cesario@bugseng.com>

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>
---
Commit introduced in v2.
---
 xen/include/xen/err.h | 13 -------------
 1 file changed, 13 deletions(-)

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;
-- 
2.40.0



  parent reply	other threads:[~2023-12-19 11:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 11:05 [PATCH v2 0/6] xen: address violations of MISRA C:2012 Rule 11.8 Simone Ballarin
2023-12-19 11:05 ` [PATCH v2 1/6] xen/arm: " Simone Ballarin
2023-12-20  1:02   ` Stefano Stabellini
2023-12-19 11:05 ` [PATCH v2 2/6] xen/ppc: " Simone Ballarin
2024-02-23 23:19   ` Stefano Stabellini
2024-02-26 19:33     ` Shawn Anastasio
2023-12-19 11:05 ` [PATCH v2 3/6] xen: add deviations for " Simone Ballarin
2023-12-20  1:04   ` Stefano Stabellini
2023-12-20 10:50   ` Jan Beulich
2023-12-20 11:39     ` Nicola Vetrini
2023-12-19 11:05 ` [PATCH v2 4/6] xen: add SAF deviation for safe cast removal Simone Ballarin
2023-12-19 11:28   ` Jan Beulich
2023-12-19 15:03     ` Nicola Vetrini
2023-12-19 11:05 ` Simone Ballarin [this message]
2023-12-19 11:24   ` [PATCH v2 5/6] xen: remove unused function ERR_CAST Jan Beulich
2023-12-20  1:07   ` Stefano Stabellini
2023-12-19 11:05 ` [PATCH v2 6/6] xen/common: address violations of MISRA C:2012 Rule 11.8 Simone Ballarin
2023-12-19 16:25   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6152a631d3bb6ad4c798fe9d795b360100d63f5.1702982442.git.maria.celeste.cesario@bugseng.com \
    --to=simone.ballarin@bugseng.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=maria.celeste.cesario@bugseng.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.