Skip to content

Commit a40aae6

Browse files
Max Gurtovoyaxboe
authored andcommitted
nvmet-tcp: constify nvmet_tcp_ops
nvmet_tcp_ops is never modified and can be made const to allow the compiler to put it in read-only memory, as done in other transports. Before: text data bss dec hex filename 16164 160 12 16336 3fd0 drivers/nvme/target/tcp.o After: text data bss dec hex filename 16277 64 12 16353 3fe1 drivers/nvme/target/tcp.o Signed-off-by: Max Gurtovoy <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Israel Rukshin <[email protected]> Acked-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 6acbd96 commit a40aae6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/nvme/target/tcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static LIST_HEAD(nvmet_tcp_queue_list);
153153
static DEFINE_MUTEX(nvmet_tcp_queue_mutex);
154154

155155
static struct workqueue_struct *nvmet_tcp_wq;
156-
static struct nvmet_fabrics_ops nvmet_tcp_ops;
156+
static const struct nvmet_fabrics_ops nvmet_tcp_ops;
157157
static void nvmet_tcp_free_cmd(struct nvmet_tcp_cmd *c);
158158
static void nvmet_tcp_finish_cmd(struct nvmet_tcp_cmd *cmd);
159159

@@ -1747,7 +1747,7 @@ static void nvmet_tcp_disc_port_addr(struct nvmet_req *req,
17471747
}
17481748
}
17491749

1750-
static struct nvmet_fabrics_ops nvmet_tcp_ops = {
1750+
static const struct nvmet_fabrics_ops nvmet_tcp_ops = {
17511751
.owner = THIS_MODULE,
17521752
.type = NVMF_TRTYPE_TCP,
17531753
.msdbd = 1,

0 commit comments

Comments
 (0)