diff mbox series

usb: uvc: Fix macro in uvc_driver.c for complex values

Message ID 20230904094511.11880-1-fasih0001@gmail.com (mailing list archive)
State New, archived
Headers show
Series usb: uvc: Fix macro in uvc_driver.c for complex values | expand

Commit Message

fasih0001@gmail.com Sept. 4, 2023, 9:45 a.m. UTC
From: Fasih <fasih0001@gmail.com>

The macro UVC_INFO_QUIRK(q) in uvc_driver.c initializes a structure
using a compound literal, and the complex value within the macro was
not properly enclosed in parentheses. This could lead to operator
precedence issues and reduced code clarity.

This commit adds an extra set of parentheses to the macro definition
to ensure correct evaluation and adherence to best practices. This
change also improves code readability and portability.

Signed-off-by: Syed Muhammad Fasih Ul Hassan <fasih0001@gmail.com>
Signed-off-by: Fasih <fasih0001@gmail.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 08fcd2ffa727..63999f1c8d55 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2417,9 +2417,9 @@  static const struct uvc_device_info uvc_quirk_force_y8 = {
 	.quirks = UVC_QUIRK_FORCE_Y8,
 };
 
-#define UVC_INFO_QUIRK(q) (kernel_ulong_t)&(struct uvc_device_info){.quirks = q}
-#define UVC_INFO_META(m) (kernel_ulong_t)&(struct uvc_device_info) \
-	{.meta_format = m}
+#define UVC_INFO_QUIRK(q) ((kernel_ulong_t)&(struct uvc_device_info){.quirks = q})
+#define UVC_INFO_META(m) ((kernel_ulong_t)&(struct uvc_device_info) \
+	{.meta_format = m})
 
 /*
  * The Logitech cameras listed below have their interface class set to