linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme-tcp: constify static struct blk_mq_ops
@ 2020-05-28 22:25 Rikard Falkeborn
  2020-05-28 22:33 ` Sagi Grimberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rikard Falkeborn @ 2020-05-28 22:25 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: linux-nvme, linux-kernel, Rikard Falkeborn

nvme_tcp_mq_ops and nvme_tcp_admin_mq_ops are never modified and can be
made const to allow the compiler to put them in read-only memory.

Before:
   text    data     bss     dec     hex filename
  53102    6885     576   60563    ec93 drivers/nvme/host/tcp.o

After:
   text    data     bss     dec     hex filename
  53422    6565     576   60563    ec93 drivers/nvme/host/tcp.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/nvme/host/tcp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index c79e248b9f43..2d6c884afc63 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -131,8 +131,8 @@ struct nvme_tcp_ctrl {
 static LIST_HEAD(nvme_tcp_ctrl_list);
 static DEFINE_MUTEX(nvme_tcp_ctrl_mutex);
 static struct workqueue_struct *nvme_tcp_wq;
-static struct blk_mq_ops nvme_tcp_mq_ops;
-static struct blk_mq_ops nvme_tcp_admin_mq_ops;
+static const struct blk_mq_ops nvme_tcp_mq_ops;
+static const struct blk_mq_ops nvme_tcp_admin_mq_ops;
 static int nvme_tcp_try_send(struct nvme_tcp_queue *queue);
 
 static inline struct nvme_tcp_ctrl *to_tcp_ctrl(struct nvme_ctrl *ctrl)
@@ -2333,7 +2333,7 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx)
 	return queue->nr_cqe;
 }
 
-static struct blk_mq_ops nvme_tcp_mq_ops = {
+static const struct blk_mq_ops nvme_tcp_mq_ops = {
 	.queue_rq	= nvme_tcp_queue_rq,
 	.complete	= nvme_complete_rq,
 	.init_request	= nvme_tcp_init_request,
@@ -2344,7 +2344,7 @@ static struct blk_mq_ops nvme_tcp_mq_ops = {
 	.poll		= nvme_tcp_poll,
 };
 
-static struct blk_mq_ops nvme_tcp_admin_mq_ops = {
+static const struct blk_mq_ops nvme_tcp_admin_mq_ops = {
 	.queue_rq	= nvme_tcp_queue_rq,
 	.complete	= nvme_complete_rq,
 	.init_request	= nvme_tcp_init_request,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme-tcp: constify static struct blk_mq_ops
  2020-05-28 22:25 [PATCH] nvme-tcp: constify static struct blk_mq_ops Rikard Falkeborn
@ 2020-05-28 22:33 ` Sagi Grimberg
  2020-05-31  9:04 ` Max Gurtovoy
  2020-06-09 13:44 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2020-05-28 22:33 UTC (permalink / raw)
  To: Rikard Falkeborn, Keith Busch, Jens Axboe, Christoph Hellwig
  Cc: linux-kernel, linux-nvme

Acked-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme-tcp: constify static struct blk_mq_ops
  2020-05-28 22:25 [PATCH] nvme-tcp: constify static struct blk_mq_ops Rikard Falkeborn
  2020-05-28 22:33 ` Sagi Grimberg
@ 2020-05-31  9:04 ` Max Gurtovoy
  2020-06-09 13:44 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Max Gurtovoy @ 2020-05-31  9:04 UTC (permalink / raw)
  To: Rikard Falkeborn, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg
  Cc: linux-kernel, linux-nvme

Looks good,

Reviewed-by: Max Gurtovoy <maxg@mellanox.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nvme-tcp: constify static struct blk_mq_ops
  2020-05-28 22:25 [PATCH] nvme-tcp: constify static struct blk_mq_ops Rikard Falkeborn
  2020-05-28 22:33 ` Sagi Grimberg
  2020-05-31  9:04 ` Max Gurtovoy
@ 2020-06-09 13:44 ` Christoph Hellwig
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-06-09 13:44 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	linux-nvme, linux-kernel

Thanks,

applied to nvme-5.8.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-09 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 22:25 [PATCH] nvme-tcp: constify static struct blk_mq_ops Rikard Falkeborn
2020-05-28 22:33 ` Sagi Grimberg
2020-05-31  9:04 ` Max Gurtovoy
2020-06-09 13:44 ` Christoph Hellwig

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).