We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 741dad8 commit 92151b0Copy full SHA for 92151b0
tools/include/linux/err.h
@@ -59,4 +59,17 @@ static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
59
else
60
return 0;
61
}
62
+
63
+/**
64
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
65
+ * @ptr: The pointer to cast.
66
+ *
67
+ * Explicitly cast an error-valued pointer to another pointer type in such a
68
+ * way as to make it clear that's what's going on.
69
+ */
70
+static inline void * __must_check ERR_CAST(__force const void *ptr)
71
+{
72
+ /* cast away the const */
73
+ return (void *) ptr;
74
+}
75
#endif /* _LINUX_ERR_H */
0 commit comments