Skip to contentSkip to conversation

IB/srpt: Suppress a compiler warning

PATCH In review Bart Van Assche 2 participants 2 messages Mar 30, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/srpt: Suppress a compiler warning

Remove a BUG_ON(!ch) statement because it is superfluous - if the ch pointer would be NULL then the assignment in the first line of srpt_map_sg_to_ib_sge() would trigger a kernel oops anyway.

This patch suppresses the following compiler warning:

Possible null pointer dereference: ch - otherwise it is redundant to check it against null.

---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 1 -
 1 file changed, 1 deletion(-)
(quoted diff) +0 -0

b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 6e0a477..4e74fc8 100644

drivers/infiniband/ulp/srpt/ib_srpt.c +0 -0
@@ -1095,7 +1095,6 @@ static int srpt_map_sg_to_ib_sge(struct

srpt_rdma_ch *ch,
int count, nrdma;
int i, j, k;

- BUG_ON(!ch);
BUG_ON(!ioctx);
cmd = &ioctx->cmd;
dir = cmd->data_direction;

Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by
#2 lore raw
In reply to a message not in the archive
Quoted 28 lines · Bart Van Assche

Remove a BUG_ON(!ch) statement because it is superfluous - if the ch pointer would be NULL then the assignment in the first line of srpt_map_sg_to_ib_sge() would trigger a kernel oops anyway.

This patch suppresses the following compiler warning:

Possible null pointer dereference: ch - otherwise it is redundant to check it against null.

---
  drivers/infiniband/ulp/srpt/ib_srpt.c | 1 -
  1 file changed, 1 deletion(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +0 -1
index 6e0a477..4e74fc8 100644
@@ -1095,7 +1095,6 @@ static int srpt_map_sg_to_ib_sge(struct
 srpt_rdma_ch *ch,
  	int count, nrdma;
  	int i, j, k;
 
-	BUG_ON(!ch);
  	BUG_ON(!ioctx);
  	cmd = &ioctx->cmd;
Quoted 2 lines
  	dir = cmd->data_direction;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html