From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbeCLJaw (ORCPT ); Mon, 12 Mar 2018 05:30:52 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52598 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbeCLJat (ORCPT ); Mon, 12 Mar 2018 05:30:49 -0400 X-Google-Smtp-Source: AG47ELtOnreOZse+uRR0gGgpRNAcuDNGqUhKf1/+vDh41mHAmYVx9H6yf0rudMxHRpwwS5vYSrxFgQ== Subject: Re: [PATCH v3] [media] Use common error handling code in 19 functions To: SF Markus Elfring , Sean Young , Seung-Woo Kim , Shyam Saini , Thomas Gleixner , Wei Yongjun Cc: linux-media@vger.kernel.org, Al Viro , Andi Shyti , Andrew Morton , Andrey Utkin , Arvind Yadav , Bhumika Goyal , Bjorn Helgaas , Brian Johnson , =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= , Christophe Jaillet , Colin Ian King , Daniele Nicolodi , =?UTF-8?Q?David_H=c3=a4rdeman?= , Devendra Sharma , "Gustavo A. R. Silva" , Hans Verkuil , Inki Dae , Joe Perches , Kees Cook , Laurent Pinchart , Masahiro Yamada , Mauro Carvalho Chehab , Max Kellermann , Mike Isely , Philippe Ombredanne , Sakari Ailus , Santosh Kumar Singh , Satendra Singh Thakur , LKML , kernel-janitors@vger.kernel.org References: <227d2d7c-5aee-1190-1624-26596a048d9c@users.sourceforge.net> <57ef3a56-2578-1d5f-1268-348b49b0c573@users.sourceforge.net> From: Todor Tomov Message-ID: <68dad3db-3bec-7f87-02a0-d77b304fb0ee@linaro.org> Date: Mon, 12 Mar 2018 11:30:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <57ef3a56-2578-1d5f-1268-348b49b0c573@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Markus, Thank you for the patch. On 9.03.2018 22:10, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 9 Mar 2018 21:00:12 +0100 > > Adjust jump targets so that a bit of exception handling can be better > reused at the end of these functions. > > This issue was partly detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > > v3: > Laurent Pinchart and Todor Tomov requested a few adjustments. > Updates were rebased on source files from Linux next-20180308. > > v2: > Hans Verkuil insisted on patch squashing. Thus several changes > were recombined based on source files from Linux next-20180216. > > The implementation of the function "tda8261_set_params" was improved > after a notification by Christoph Böhmwalder on 2017-09-26. > > drivers/media/dvb-core/dmxdev.c | 16 ++++---- > drivers/media/dvb-frontends/tda1004x.c | 20 ++++++---- > drivers/media/dvb-frontends/tda8261.c | 19 ++++++---- > drivers/media/pci/bt8xx/dst.c | 19 ++++++---- > drivers/media/pci/bt8xx/dst_ca.c | 30 +++++++-------- > drivers/media/pci/cx88/cx88-input.c | 17 +++++---- > drivers/media/platform/omap3isp/ispvideo.c | 28 ++++++-------- > .../media/platform/qcom/camss-8x16/camss-csid.c | 19 +++++----- > drivers/media/tuners/tuner-xc2028.c | 30 +++++++-------- > drivers/media/usb/cpia2/cpia2_usb.c | 13 ++++--- > drivers/media/usb/gspca/gspca.c | 17 +++++---- > drivers/media/usb/gspca/sn9c20x.c | 17 +++++---- > drivers/media/usb/pvrusb2/pvrusb2-ioread.c | 10 +++-- > drivers/media/usb/tm6000/tm6000-cards.c | 7 ++-- > drivers/media/usb/tm6000/tm6000-dvb.c | 11 ++++-- > drivers/media/usb/tm6000/tm6000-video.c | 13 ++++--- > drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 13 +++---- > drivers/media/usb/ttusb-dec/ttusb_dec.c | 43 ++++++++-------------- > 18 files changed, 171 insertions(+), 171 deletions(-) > > diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c b/drivers/media/platform/qcom/camss-8x16/camss-csid.c > index 64df82817de3..5c790d8c1f80 100644 > --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c > +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c > @@ -328,16 +328,12 @@ static int csid_set_power(struct v4l2_subdev *sd, int on) > return ret; > > ret = csid_set_clock_rates(csid); > - if (ret < 0) { > - regulator_disable(csid->vdda); > - return ret; > - } > + if (ret < 0) > + goto disable_regulator; > > ret = camss_enable_clocks(csid->nclocks, csid->clock, dev); > - if (ret < 0) { > - regulator_disable(csid->vdda); > - return ret; > - } > + if (ret < 0) > + goto disable_regulator; > > enable_irq(csid->irq); > > @@ -345,8 +341,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on) > if (ret < 0) { > disable_irq(csid->irq); > camss_disable_clocks(csid->nclocks, csid->clock); > - regulator_disable(csid->vdda); > - return ret; > + goto disable_regulator; > } > > hw_version = readl_relaxed(csid->base + CAMSS_CSID_HW_VERSION); > @@ -358,6 +353,10 @@ static int csid_set_power(struct v4l2_subdev *sd, int on) > } > > return ret; > + > +disable_regulator: > + regulator_disable(csid->vdda); > + return ret; > } > For the QComm CAMSS part of the patch: Acked-by: Todor Tomov -- Best regards, Todor Tomov From mboxrd@z Thu Jan 1 00:00:00 1970 From: Todor Tomov Date: Mon, 12 Mar 2018 09:30:44 +0000 Subject: Re: [PATCH v3] [media] Use common error handling code in 19 functions Message-Id: <68dad3db-3bec-7f87-02a0-d77b304fb0ee@linaro.org> List-Id: References: <227d2d7c-5aee-1190-1624-26596a048d9c@users.sourceforge.net> <57ef3a56-2578-1d5f-1268-348b49b0c573@users.sourceforge.net> In-Reply-To: <57ef3a56-2578-1d5f-1268-348b49b0c573@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: SF Markus Elfring , Sean Young , Seung-Woo Kim , Shyam Saini , Thomas Gleixner , Wei Yongjun Cc: linux-media@vger.kernel.org, Al Viro , Andi Shyti , Andrew Morton , Andrey Utkin , Arvind Yadav , Bhumika Goyal , Bjorn Helgaas , Brian Johnson , =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= , Christophe Jaillet , Colin Ian King , Daniele Nicolodi , =?UTF-8?Q?David_H=c3=a4rdeman?= , Devendra Sharma , "Gustavo A. R. Silva" , Hans Verkuil , Inki Dae , Joe Perches , Kees Cook , Laurent Pinchart , Masahiro Yamada , Mauro Carvalho Chehab , Max Kellermann , Mike Isely , Philippe Ombredanne , Sakari Ailus , Santosh Kumar Singh , Satendra Singh Thakur , LKML , kernel-janitors@vger.kernel.org Hi Markus, Thank you for the patch. On 9.03.2018 22:10, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 9 Mar 2018 21:00:12 +0100 >=20 > Adjust jump targets so that a bit of exception handling can be better > reused at the end of these functions. >=20 > This issue was partly detected by using the Coccinelle software. >=20 > Signed-off-by: Markus Elfring > --- >=20 > v3: > Laurent Pinchart and Todor Tomov requested a few adjustments. > Updates were rebased on source files from Linux next-20180308. >=20 > v2: > Hans Verkuil insisted on patch squashing. Thus several changes > were recombined based on source files from Linux next-20180216. >=20 > The implementation of the function "tda8261_set_params" was improved > after a notification by Christoph B=C3=B6hmwalder on 2017-09-26. >=20 > drivers/media/dvb-core/dmxdev.c | 16 ++++---- > drivers/media/dvb-frontends/tda1004x.c | 20 ++++++---- > drivers/media/dvb-frontends/tda8261.c | 19 ++++++---- > drivers/media/pci/bt8xx/dst.c | 19 ++++++---- > drivers/media/pci/bt8xx/dst_ca.c | 30 +++++++-------- > drivers/media/pci/cx88/cx88-input.c | 17 +++++---- > drivers/media/platform/omap3isp/ispvideo.c | 28 ++++++-------- > .../media/platform/qcom/camss-8x16/camss-csid.c | 19 +++++----- > drivers/media/tuners/tuner-xc2028.c | 30 +++++++-------- > drivers/media/usb/cpia2/cpia2_usb.c | 13 ++++--- > drivers/media/usb/gspca/gspca.c | 17 +++++---- > drivers/media/usb/gspca/sn9c20x.c | 17 +++++---- > drivers/media/usb/pvrusb2/pvrusb2-ioread.c | 10 +++-- > drivers/media/usb/tm6000/tm6000-cards.c | 7 ++-- > drivers/media/usb/tm6000/tm6000-dvb.c | 11 ++++-- > drivers/media/usb/tm6000/tm6000-video.c | 13 ++++--- > drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c | 13 +++---- > drivers/media/usb/ttusb-dec/ttusb_dec.c | 43 ++++++++--------= ------ > 18 files changed, 171 insertions(+), 171 deletions(-) >=20 > diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c b/driver= s/media/platform/qcom/camss-8x16/camss-csid.c > index 64df82817de3..5c790d8c1f80 100644 > --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c > +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c > @@ -328,16 +328,12 @@ static int csid_set_power(struct v4l2_subdev *sd, i= nt on) > return ret; > =20 > ret =3D csid_set_clock_rates(csid); > - if (ret < 0) { > - regulator_disable(csid->vdda); > - return ret; > - } > + if (ret < 0) > + goto disable_regulator; > =20 > ret =3D camss_enable_clocks(csid->nclocks, csid->clock, dev); > - if (ret < 0) { > - regulator_disable(csid->vdda); > - return ret; > - } > + if (ret < 0) > + goto disable_regulator; > =20 > enable_irq(csid->irq); > =20 > @@ -345,8 +341,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int= on) > if (ret < 0) { > disable_irq(csid->irq); > camss_disable_clocks(csid->nclocks, csid->clock); > - regulator_disable(csid->vdda); > - return ret; > + goto disable_regulator; > } > =20 > hw_version =3D readl_relaxed(csid->base + CAMSS_CSID_HW_VERSION); > @@ -358,6 +353,10 @@ static int csid_set_power(struct v4l2_subdev *sd, in= t on) > } > =20 > return ret; > + > +disable_regulator: > + regulator_disable(csid->vdda); > + return ret; > } > =20 For the QComm CAMSS part of the patch: Acked-by: Todor Tomov --=20 Best regards, Todor Tomov -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html