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]
Date:	Mon, 15 Dec 2014 08:39:03 -0800
From:	Joe Perches <joe@...ches.com>
To:	Karthik Nayak <karthik.188@...il.com>
Cc:	trivial@...nel.org, linux-kernel@...r.kernel.org,
	gregkh@...uxfoundation.org, Larry.Finger@...inger.net
Subject: Re: [PATCH] Staging: rtl8712: removed an unnecessary else statement

On Mon, 2014-12-15 at 20:55 +0530, Karthik Nayak wrote:
> As per checkpatch warning, removed an unnecessary else statement
> proceeding an if statement with a return.

This is not a correct change.
The checkpatch message said "generally".
You still have to verify the code.

> diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
> index cd8b444..800b2b3 100644
> --- a/drivers/staging/rtl8712/rtl8712_recv.c
> +++ b/drivers/staging/rtl8712/rtl8712_recv.c
> @@ -496,8 +496,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
>  			plist = plist->next;
>  		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
>  			return false;
> -		else
> -			break;
> +		break;


It's not the same logic.
It would be if the code was:

	while (end_of_queue_search(phead, plist) == false) {
		pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
		pnextattrib = &pnextrframe->u.hdr.attrib;
		if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) {
			plist = plist->next;
			continue;
		} else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) {
			return false;
		}
		break;
	}

But that's not necessary.

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