VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Andreas Gruenbacher <agruenba@redhat.com> 2020-01-23 19:36:21 +0100 committer: Bob Peterson <rpeterso@redhat.com> 2020-02-10 07:39:47 -0600 commit: 8e28ef1f2fa176854f96fb0416f2aaf5516793d0 parent: a5ca2f1cb66b1ef93bbd58b55b22cb50163a03db
Commit Summary:
gfs2: Return bool from gfs2_assert functions
Diffstat:
1 file changed, 18 insertions, 9 deletions
diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h
index 93e089327216..572399e75ce6 100644
--- a/fs/gfs2/util.h
+++ b/fs/gfs2/util.h
@@ -36,21 +36,29 @@ do { \
 } while (0)
 
 
-int gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
-			   const char *function, char *file, unsigned int line);
+void gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
+			    const char *function, char *file, unsigned int line);
 
 #define gfs2_assert_withdraw(sdp, assertion) \
-((likely(assertion)) ? 0 : gfs2_assert_withdraw_i((sdp), #assertion, \
-					__func__, __FILE__, __LINE__))
+	({ \
+		bool _bool = (assertion); \
+		if (unlikely(!_bool)) \
+			gfs2_assert_withdraw_i((sdp), #assertion, \
+					__func__, __FILE__, __LINE__); \
+		!_bool; \
+	})
 
-
-int gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
-		       const char *function, char *file, unsigned int line);
+void gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
+			const char *function, char *file, unsigned int line);
 
 #define gfs2_assert_warn(sdp, assertion) \
-((likely(assertion)) ? 0 : gfs2_assert_warn_i((sdp), #assertion, \
-					__func__, __FILE__, __LINE__))
-
+	({ \
+		bool _bool = (assertion); \
+		if (unlikely(!_bool)) \
+			gfs2_assert_warn_i((sdp), #assertion, \
+					__func__, __FILE__, __LINE__); \
+		!_bool; \
+	})
 
 void gfs2_consist_i(struct gfs2_sbd *sdp,
 		    const char *function, char *file, unsigned int line);