All of lore.kernel.org
 help / color / mirror / Atom feed
From: fasih0001@gmail.com
To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Fasih <fasih0001@gmail.com>
Subject: [PATCH] uvc_driver: Error Fix in the file drivers/media/usb/uvc/uvc_driver.c
Date: Sun,  3 Sep 2023 14:54:31 +0500	[thread overview]
Message-ID: <20230903095431.28711-1-fasih0001@gmail.com> (raw)

From: Fasih <fasih0001@gmail.com>

Error fix for the line 2429 and 2430, The error message indicated that "Macros with complex values should be enclosed in parentheses".
This typically means that the macro is defined in a way that involves complex expressions or compound literals,
and the preprocessor requires them to be enclosed in parentheses for clarity and proper evaluation.
To address this error and comply with the requirement to enclose complex values in parentheses,
you should wrap the entire expression inside an extra set of parentheses.

Signed-off-by: Syed Muhammad Fasih Ul Hassan <fasih0001@gmail.com>

--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2095,6 +2095,8 @@ static int uvc_probe(struct usb_interface *intf,
        int function;
        int ret;

+       pr_info("I changed uvcvideo driver in the Linux Kernel\n");
+
        /* Allocate memory for the device and initialize it. */
        dev = kzalloc(sizeof(*dev), GFP_KERNEL);
        if (dev == NULL)
@@ -2417,9 +2419,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})
---
 drivers/media/usb/uvc/uvc_driver.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 08fcd2ffa727..42d42b211094 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2095,6 +2095,8 @@ static int uvc_probe(struct usb_interface *intf,
 	int function;
 	int ret;
 
+	pr_info("I changed uvcvideo driver in the Linux Kernel\n");
+
 	/* Allocate memory for the device and initialize it. */
 	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (dev == NULL)
@@ -2417,9 +2419,16 @@ 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}
+/* For line 2429 and 2430, The error message indicated that "Macros with complex values should be enclosed in parentheses".
+ * This typically means that the macro is defined in a way that involves complex expressions or compound literals,
+ * and the preprocessor requires them to be enclosed in parentheses for clarity and proper evaluation.
+ * To address this error and comply with the requirement to enclose complex values in parentheses,
+ * you should wrap the entire expression inside an extra set of parentheses like that:
+ * #define UVC_INFO_QUIRK(q) ((kernel_ulong_t)&(struct uvc_device_info){.quirks = q})
+ */
+#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
-- 
2.17.1


             reply	other threads:[~2023-09-03  9:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-03  9:54 fasih0001 [this message]
2023-09-03 20:59 ` [PATCH] uvc_driver: Error Fix in the file drivers/media/usb/uvc/uvc_driver.c Laurent Pinchart
2023-09-04  9:45   ` [PATCH] usb: uvc: Fix macro in uvc_driver.c for complex values fasih0001

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=20230903095431.28711-1-fasih0001@gmail.com \
    --to=fasih0001@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.