Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
f7ca535ba0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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));
 		break;
 	case HFI1_IOCTL_CREDIT_UPD:
-		if (uctxt && uctxt->sc)
+		if (uctxt)
 			sc_return_credits(uctxt->sc);
 		break;