Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Joe Perches
On Thu, 2015-05-28 at 18:21 +0200, Julia Lawall wrote: > > On Wed, 27 May 2015, Joe Perches wrote: > > > On Thu, 2015-05-28 at 07:43 +0200, Julia Lawall wrote: > > > On Wed, 27 May 2015, Joe Perches wrote: > > > > Perhaps all of the uses like: > > > > > > > > goto ; > > > > : > > > > > >

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Julia Lawall
On Wed, 27 May 2015, Joe Perches wrote: > On Thu, 2015-05-28 at 07:43 +0200, Julia Lawall wrote: > > On Wed, 27 May 2015, Joe Perches wrote: > > > Perhaps all of the uses like: > > > > > > goto ; > > > : > > > > > > could be modified. There are ~150 in the kernel. > > > > I wrote a semantic p

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Joe Perches
On Thu, 2015-05-28 at 10:14 +0300, Dan Carpenter wrote: > On Wed, May 27, 2015 at 01:30:08PM -0700, Joe Perches wrote: > > Perhaps all of the uses like: > > goto ; > > : > > > > could be modified. There are ~150 in the kernel. > > Joe, these are a kind of style. You're just directing a newb

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Joe Perches
On Thu, 2015-05-28 at 10:33 +0200, Julia Lawall wrote: > On Thu, 28 May 2015, Joe Perches wrote: > I think these are very equivalent style to > > the repeated: > > > > ret = foo(); > > if (ret < 0) > > return ret; > > ... > > ret = bar(); > > if (ret < 0) > >

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Julia Lawall
On Thu, 28 May 2015, Joe Perches wrote: > On Thu, 2015-05-28 at 10:14 +0300, Dan Carpenter wrote: > > On Wed, May 27, 2015 at 01:30:08PM -0700, Joe Perches wrote: > > > Perhaps all of the uses like: > > > goto ; > > > : > > > > > > could be modified. There are ~150 in the kernel. > > > > Joe, t

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Dan Carpenter
Obviously, I endorse this idea. :) Every out label in this file is a do-nothing label or a do-everything label, but with bugs. usb_boot() should look like: free_tx_buf: kfree(tx_buf); release_firm: release_firmware(firm); ret; If we fail to allocate "tx_buf" then we sh

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-28 Thread Dan Carpenter
On Wed, May 27, 2015 at 01:30:08PM -0700, Joe Perches wrote: > On Wed, 2015-05-27 at 22:25 +0200, Laurent Navet wrote: > > The same code is executed regardless ret value, so this test can be > > removed. > [] > > diff --git a/drivers/staging/gdm72xx/usb_boot.c > > b/drivers/staging/gdm72xx/usb_boo

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Joe Perches
On Thu, 2015-05-28 at 07:43 +0200, Julia Lawall wrote: > On Wed, 27 May 2015, Joe Perches wrote: > > Perhaps all of the uses like: > > > > goto ; > > : > > > > could be modified. There are ~150 in the kernel. > > I wrote a semantic patch recently for that as well... Maybe I can take > car

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Julia Lawall
On Wed, 27 May 2015, Joe Perches wrote: > On Wed, 2015-05-27 at 22:25 +0200, Laurent Navet wrote: > > The same code is executed regardless ret value, so this test can be > > removed. > [] > > diff --git a/drivers/staging/gdm72xx/usb_boot.c > > b/drivers/staging/gdm72xx/usb_boot.c > [] > > @@ -255

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Fabio Estevam
On Wed, May 27, 2015 at 5:25 PM, Laurent Navet wrote: > The same code is executed regardless ret value, so this test can be > removed. > > Signed-off-by: Laurent Navet > --- > drivers/staging/gdm72xx/usb_boot.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/staging/gdm72xx/usb

Re: [PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Joe Perches
On Wed, 2015-05-27 at 22:25 +0200, Laurent Navet wrote: > The same code is executed regardless ret value, so this test can be > removed. [] > diff --git a/drivers/staging/gdm72xx/usb_boot.c > b/drivers/staging/gdm72xx/usb_boot.c [] > @@ -255,8 +255,6 @@ static int em_wait_ack(struct usb_device *us

[PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Laurent Navet
The same code is executed regardless ret value, so this test can be removed. Signed-off-by: Laurent Navet --- drivers/staging/gdm72xx/usb_boot.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c index 3ccc447..7f80553 10