aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-04-09 17:54:05 -0400
committerJens Axboe <axboe@fb.com>2015-04-09 17:54:05 -0400
commit2963e3f7e8e3465895897a175560210120b932ac (patch)
tree7c27aa09aa01cbdef12016b48728f3e9383d3b4d
parentc76cbbcf404475f8885b2252049dac99b0614868 (diff)
blk-mq: cleanup blk_mq_rq_to_pdu()
Casting to void and adding the size of the request is "shit code" and only a "crazy monkey on crack" would write that. So lets clean it up. Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--include/linux/blk-mq.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index ebfe707cf722..8210e8797c12 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -230,7 +230,7 @@ void blk_mq_freeze_queue_start(struct request_queue *q);
230 230
231/* 231/*
232 * Driver command data is immediately after the request. So subtract request 232 * Driver command data is immediately after the request. So subtract request
233 * size to get back to the original request. 233 * size to get back to the original request, add request size to get the PDU.
234 */ 234 */
235static inline struct request *blk_mq_rq_from_pdu(void *pdu) 235static inline struct request *blk_mq_rq_from_pdu(void *pdu)
236{ 236{
@@ -238,7 +238,7 @@ static inline struct request *blk_mq_rq_from_pdu(void *pdu)
238} 238}
239static inline void *blk_mq_rq_to_pdu(struct request *rq) 239static inline void *blk_mq_rq_to_pdu(struct request *rq)
240{ 240{
241 return (void *) rq + sizeof(*rq); 241 return rq + 1;
242} 242}
243 243
244#define queue_for_each_hw_ctx(q, hctx, i) \ 244#define queue_for_each_hw_ctx(q, hctx, i) \