Skip to contentSkip to conversation

rbd: remove RBD_DEBUG

PATCH In review Paul Bolle 2 participants 2 messages Jun 17, 2013 – Jun 18, 2013

Subsystems (2)
lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

PATCH 1/1 rbd: remove RBD_DEBUG

The RBD_DEBUG macro is always defined, so it serves no purpose. Removing it has the benefit that readers of the code won't be tricked into thinking that rbd_assert() will compile away because they didn't define RBD_DEBUG themselves.

---
Compile tested only.

 drivers/block/rbd.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/block/rbd.c +0 -6
index b8a58178..d3869b4 100644
@@ -44,8 +44,6 @@
 
 #include "rbd_types.h"
 
-#define RBD_DEBUG	/* Activate rbd_assert() calls */
-
 /*
  * The basic unit of block I/O is a sector.  It is interpreted in a
  * number of contexts in Linux (blk, bio, genhd), but the default is
@@ -444,7 +442,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
 	va_end(args);
 }
 
-#ifdef RBD_DEBUG
 #define rbd_assert(expr)						\
 		if (unlikely(!(expr))) {				\
 			printk(KERN_ERR "\nAssertion failure in %s() "	\
@@ -453,9 +450,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
 					__func__, __LINE__, #expr);	\
 			BUG();						\
 		}
-#else /* !RBD_DEBUG */
-#  define rbd_assert(expr)	((void) 0)
-#endif /* !RBD_DEBUG */
 
 static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request);
 static void rbd_img_parent_read(struct rbd_obj_request *obj_request);
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 4 lines · Paul Bolle

The RBD_DEBUG macro is always defined, so it serves no purpose. Removing it has the benefit that readers of the code won't be tricked into thinking that rbd_assert() will compile away because they didn't define RBD_DEBUG themselves.

In the future we likely will disable the #define. We may as well leave it there for now...

Quoted 48 lines

---
Compile tested only.

 drivers/block/rbd.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/block/rbd.c +0 -6
index b8a58178..d3869b4 100644
@@ -44,8 +44,6 @@
 
 #include "rbd_types.h"
 
-#define RBD_DEBUG	/* Activate rbd_assert() calls */
-
 /*
  * The basic unit of block I/O is a sector.  It is interpreted in a
  * number of contexts in Linux (blk, bio, genhd), but the default is
@@ -444,7 +442,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
 	va_end(args);
 }
 
-#ifdef RBD_DEBUG
 #define rbd_assert(expr)						\
 		if (unlikely(!(expr))) {				\
 			printk(KERN_ERR "\nAssertion failure in %s() "	\
@@ -453,9 +450,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
 					__func__, __LINE__, #expr);	\
 			BUG();						\
 		}
-#else /* !RBD_DEBUG */
-#  define rbd_assert(expr)	((void) 0)
-#endif /* !RBD_DEBUG */
 
 static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request);
 static void rbd_img_parent_read(struct rbd_obj_request *obj_request);
Signature · 6 lines
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html