From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org
Cc: "Al Viro" <viro@zeniv.linux.org.uk>,
"Andi Shyti" <andi.shyti@samsung.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Andrey Utkin" <andrey_utkin@fastmail.com>,
"Arvind Yadav" <arvind.yadav.cs@gmail.com>,
"Bhumika Goyal" <bhumirks@gmail.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Brian Johnson" <brijohn@gmail.com>,
"Christoph Böhmwalder" <christoph@boehmwalder.at>,
"Christophe Jaillet" <christophe.jaillet@wanadoo.fr>,
"Colin Ian King" <colin.king@canonical.com>,
"Daniele Nicolodi" <daniele@grinta.net>,
"David Härdeman" <david@hardeman.nu>,
"Devendra Sharma" <devendra.sharma9091@gmail.com>,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>,
"Hans Verkuil" <hans.verkuil@cisco.com>,
"Inki Dae" <inki.dae@samsung.com>,
"Joe Perches" <joe@perches.com>,
"Kees Cook" <keescook@chromium.org>,
"Masahiro Yamada" <yamada.masahiro@socionext.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Max Kellermann" <max.kellermann@gmail.com>,
"Mike Isely" <isely@pobox.com>,
"Philippe Ombredanne" <pombredanne@nexb.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Santosh Kumar Singh" <kumar.san1093@gmail.com>,
"Satendra Singh Thakur" <satendra.t@samsung.com>,
"Sean Young" <sean@mess.org>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
"Shyam Saini" <mayhs11saini@gmail.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Todor Tomov" <todor.tomov@linaro.org>,
"Wei Yongjun" <weiyongjun1@huawei.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [v2] [media] Use common error handling code in 20 functions
Date: Wed, 28 Feb 2018 09:45:21 +0100 [thread overview]
Message-ID: <783e7eff-2028-72be-b83c-77fc4340484e@users.sourceforge.net> (raw)
In-Reply-To: <3895609.4O6dNuP5Wm@avalon>
>> +put_isp:
>> + omap3isp_put(video->isp);
>> +delete_fh:
>> + v4l2_fh_del(&handle->vfh);
>> + v4l2_fh_exit(&handle->vfh);
>> + kfree(handle);
>
> Please prefix the error labels with error_.
How often do you really need such an extra prefix?
>> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
>> @@ -994,10 +994,8 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file,
>> void *fh, struct v4l2_queryctrl qc = { .id = ctrl->id };
>>
>> ret = uvc_query_v4l2_ctrl(chain, &qc);
>> - if (ret < 0) {
>> - ctrls->error_idx = i;
>> - return ret;
>> - }
>> + if (ret < 0)
>> + goto set_index;
>>
>> ctrl->value = qc.default_value;
>> }
>> @@ -1013,14 +1011,17 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file,
>> void *fh, ret = uvc_ctrl_get(chain, ctrl);
>> if (ret < 0) {
>> uvc_ctrl_rollback(handle);
>> - ctrls->error_idx = i;
>> - return ret;
>> + goto set_index;
>> }
>> }
>>
>> ctrls->error_idx = 0;
>>
>> return uvc_ctrl_rollback(handle);
>> +
>> +set_index:
>> + ctrls->error_idx = i;
>> + return ret;
>> }
>
> For uvcvideo I find this to hinder readability
I got an other development view.
> without adding much added value.
There can be a small effect for such a function implementation.
> Please drop the uvcvideo change from this patch.
Would it be nice if this source code adjustment could be integrated also?
Regards,
Markus
next prev parent reply other threads:[~2018-02-28 8:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 18:11 [PATCH v2] [media] Use common error handling code in 20 functions SF Markus Elfring
2018-02-19 18:37 ` Laurent Pinchart
2018-02-28 8:45 ` SF Markus Elfring [this message]
2018-02-28 8:59 ` [v2] " Laurent Pinchart
2018-02-20 8:07 ` [PATCH v2] " Todor Tomov
2018-03-06 17:08 ` [v2] " SF Markus Elfring
2018-03-09 20:10 ` [PATCH v3] [media] Use common error handling code in 19 functions SF Markus Elfring
2018-03-12 9:30 ` Todor Tomov
2018-05-04 16:08 ` [v3] " SF Markus Elfring
2018-05-04 17:50 ` Mauro Carvalho Chehab
2018-05-05 7:53 ` SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=783e7eff-2028-72be-b83c-77fc4340484e@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=andi.shyti@samsung.com \
--cc=andrey_utkin@fastmail.com \
--cc=arvind.yadav.cs@gmail.com \
--cc=bhelgaas@google.com \
--cc=bhumirks@gmail.com \
--cc=brijohn@gmail.com \
--cc=christoph@boehmwalder.at \
--cc=christophe.jaillet@wanadoo.fr \
--cc=colin.king@canonical.com \
--cc=daniele@grinta.net \
--cc=david@hardeman.nu \
--cc=devendra.sharma9091@gmail.com \
--cc=garsilva@embeddedor.com \
--cc=hans.verkuil@cisco.com \
--cc=inki.dae@samsung.com \
--cc=isely@pobox.com \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kumar.san1093@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=max.kellermann@gmail.com \
--cc=mayhs11saini@gmail.com \
--cc=mchehab@kernel.org \
--cc=pombredanne@nexb.com \
--cc=sakari.ailus@linux.intel.com \
--cc=satendra.t@samsung.com \
--cc=sean@mess.org \
--cc=sw0312.kim@samsung.com \
--cc=tglx@linutronix.de \
--cc=todor.tomov@linaro.org \
--cc=viro@zeniv.linux.org.uk \
--cc=weiyongjun1@huawei.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox