Browse Source

IB/hfi1: NULL arg to sc_return_credits is OK

The sc_return_credits() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Markus Elfring 9 years ago
parent
commit
f7ca535ba0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/infiniband/hw/hfi1/file_ops.c

+ 1 - 1
drivers/infiniband/hw/hfi1/file_ops.c

@@ -225,7 +225,7 @@ static long hfi1_file_ioctl(struct file *fp, unsigned int cmd,
 				    sizeof(struct hfi1_base_info));
 				    sizeof(struct hfi1_base_info));
 		break;
 		break;
 	case HFI1_IOCTL_CREDIT_UPD:
 	case HFI1_IOCTL_CREDIT_UPD:
-		if (uctxt && uctxt->sc)
+		if (uctxt)
 			sc_return_credits(uctxt->sc);
 			sc_return_credits(uctxt->sc);
 		break;
 		break;