Skip to contentSkip to conversation

staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

PATCH New Puranjay Mohan 5 participants 6 messages Apr 29, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
index d9b02ff66259..599da6c977ed 100644
@@ -2000,7 +2000,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,		\
 	return sprintf(buf, mask "\n", value);				\
 }
 
-#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+#define (DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check))		\
 property_write(prop, prop_type, mask, check)				\
 property_read(prop, mask)						\
 
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

Quoted 2 lines · Puranjay Mohan
Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>

---

I think your subject line needs a bit of work :)

Also, I can't take patches without any changelog text.

Quoted 8 lines
 drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +0 -0
index d9b02ff66259..599da6c977ed 100644

drivers/staging/media/bcm2048/radio-bcm2048.c static ssize_t bcm2048_##prop##_read(struct device *dev, \ · line 2005

Quoted 7 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
@@ -2000,7 +2000,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,		\
 	return sprintf(buf, mask "\n", value);				\
 }
 
-#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+#define (DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check))		\
 property_write(prop, prop_type, mask, check)				\
 property_read(prop, mask)						\

Wait, did you build this patch? Are you sure it is doing what you think it is doing?

thanks,

greg k-h

#2 lore raw

PATCH 1/1 staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

Quoted 27 lines · Greg KH
Quoted 2 lines · Puranjay Mohan
Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>

---

I think your subject line needs a bit of work :)

Also, I can't take patches without any changelog text.

Quoted 8 lines
 drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +0 -0
index d9b02ff66259..599da6c977ed 100644

drivers/staging/media/bcm2048/radio-bcm2048.c static ssize_t bcm2048_##prop##_read(struct device *dev, \ · line 2005

Quoted 7 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
@@ -2000,7 +2000,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,		\
 	return sprintf(buf, mask "\n", value);				\
 }
 
-#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+#define (DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check))		\
 property_write(prop, prop_type, mask, check)				\
 property_read(prop, mask)						\

Wait, did you build this patch? Are you sure it is doing what you think it is doing?

Quoted 3 lines

thanks,

greg k-h

It is my first patch ever, can you guide me on how to resend the patch with the corrections.
After adding the parentheses around the Macro, the Error was not showing up with the checkpatch.pl so I thought it corrected it.

thanks,

#3 lore raw

PATCH 1/1 staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

Quoted 28 lines · Puranjay Mohan
Quoted 27 lines · Greg KH
Quoted 2 lines · Puranjay Mohan
Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>

---

I think your subject line needs a bit of work :)

Also, I can't take patches without any changelog text.

Quoted 8 lines
  drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +0 -0
index d9b02ff66259..599da6c977ed 100644

drivers/staging/media/bcm2048/radio-bcm2048.c static ssize_t bcm2048_##prop##_read(struct device *dev, \ · line 2005

Quoted 7 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
@@ -2000,7 +2000,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,		\
  	return sprintf(buf, mask "\n", value);				\
  }
 
-#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+#define (DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check))		\
  property_write(prop, prop_type, mask, check)				\
  property_read(prop, mask)						\

Wait, did you build this patch? Are you sure it is doing what you think it is doing?

Quoted 9 lines
Quoted 3 lines

thanks,

greg k-h

It is my first patch ever, can you guide me on how to resend the patch with the corrections.
After adding the parentheses around the Macro, the Error was not showing up with the checkpatch.pl so I thought it corrected it.

Did you build and run tests to make sure you change works?

Please go through the following to understand all about sending your first patch.

https://wiki.linuxfoundation.org/lkmp/lkmp_getting_started

This should tell you the steps to follow before sending the patch.

thanks,
-- Shuah

#4 lore raw

PATCH 1/1 staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

Quoted 42 lines · Shuah Khan
Quoted 27 lines · Puranjay Mohan
Quoted 26 lines · Greg KH
Quoted 2 lines · Puranjay Mohan
Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>

---

I think your subject line needs a bit of work :)

Also, I can't take patches without any changelog text.

Quoted 8 lines
  drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +0 -0
