linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/rnbd: client: Constify rnbd_mq_ops
@ 2020-09-27 18:47 Rikard Falkeborn
  0 siblings, 0 replies; only message in thread
From: Rikard Falkeborn @ 2020-09-27 18:47 UTC (permalink / raw)
  To: linux-block, linux-kernel
  Cc: Danil Kipnis, Jack Wang, Jens Axboe, Rikard Falkeborn

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.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/block/rnbd/rnbd-clt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index d7a69741c0f6..264258ac807a 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -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,
-- 
2.28.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-27 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27 18:47 [PATCH] block/rnbd: client: Constify rnbd_mq_ops Rikard Falkeborn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).