pwc-if: fix build warning when !CONFIG_USB_PWC_INPUT_EVDEV
Subsystems (2)
PATCH 3/5 pwc-if: fix build warning when !CONFIG_USB_PWC_INPUT_EVDEV
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]
--- drivers/media/usb/pwc/pwc-if.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/usb/pwc/pwc-if.c +4 -4
@@ -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_idif (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:
Signature · 1 line
2.1.0
Hi,
Quoted 6 lines · Luis Henriques
Label
err_video_unregin functionusb_pwc_probe()is only used whenCONFIG_USB_PWC_INPUT_EVDEVis 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 <[email protected]>
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
Quoted 37 lines
---
drivers/media/usb/pwc/pwc-if.c| 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)drivers/media/usb/pwc/pwc-if.c +4
-4@@ -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_idif (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: