Skip to content

Commit 6acbd96

Browse files
rikardfalkebornaxboe
authored andcommitted
nvme-tcp: constify nvme_tcp_mq_ops and nvme_tcp_admin_mq_ops
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 <[email protected]> Acked-by: Sagi Grimberg <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 108a585 commit 6acbd96

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/nvme/host/tcp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ struct nvme_tcp_ctrl {
131131
static LIST_HEAD(nvme_tcp_ctrl_list);
132132
static DEFINE_MUTEX(nvme_tcp_ctrl_mutex);
133133
static struct workqueue_struct *nvme_tcp_wq;
134-
static struct blk_mq_ops nvme_tcp_mq_ops;
135-
static struct blk_mq_ops nvme_tcp_admin_mq_ops;
134+
static const struct blk_mq_ops nvme_tcp_mq_ops;
135+
static const struct blk_mq_ops nvme_tcp_admin_mq_ops;
136136
static int nvme_tcp_try_send(struct nvme_tcp_queue *queue);
137137

138138
static inline struct nvme_tcp_ctrl *to_tcp_ctrl(struct nvme_ctrl *ctrl)
@@ -2338,7 +2338,7 @@ static int nvme_tcp_poll(struct blk_mq_hw_ctx *hctx)
23382338
return queue->nr_cqe;
23392339
}
23402340

2341-
static struct blk_mq_ops nvme_tcp_mq_ops = {
2341+
static const struct blk_mq_ops nvme_tcp_mq_ops = {
23422342
.queue_rq = nvme_tcp_queue_rq,
23432343
.complete = nvme_complete_rq,
23442344
.init_request = nvme_tcp_init_request,
@@ -2349,7 +2349,7 @@ static struct blk_mq_ops nvme_tcp_mq_ops = {
23492349
.poll = nvme_tcp_poll,
23502350
};
23512351

2352-
static struct blk_mq_ops nvme_tcp_admin_mq_ops = {
2352+
static const struct blk_mq_ops nvme_tcp_admin_mq_ops = {
23532353
.queue_rq = nvme_tcp_queue_rq,
23542354
.complete = nvme_complete_rq,
23552355
.init_request = nvme_tcp_init_request,

0 commit comments

Comments
 (0)