From: Markus Elfring Date: Sat, 23 Jul 2016 06:30:52 +0000 (+0200) Subject: IB/hfi1: NULL arg to sc_return_credits is OK X-Git-Tag: v4.8-rc1~35^2^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7ca535ba0b2268609d50bcd4bc3e8267dfd01b3;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c index 7a5b0e676cc7a..3b792c5023d0a 100644 --- a/drivers/infiniband/hw/hfi1/file_ops.c +++ b/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;