[Devel] [PATCH] blkdev.h: fix compilation in case CONFIG_BLK_DEV_CBT is not set

Stanislav Kinsburskiy skinsbursky at odin.com
Tue Oct 27 04:48:54 PDT 2015


From: Stanislav Kinsburskiy <skinsbursky at parallels.com>

Compilation errors:

In file included from fs/block_dev.c:16:0:
fs/block_dev.c: В функции «bd_write_size»:
include/linux/blkdev.h:1649:32: ошибка: оператор без побочного эффекта
[-Werror=unused-value]
 #define blk_cbt_update_size(b) (0)
                                ^
fs/block_dev.c:1043:2: замечание: in expansion of macro «blk_cbt_update_size»
  blk_cbt_update_size(bdev);
  ^
  CC      fs/ioprio.o

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at parallels.com>
---
 include/linux/blkdev.h |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2a05818..0860be1 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1646,10 +1646,20 @@ extern void blk_cbt_release(struct request_queue *q);
 extern void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio);
 extern int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg);
 #else /* CONFIG_BLK_DEV_CBT */
-#define blk_cbt_update_size(b) (0)
-#define blk_cbt_release(q) (0)
-#define blk_cbt_bio_queue(q,bio) (0)
-#define blk_cbt_ioctl(b,c,a) (-ENOTTY)
+static inline void blk_cbt_update_size(struct block_device *bdev)
+{
+}
+static inline void blk_cbt_release(struct request_queue *q)
+{
+}
+static inline void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio)
+{
+}
+static inline int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd,
+				 char __user *arg)
+{
+	return 0;
+}
 #endif /* CONFIG_BLK_DEV_CBT */
 struct block_device_operations {
 	int (*open) (struct block_device *, fmode_t);




More information about the Devel mailing list