Commit 91750110 authored by Netanel Belgazal's avatar Netanel Belgazal Committed by David S. Miller

net: ena: change sizeof() argument to be the type pointer

Instead of using:
memset(ptr, 0x0, sizeof(struct ...))
use:
memset(ptr, 0x0, sizeor(*ptr))
Signed-off-by: default avatarNetanel Belgazal <netanel@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 82ef30f1
...@@ -329,7 +329,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev, ...@@ -329,7 +329,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev,
size_t size; size_t size;
int dev_node = 0; int dev_node = 0;
memset(&io_sq->desc_addr, 0x0, sizeof(struct ena_com_io_desc_addr)); memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr));
io_sq->desc_entry_size = io_sq->desc_entry_size =
(io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ?
...@@ -383,7 +383,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev, ...@@ -383,7 +383,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_dev,
size_t size; size_t size;
int prev_node = 0; int prev_node = 0;
memset(&io_cq->cdesc_addr, 0x0, sizeof(struct ena_com_io_desc_addr)); memset(&io_cq->cdesc_addr, 0x0, sizeof(io_cq->cdesc_addr));
/* Use the basic completion descriptor for Rx */ /* Use the basic completion descriptor for Rx */
io_cq->cdesc_entry_size_in_bytes = io_cq->cdesc_entry_size_in_bytes =
...@@ -685,7 +685,7 @@ static int ena_com_destroy_io_sq(struct ena_com_dev *ena_dev, ...@@ -685,7 +685,7 @@ static int ena_com_destroy_io_sq(struct ena_com_dev *ena_dev,
u8 direction; u8 direction;
int ret; int ret;
memset(&destroy_cmd, 0x0, sizeof(struct ena_admin_aq_destroy_sq_cmd)); memset(&destroy_cmd, 0x0, sizeof(destroy_cmd));
if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) if (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX)
direction = ENA_ADMIN_SQ_DIRECTION_TX; direction = ENA_ADMIN_SQ_DIRECTION_TX;
...@@ -967,7 +967,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *ena_dev, ...@@ -967,7 +967,7 @@ static int ena_com_create_io_sq(struct ena_com_dev *ena_dev,
u8 direction; u8 direction;
int ret; int ret;
memset(&create_cmd, 0x0, sizeof(struct ena_admin_aq_create_sq_cmd)); memset(&create_cmd, 0x0, sizeof(create_cmd));
create_cmd.aq_common_descriptor.opcode = ENA_ADMIN_CREATE_SQ; create_cmd.aq_common_descriptor.opcode = ENA_ADMIN_CREATE_SQ;
...@@ -1159,7 +1159,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev, ...@@ -1159,7 +1159,7 @@ int ena_com_create_io_cq(struct ena_com_dev *ena_dev,
struct ena_admin_acq_create_cq_resp_desc cmd_completion; struct ena_admin_acq_create_cq_resp_desc cmd_completion;
int ret; int ret;
memset(&create_cmd, 0x0, sizeof(struct ena_admin_aq_create_cq_cmd)); memset(&create_cmd, 0x0, sizeof(create_cmd));
create_cmd.aq_common_descriptor.opcode = ENA_ADMIN_CREATE_CQ; create_cmd.aq_common_descriptor.opcode = ENA_ADMIN_CREATE_CQ;
...@@ -1267,7 +1267,7 @@ int ena_com_destroy_io_cq(struct ena_com_dev *ena_dev, ...@@ -1267,7 +1267,7 @@ int ena_com_destroy_io_cq(struct ena_com_dev *ena_dev,
struct ena_admin_acq_destroy_cq_resp_desc destroy_resp; struct ena_admin_acq_destroy_cq_resp_desc destroy_resp;
int ret; int ret;
memset(&destroy_cmd, 0x0, sizeof(struct ena_admin_aq_destroy_sq_cmd)); memset(&destroy_cmd, 0x0, sizeof(destroy_cmd));
destroy_cmd.cq_idx = io_cq->idx; destroy_cmd.cq_idx = io_cq->idx;
destroy_cmd.aq_common_descriptor.opcode = ENA_ADMIN_DESTROY_CQ; destroy_cmd.aq_common_descriptor.opcode = ENA_ADMIN_DESTROY_CQ;
...@@ -1623,8 +1623,8 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev, ...@@ -1623,8 +1623,8 @@ int ena_com_create_io_queue(struct ena_com_dev *ena_dev,
io_sq = &ena_dev->io_sq_queues[ctx->qid]; io_sq = &ena_dev->io_sq_queues[ctx->qid];
io_cq = &ena_dev->io_cq_queues[ctx->qid]; io_cq = &ena_dev->io_cq_queues[ctx->qid];
memset(io_sq, 0x0, sizeof(struct ena_com_io_sq)); memset(io_sq, 0x0, sizeof(*io_sq));
memset(io_cq, 0x0, sizeof(struct ena_com_io_cq)); memset(io_cq, 0x0, sizeof(*io_cq));
/* Init CQ */ /* Init CQ */
io_cq->q_depth = ctx->queue_size; io_cq->q_depth = ctx->queue_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment