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>
This commit is contained in:
Markus Elfring 2016-07-23 08:30:52 +02:00 committed by Doug Ledford
parent 3f85f2aaab
commit f7ca535ba0

View File

@ -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;