Skip to content

Commit aceee63

Browse files
tititiou36rleon
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/f02eb630734ee530315dce9f60b078f631ae93d0.1730477345.git.christophe.jaillet@wanadoo.fr Signed-off-by: Leon Romanovsky <[email protected]>
1 parent cf90a4d commit aceee63

File tree

1 file changed

+0
-19
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+0
-19
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ static void bnxt_re_shutdown(struct auxiliary_device *adev)
300300
struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
301301
struct bnxt_re_dev *rdev;
302302

303-
if (!en_info)
304-
return;
305-
306303
rdev = en_info->rdev;
307304
ib_unregister_device(&rdev->ibdev);
308305
bnxt_re_dev_uninit(rdev, BNXT_RE_COMPLETE_REMOVE);
@@ -316,9 +313,6 @@ static void bnxt_re_stop_irq(void *handle)
316313
struct bnxt_qplib_nq *nq;
317314
int indx;
318315

319-
if (!en_info)
320-
return;
321-
322316
rdev = en_info->rdev;
323317
rcfw = &rdev->rcfw;
324318

@@ -339,9 +333,6 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)
339333
struct bnxt_qplib_nq *nq;
340334
int indx, rc;
341335

342-
if (!en_info)
343-
return;
344-
345336
rdev = en_info->rdev;
346337
msix_ent = rdev->en_dev->msix_entries;
347338
rcfw = &rdev->rcfw;
@@ -1991,10 +1982,6 @@ static void bnxt_re_remove(struct auxiliary_device *adev)
19911982
struct bnxt_re_dev *rdev;
19921983

19931984
mutex_lock(&bnxt_re_mutex);
1994-
if (!en_info) {
1995-
mutex_unlock(&bnxt_re_mutex);
1996-
return;
1997-
}
19981985
rdev = en_info->rdev;
19991986

20001987
if (rdev)
@@ -2043,9 +2030,6 @@ static int bnxt_re_suspend(struct auxiliary_device *adev, pm_message_t state)
20432030
struct bnxt_en_dev *en_dev;
20442031
struct bnxt_re_dev *rdev;
20452032

2046-
if (!en_info)
2047-
return 0;
2048-
20492033
rdev = en_info->rdev;
20502034
en_dev = en_info->en_dev;
20512035
mutex_lock(&bnxt_re_mutex);
@@ -2090,9 +2074,6 @@ static int bnxt_re_resume(struct auxiliary_device *adev)
20902074
struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
20912075
struct bnxt_re_dev *rdev;
20922076

2093-
if (!en_info)
2094-
return 0;
2095-
20962077
mutex_lock(&bnxt_re_mutex);
20972078
/* L2 driver may invoke this callback during device recovery, resume.
20982079
* reset. Current RoCE driver doesn't recover the device in case of

0 commit comments

Comments
 (0)