Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752268Ab2JPCQ4 (ORCPT ); Mon, 15 Oct 2012 22:16:56 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:51105 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893Ab2JPCQy (ORCPT ); Mon, 15 Oct 2012 22:16:54 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 15 Oct 2012 23:16:54 -0300 Message-ID: Subject: Re: [PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg() From: Ezequiel Garcia To: Jesper Juhl Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2130 Lines: 58 On Mon, Oct 15, 2012 at 9:03 PM, Jesper Juhl wrote: > On Mon, 15 Oct 2012, Ezequiel Garcia wrote: > >> On Mon, Oct 15, 2012 at 7:52 PM, Jesper Juhl wrote: >> > On Mon, 15 Oct 2012, Jesper Juhl wrote: >> > >> >> On Sat, 13 Oct 2012, Ezequiel Garcia wrote: >> >> > [...] >> > Currently there are two checks for 'rc' being less than zero with no >> > change to 'rc' between the two, so the second is just dead code. >> > The intention seems to have been to assign the return value of >> > 'stk1160_read_reg()' to 'rc' before the (currently dead) second check >> > and then test /that/. This patch does that. >> > >> >> This is an overly complicated explanation for such a small patch. >> Can you try to simplify it? >> > How's this? > > > From: Jesper Juhl > Date: Sat, 13 Oct 2012 00:16:37 +0200 > Subject: [PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg() > > Remember to collect the exit status from 'stk1160_read_reg()' in 'rc' > before testing it for less than zero. > > Signed-off-by: Jesper Juhl > --- > drivers/media/usb/stk1160/stk1160-i2c.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c > index 176ac93..a2370e4 100644 > --- a/drivers/media/usb/stk1160/stk1160-i2c.c > +++ b/drivers/media/usb/stk1160/stk1160-i2c.c > @@ -116,10 +116,9 @@ static int stk1160_i2c_read_reg(struct stk1160 *dev, u8 addr, > if (rc < 0) > return rc; > > - stk1160_read_reg(dev, STK1160_SBUSR_RD, value); > + rc = stk1160_read_reg(dev, STK1160_SBUSR_RD, value); > if (rc < 0) > return rc; > - ^^^^^^^^^^^^^^^^^^^^^^^^ Sorry for the nitpick, but I'd like you to *not* remove this line. Thanks Ezequiel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/