diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-11-01 17:10:57 +0100 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2024-11-03 11:02:02 -0500 |
commit | aceee63a3aba4611f89dfc7e127792f469f45526 (patch) | |
tree | 77fdad6501cc0726d69c9e6139cd7cc5b086623d /drivers | |
parent | cf90a4d1b9ff9e09442226bdb18fec45f013db9d (diff) |
RDMA/bnxt_re: Remove some dead code
If the probe succeeds, then auxiliary_get_drvdata() can't return a NULL
pointer.
So several NULL checks can be removed to simplify code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/f02eb630734ee530315dce9f60b078f631ae93d0.1730477345.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/main.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 465cec4a1bd4..9eb290ec71a8 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -300,9 +300,6 @@ static void bnxt_re_shutdown(struct auxiliary_device *adev) struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev); struct bnxt_re_dev *rdev; - if (!en_info) - return; - rdev = en_info->rdev; ib_unregister_device(&rdev->ibdev); bnxt_re_dev_uninit(rdev, BNXT_RE_COMPLETE_REMOVE); @@ -316,9 +313,6 @@ static void bnxt_re_stop_irq(void *handle) struct bnxt_qplib_nq *nq; int indx; - if (!en_info) - return; - rdev = en_info->rdev; rcfw = &rdev->rcfw; @@ -339,9 +333,6 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent) struct bnxt_qplib_nq *nq; int indx, rc; - if (!en_info) - return; - rdev = en_info->rdev; msix_ent = rdev->en_dev->msix_entries; rcfw = &rdev->rcfw; @@ -1991,10 +1982,6 @@ static void bnxt_re_remove(struct auxiliary_device *adev) struct bnxt_re_dev *rdev; mutex_lock(&bnxt_re_mutex); - if (!en_info) { - mutex_unlock(&bnxt_re_mutex); - return; - } rdev = en_info->rdev; if (rdev) @@ -2043,9 +2030,6 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state) struct bnxt_en_dev *en_dev; struct bnxt_re_dev *rdev; - if (!en_info) - return 0; - rdev = en_info->rdev; en_dev = en_info->en_dev; mutex_lock(&bnxt_re_mutex); @@ -2090,9 +2074,6 @@ static int bnxt_re_resume(struct auxiliary_device *adev) struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev); struct bnxt_re_dev *rdev; - if (!en_info) - return 0; - mutex_lock(&bnxt_re_mutex); /* L2 driver may invoke this callback during device recovery, resume. * reset. Current RoCE driver doesn't recover the device in case of |