diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2012-01-12 03:17:30 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-01-12 03:19:54 -0500 |
commit | fd83240a60ecc59849420df3393e9e6d35c77683 (patch) | |
tree | d85ae1c6459d5d5c01db1617011db403929578b4 /include/linux/blkdev.h | |
parent | 0b4156eb27214e81f7012458bb15d1e038db9a00 (diff) |
blockdev: convert some macros to static inlines
We prefer to program in C rather than preprocessor and it fixes this
warning when CONFIG_BLK_DEV_INTEGRITY is not set:
drivers/md/dm-table.c: In function 'dm_table_set_integrity':
drivers/md/dm-table.c:1285:3: warning: statement with no effect [-Wunused-value]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 77 |
1 files changed, 64 insertions, 13 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index adc34133a56a..5cfb9b22627f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1298,19 +1298,70 @@ queue_max_integrity_segments(struct request_queue *q) | |||
1298 | 1298 | ||
1299 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 1299 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
1300 | 1300 | ||
1301 | #define blk_integrity_rq(rq) (0) | 1301 | struct bio; |
1302 | #define blk_rq_count_integrity_sg(a, b) (0) | 1302 | struct block_device; |
1303 | #define blk_rq_map_integrity_sg(a, b, c) (0) | 1303 | struct gendisk; |
1304 | #define bdev_get_integrity(a) (0) | 1304 | struct blk_integrity; |
1305 | #define blk_get_integrity(a) (0) | 1305 | |
1306 | #define blk_integrity_compare(a, b) (0) | 1306 | static inline int blk_integrity_rq(struct request *rq) |
1307 | #define blk_integrity_register(a, b) (0) | 1307 | { |
1308 | #define blk_integrity_unregister(a) do { } while (0) | 1308 | return 0; |
1309 | #define blk_queue_max_integrity_segments(a, b) do { } while (0) | 1309 | } |
1310 | #define queue_max_integrity_segments(a) (0) | 1310 | static inline int blk_rq_count_integrity_sg(struct request_queue *q, |
1311 | #define blk_integrity_merge_rq(a, b, c) (0) | 1311 | struct bio *b) |
1312 | #define blk_integrity_merge_bio(a, b, c) (0) | 1312 | { |
1313 | #define blk_integrity_is_initialized(a) (0) | 1313 | return 0; |
1314 | } | ||
1315 | static inline int blk_rq_map_integrity_sg(struct request_queue *q, | ||
1316 | struct bio *b, | ||
1317 | struct scatterlist *s) | ||
1318 | { | ||
1319 | return 0; | ||
1320 | } | ||
1321 | static inline struct blk_integrity *bdev_get_integrity(struct block_device *b) | ||
1322 | { | ||
1323 | return 0; | ||
1324 | } | ||
1325 | static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk) | ||
1326 | { | ||
1327 | return NULL; | ||
1328 | } | ||
1329 | static inline int blk_integrity_compare(struct gendisk *a, struct gendisk *b) | ||
1330 | { | ||
1331 | return 0; | ||
1332 | } | ||
1333 | static inline int blk_integrity_register(struct gendisk *d, | ||
1334 | struct blk_integrity *b) | ||
1335 | { | ||
1336 | return 0; | ||
1337 | } | ||
1338 | static inline void blk_integrity_unregister(struct gendisk *d) | ||
1339 | { | ||
1340 | } | ||
1341 | static inline void blk_queue_max_integrity_segments(struct request_queue *q, | ||
1342 | unsigned int segs) | ||
1343 | { | ||
1344 | } | ||
1345 | static inline unsigned short queue_max_integrity_segments(struct request_queue *q) | ||
1346 | { | ||
1347 | return 0; | ||
1348 | } | ||
1349 | static inline int blk_integrity_merge_rq(struct request_queue *rq, | ||
1350 | struct request *r1, | ||
1351 | struct request *r2) | ||
1352 | { | ||
1353 | return 0; | ||
1354 | } | ||
1355 | static inline int blk_integrity_merge_bio(struct request_queue *rq, | ||
1356 | struct request *r, | ||
1357 | struct bio *b) | ||
1358 | { | ||
1359 | return 0; | ||
1360 | } | ||
1361 | static inline bool blk_integrity_is_initialized(struct gendisk *g) | ||
1362 | { | ||
1363 | return 0; | ||
1364 | } | ||
1314 | 1365 | ||
1315 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 1366 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
1316 | 1367 | ||