lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151105081800.GU18797@mwanda>
Date:	Thu, 5 Nov 2015 11:18:00 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:	Doug Ledford <dledford@...hat.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Hal Rosenstock <hal.rosenstock@...il.com>,
	Mike Marciniszyn <infinipath@...el.com>,
	Sean Hefty <sean.hefty@...el.com>, linux-rdma@...r.kernel.org,
	devel@...verdev.osuosl.org, Julia Lawall <julia.lawall@...6.fr>,
	kernel-janitors@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging/rdma/hfi1: Delete unnecessary checks before two
 function calls

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