]> git.baikalelectronics.ru Git - kernel.git/commit
staging: ozwpan: Separate success & failure case for oz_hcd_pd_arrived()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 13 Aug 2013 17:29:26 +0000 (18:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2013 21:15:40 +0000 (14:15 -0700)
commit61b8674966142483d346b9a472277b31500daf5b
treeffae98f0b84ea7fdec43d9d0e39401eecbb269cd
parent78d90a349c16e2b1dc862e56f63f9bcb70399938
staging: ozwpan: Separate success & failure case for oz_hcd_pd_arrived()

This patch separates success & failure block along with fixing
following issues:-

1. The way oz_hcd_pd_arrived() looks now it's easy to think we free "ep" but
actually we do this spaghetti thing of setting it to NULL on success.

2. It is hard to read it because there are unlocks scattered throughout.

3. Currently we set "ep" to NULL on the success path and then test it and or
free it. In current code you have to scroll to the start of the function
to read code.

Original patch was submitted by Dan here :-
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-August/040113.html

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozhcd.c