Re: [PATCH] staging/rdma/hfi1: Delete unnecessary checks before two function calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 05, 2015 at 09:10:47AM +0100, SF Markus Elfring wrote:
> diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c
> index aae9826..204d1d0 100644
> --- a/drivers/staging/rdma/hfi1/file_ops.c
> +++ b/drivers/staging/rdma/hfi1/file_ops.c
> @@ -313,7 +313,7 @@ static ssize_t hfi1_file_write(struct file *fp, const char __user *data,
>  	case HFI1_CMD_SDMA_STATUS_UPD:
>  		break;
>  	case HFI1_CMD_CREDIT_UPD:
> -		if (uctxt && uctxt->sc)
> +		if (uctxt)
>  			sc_return_credits(uctxt->sc);

Relying on hidden sanity checks makes the code harder to read.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux