Skip to contentSkip to conversation

block/rnbd: client: Constify rnbd_mq_ops

PATCH New Rikard Falkeborn 1 participant 1 message Sep 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/rnbd: client: Constify rnbd_mq_ops

The only usage of rnbd_mq_ops is to assign its address to the ops field in the blk_mq_tag_set struct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/block/rnbd/rnbd-clt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rnbd/rnbd-clt.c +1 -1
index d7a69741c0f6..264258ac807a 100644
@@ -1159,7 +1159,7 @@ static int rnbd_init_request(struct blk_mq_tag_set *set, struct request *rq,
 	return 0;
 }
 
-static struct blk_mq_ops rnbd_mq_ops = {
+static const struct blk_mq_ops rnbd_mq_ops = {
 	.queue_rq	= rnbd_queue_rq,
 	.init_request	= rnbd_init_request,
 	.complete	= rnbd_softirq_done_fn,
Signature · 1 line
2.28.0