Commit 00d0427f authored by Kalesh AP's avatar Kalesh AP Committed by Leon Romanovsky

RDMA/bnxt_re: Avoid unnecessary memset

Avoid memset by initializing the variables during
declaration itself.
Signed-off-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/1691052326-32143-6-git-send-email-selvin.xavier@broadcom.comSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent e59a5cec
...@@ -2797,7 +2797,6 @@ static int bnxt_re_post_recv_shadow_qp(struct bnxt_re_dev *rdev, ...@@ -2797,7 +2797,6 @@ static int bnxt_re_post_recv_shadow_qp(struct bnxt_re_dev *rdev,
struct bnxt_qplib_swqe wqe; struct bnxt_qplib_swqe wqe;
int rc = 0; int rc = 0;
memset(&wqe, 0, sizeof(wqe));
while (wr) { while (wr) {
/* House keeping */ /* House keeping */
memset(&wqe, 0, sizeof(wqe)); memset(&wqe, 0, sizeof(wqe));
......
...@@ -395,10 +395,9 @@ static int bnxt_re_hwrm_qcfg(struct bnxt_re_dev *rdev, u32 *db_len, ...@@ -395,10 +395,9 @@ static int bnxt_re_hwrm_qcfg(struct bnxt_re_dev *rdev, u32 *db_len,
struct bnxt_en_dev *en_dev = rdev->en_dev; struct bnxt_en_dev *en_dev = rdev->en_dev;
struct hwrm_func_qcfg_output resp = {0}; struct hwrm_func_qcfg_output resp = {0};
struct hwrm_func_qcfg_input req = {0}; struct hwrm_func_qcfg_input req = {0};
struct bnxt_fw_msg fw_msg; struct bnxt_fw_msg fw_msg = {};
int rc; int rc;
memset(&fw_msg, 0, sizeof(fw_msg));
bnxt_re_init_hwrm_hdr((void *)&req, HWRM_FUNC_QCFG); bnxt_re_init_hwrm_hdr((void *)&req, HWRM_FUNC_QCFG);
req.fid = cpu_to_le16(0xffff); req.fid = cpu_to_le16(0xffff);
bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp, bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp,
...@@ -969,7 +968,7 @@ static int bnxt_re_handle_unaffi_async_event(struct creq_func_event ...@@ -969,7 +968,7 @@ static int bnxt_re_handle_unaffi_async_event(struct creq_func_event
static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event, static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event,
struct bnxt_re_qp *qp) struct bnxt_re_qp *qp)
{ {
struct ib_event event; struct ib_event event = {};
unsigned int flags; unsigned int flags;
if (qp->qplib_qp.state == CMDQ_MODIFY_QP_NEW_STATE_ERR && if (qp->qplib_qp.state == CMDQ_MODIFY_QP_NEW_STATE_ERR &&
...@@ -979,7 +978,6 @@ static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event, ...@@ -979,7 +978,6 @@ static int bnxt_re_handle_qp_async_event(struct creq_qp_event *qp_event,
bnxt_re_unlock_cqs(qp, flags); bnxt_re_unlock_cqs(qp, flags);
} }
memset(&event, 0, sizeof(event));
if (qp->qplib_qp.srq) { if (qp->qplib_qp.srq) {
event.device = &qp->rdev->ibdev; event.device = &qp->rdev->ibdev;
event.element.qp = &qp->ib_qp; event.element.qp = &qp->ib_qp;
...@@ -1299,11 +1297,10 @@ static u32 bnxt_re_get_priority_mask(struct bnxt_re_dev *rdev) ...@@ -1299,11 +1297,10 @@ static u32 bnxt_re_get_priority_mask(struct bnxt_re_dev *rdev)
{ {
u32 prio_map = 0, tmp_map = 0; u32 prio_map = 0, tmp_map = 0;
struct net_device *netdev; struct net_device *netdev;
struct dcb_app app; struct dcb_app app = {};
netdev = rdev->netdev; netdev = rdev->netdev;
memset(&app, 0, sizeof(app));
app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE; app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE;
app.protocol = ETH_P_IBOE; app.protocol = ETH_P_IBOE;
tmp_map = dcb_ieee_getapp_mask(netdev, &app); tmp_map = dcb_ieee_getapp_mask(netdev, &app);
...@@ -1445,15 +1442,14 @@ static void bnxt_re_worker(struct work_struct *work) ...@@ -1445,15 +1442,14 @@ static void bnxt_re_worker(struct work_struct *work)
static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode) static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode)
{ {
struct bnxt_re_ring_attr rattr = {};
struct bnxt_qplib_creq_ctx *creq; struct bnxt_qplib_creq_ctx *creq;
struct bnxt_re_ring_attr rattr;
u32 db_offt; u32 db_offt;
int vid; int vid;
u8 type; u8 type;
int rc; int rc;
/* Registered a new RoCE device instance to netdev */ /* Registered a new RoCE device instance to netdev */
memset(&rattr, 0, sizeof(rattr));
rc = bnxt_re_register_netdev(rdev); rc = bnxt_re_register_netdev(rdev);
if (rc) { if (rc) {
ibdev_err(&rdev->ibdev, ibdev_err(&rdev->ibdev,
......
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