Skip to content

Commit 48886a8

Browse files
mgurtovoyjgunthorpe
authored andcommitted
IB/iser: Remove un-needed casting to/from void pointer
The void pointer can be typecasted to/from any type. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Max Gurtovoy <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 433dc0e commit 48886a8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

drivers/infiniband/ulp/iser/iser_verbs.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static void iser_connect_error(struct rdma_cm_id *cma_id)
501501
{
502502
struct iser_conn *iser_conn;
503503

504-
iser_conn = (struct iser_conn *)cma_id->context;
504+
iser_conn = cma_id->context;
505505
iser_conn->state = ISER_CONN_TERMINATING;
506506
}
507507

@@ -549,7 +549,7 @@ static void iser_addr_handler(struct rdma_cm_id *cma_id)
549549
struct ib_conn *ib_conn;
550550
int ret;
551551

552-
iser_conn = (struct iser_conn *)cma_id->context;
552+
iser_conn = cma_id->context;
553553
if (iser_conn->state != ISER_CONN_PENDING)
554554
/* bailout */
555555
return;
@@ -595,7 +595,7 @@ static void iser_route_handler(struct rdma_cm_id *cma_id)
595595
struct rdma_conn_param conn_param;
596596
int ret;
597597
struct iser_cm_hdr req_hdr;
598-
struct iser_conn *iser_conn = (struct iser_conn *)cma_id->context;
598+
struct iser_conn *iser_conn = cma_id->context;
599599
struct ib_conn *ib_conn = &iser_conn->ib_conn;
600600
struct ib_device *ib_dev = ib_conn->device->ib_device;
601601

@@ -638,7 +638,7 @@ static void iser_connected_handler(struct rdma_cm_id *cma_id,
638638
struct ib_qp_attr attr;
639639
struct ib_qp_init_attr init_attr;
640640

641-
iser_conn = (struct iser_conn *)cma_id->context;
641+
iser_conn = cma_id->context;
642642
if (iser_conn->state != ISER_CONN_PENDING)
643643
/* bailout */
644644
return;
@@ -661,7 +661,7 @@ static void iser_connected_handler(struct rdma_cm_id *cma_id,
661661

662662
static void iser_disconnected_handler(struct rdma_cm_id *cma_id)
663663
{
664-
struct iser_conn *iser_conn = (struct iser_conn *)cma_id->context;
664+
struct iser_conn *iser_conn = cma_id->context;
665665

666666
if (iser_conn_terminate(iser_conn)) {
667667
if (iser_conn->iscsi_conn)
@@ -675,7 +675,7 @@ static void iser_disconnected_handler(struct rdma_cm_id *cma_id)
675675
static void iser_cleanup_handler(struct rdma_cm_id *cma_id,
676676
bool destroy)
677677
{
678-
struct iser_conn *iser_conn = (struct iser_conn *)cma_id->context;
678+
struct iser_conn *iser_conn = cma_id->context;
679679

680680
/*
681681
* We are not guaranteed that we visited disconnected_handler
@@ -692,7 +692,7 @@ static int iser_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *eve
692692
struct iser_conn *iser_conn;
693693
int ret = 0;
694694

695-
iser_conn = (struct iser_conn *)cma_id->context;
695+
iser_conn = cma_id->context;
696696
iser_info("%s (%d): status %d conn %p id %p\n",
697697
rdma_event_msg(event->event), event->event,
698698
event->status, cma_id->context, cma_id);
@@ -784,8 +784,7 @@ int iser_connect(struct iser_conn *iser_conn,
784784
iser_conn->state = ISER_CONN_PENDING;
785785

786786
ib_conn->cma_id = rdma_create_id(&init_net, iser_cma_handler,
787-
(void *)iser_conn,
788-
RDMA_PS_TCP, IB_QPT_RC);
787+
iser_conn, RDMA_PS_TCP, IB_QPT_RC);
789788
if (IS_ERR(ib_conn->cma_id)) {
790789
err = PTR_ERR(ib_conn->cma_id);
791790
iser_err("rdma_create_id failed: %d\n", err);

0 commit comments

Comments
 (0)