index d9b02ff66259..599da6c977ed 100644

drivers/staging/media/bcm2048/radio-bcm2048.c static ssize_t bcm2048_##prop##_read(struct device *dev, \ · line 2004

Quoted 6 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
@@ -2000,7 +2000,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,		\
  	return sprintf(buf, mask "\n", value);				\
  }
-#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+#define (DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check))		\
  property_write(prop, prop_type, mask, check)				\
  property_read(prop, mask)						\

Wait, did you build this patch? Are you sure it is doing what you think it is doing?

Quoted 9 lines
Quoted 3 lines

thanks,

greg k-h

It is my first patch ever, can you guide me on how to resend the patch with the corrections.
After adding the parentheses around the Macro, the Error was not showing up with the checkpatch.pl so I thought it corrected it.

Did you build and run tests to make sure you change works?

Please go through the following to understand all about sending your first patch.

Quoted 6 lines

https://wiki.linuxfoundation.org/lkmp/lkmp_getting_started

This should tell you the steps to follow before sending the patch.

thanks,
-- Shuah

I built the driver and this change caused a compilation error. Sorry for sending a wrong patch.
Please help me in solving the checkpatch.pl error.

ERROR: Macros with complex values should be enclosed in parentheses #2003: FILE: drivers/staging/media/bcm2048/radio-bcm2048.c:2003:
+#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check) \
+property_write(prop, prop_type, mask, check) \
+property_read(prop, mask) \
+

Thanks and Regards.

maintainer
#5 lore raw

PATCH 1/1 staging: media: bcm2048: Fixed style error ERROR: Macros with complex values should be enclosed in parentheses found using scripts/checkpatch.pl

Quoted 57 lines · Puranjay Mohan
Quoted 42 lines · Shuah Khan
Quoted 27 lines · Puranjay Mohan
Quoted 26 lines · Greg KH
Quoted 2 lines · Puranjay Mohan
Signed-off-by Puranjay Mohan <puranjay12 at gmail.com>

---

I think your subject line needs a bit of work :)

Also, I can't take patches without any changelog text.

Quoted 8 lines
  drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +0 -0
index d9b02ff66259..599da6c977ed 100644

drivers/staging/media/bcm2048/radio-bcm2048.c static ssize_t bcm2048_##prop##_read(struct device *dev, \ · line 2004

Quoted 6 lines
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -1
@@ -2000,7 +2000,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,		\
  	return sprintf(buf, mask "\n", value);				\
  }
-#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+#define (DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check))		\
  property_write(prop, prop_type, mask, check)				\
  property_read(prop, mask)						\

Wait, did you build this patch? Are you sure it is doing what you think it is doing?

Quoted 9 lines
Quoted 3 lines

thanks,

greg k-h

It is my first patch ever, can you guide me on how to resend the patch with the corrections.
After adding the parentheses around the Macro, the Error was not showing up with the checkpatch.pl so I thought it corrected it.

Did you build and run tests to make sure you change works?

Please go through the following to understand all about sending your first patch.

Quoted 6 lines

https://wiki.linuxfoundation.org/lkmp/lkmp_getting_started

This should tell you the steps to follow before sending the patch.

thanks,
-- Shuah

I built the driver and this change caused a compilation error. Sorry for sending a wrong patch.
Please help me in solving the checkpatch.pl error.

ERROR: Macros with complex values should be enclosed in parentheses #2003: FILE: drivers/staging/media/bcm2048/radio-bcm2048.c:2003:

Review

Quoted 4 lines
(quoted diff) +4 -0
+#define DEFINE_SYSFS_PROPERTY(prop, prop_type, mask, check)		\
+property_write(prop, prop_type, mask, check)				\
+property_read(prop, mask)						\
+

How well do you understand C and how macros work with it?

Do you see anything wrong with this code? What happens if you pass in something "unusual" for one of those parameters?

Also, always remember that checkpatch.pl is a dumb perl script, sometimes it is not correct, and may be ignored for some types of things.

thanks,

greg k-h