From: Hans de Goede <hdegoede@redhat.com>
To: Luis Henriques <luis.henriques@canonical.com>,
Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [3/5, media] pwc-if: fix build warning when !CONFIG_USB_PWC_INPUT_EVDEV
Date: Thu, 15 Jan 2015 11:40:00 +0100 [thread overview]
Message-ID: <54B79900.50705@redhat.com> (raw)
In-Reply-To: <20141001231000.GA25634@hercules>
Hi,
On 02-10-14 01:10, Luis Henriques wrote:
> Label err_video_unreg in function usb_pwc_probe() is only used when
> CONFIG_USB_PWC_INPUT_EVDEV is defined.
>
> drivers/media/usb/pwc/pwc-if.c:1104:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]
>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Sorry for the slow reaction, I somehow missed this patch and just found it in my
patchwork TODO.
I understand what you're trying to achieve here, but NAK to the implementation,
this is breaking the code flow wrt error handling, making it much harder
to double check that everything is being cleaned up properly.
Regards,
Hans
>
> ---
> drivers/media/usb/pwc/pwc-if.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
> index 15b754da4a2c..e6b7e63b0b8e 100644
> --- a/drivers/media/usb/pwc/pwc-if.c
> +++ b/drivers/media/usb/pwc/pwc-if.c
> @@ -1078,7 +1078,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
> pdev->button_dev = input_allocate_device();
> if (!pdev->button_dev) {
> rc = -ENOMEM;
> - goto err_video_unreg;
> + video_unregister_device(&pdev->vdev);
> + goto err_unregister_v4l2_dev;
> }
>
> usb_make_path(udev, pdev->button_phys, sizeof(pdev->button_phys));
> @@ -1095,14 +1096,13 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
> if (rc) {
> input_free_device(pdev->button_dev);
> pdev->button_dev = NULL;
> - goto err_video_unreg;
> + video_unregister_device(&pdev->vdev);
> + goto err_unregister_v4l2_dev;
> }
> #endif
>
> return 0;
>
> -err_video_unreg:
> - video_unregister_device(&pdev->vdev);
> err_unregister_v4l2_dev:
> v4l2_device_unregister(&pdev->v4l2_dev);
> err_free_controls:
>
prev parent reply other threads:[~2015-01-15 10:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 23:10 [PATCH 3/5] [media] pwc-if: fix build warning when !CONFIG_USB_PWC_INPUT_EVDEV Luis Henriques
2015-01-15 10:40 ` Hans de Goede [this message]
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=54B79900.50705@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=luis.henriques@canonical.com \
--cc=m.chehab@samsung.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;
as well as URLs for NNTP newsgroup(s).