Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uvcvideo: Fix assignment in if condition

The function uvc_input_init() uses an assignment of the return value
of input_register_device() within the condition of an if statement.

This coding style is discouraged by the Linux kernel coding style guide
as it can be confused with a comparison and hide potential bugs.
The checkpatch.pl script flags this as an error:
"ERROR: do not use assignment in if condition"

Separate the assignment into its own statement before the conditional
check to improve code readability and adhere to the kernel's
coding standards.

Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Darshan Rathod and committed by
Hans Verkuil
e67b5f83 ecba852d

+2 -1
+2 -1
drivers/media/usb/uvc/uvc_status.c
··· 62 62 __set_bit(EV_KEY, input->evbit); 63 63 __set_bit(KEY_CAMERA, input->keybit); 64 64 65 - if ((ret = input_register_device(input)) < 0) 65 + ret = input_register_device(input); 66 + if (ret < 0) 66 67 goto error; 67 68 68 69 dev->input = input;