Skip to contentSkip to conversation

media: imx: fix macro style error

PATCH In review Angel Alberto Carretero 2 participants 3 messages Apr 9, 2023 – Apr 12, 2023

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

PATCH 1/1 media: imx: fix macro style error

Wrap macro in parenthesis to fix checkpatch error.

Tested it by compiling the driver successfully.

---
 drivers/staging/media/imx/imx-media-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-utils.c +1 -1
index 411e907b68eb..eb44c09071de 100644
@@ -7,7 +7,7 @@
 #include <linux/module.h>
 #include "imx-media.h"
 
-#define IMX_BUS_FMTS(fmt...) (const u32[]) {fmt, 0}
+#define IMX_BUS_FMTS(fmt...) ((const u32[]) {fmt, 0})
 
 /*
  * List of supported pixel formats for the subdevs.
Signature · 1 line
2.40.0
#1 lore raw
Quoted 6 lines · Angel Alberto Carretero

Wrap macro in parenthesis to fix checkpatch error.

Tested it by compiling the driver successfully.

---

Hi Angel,

The code change looks fine. Here are a few patch style suggestions:

- If you do 'git log --oneline imx-media-utils.c' you'll see that changes in utils file only, seem to have utils in the patch subject prefix. "media: imx: utils:"

- Commit message is vague. How about being explicit so anyone persuing those one-liners knows exactly what change was made. "Enclose IMX_BUS_FMTS macro in parentheses"

- The commit log 'why' is to conform to the kernel coding style, not to fix a checkpatch error. It is good to say Issue found by checkpatch, but that itself is not the 'why'.

Alison

Quoted 19 lines
 drivers/staging/media/imx/imx-media-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-utils.c +1 -1
index 411e907b68eb..eb44c09071de 100644
@@ -7,7 +7,7 @@
 #include <linux/module.h>
 #include "imx-media.h"
 
-#define IMX_BUS_FMTS(fmt...) (const u32[]) {fmt, 0}
+#define IMX_BUS_FMTS(fmt...) ((const u32[]) {fmt, 0})
 
 /*
  * List of supported pixel formats for the subdevs.
Signature · 1 line
2.40.0
#2 lore raw

PATCH v2 1/1 media: imx: utils: Enclose IMX_BUS_FMTS macro in parenthesis

Conform to kernel coding style by wrapping macro in parenthesis. Issue found by checkpatch.

---
v2: changed commit message and description thanks to Alison suggestion

---
 drivers/staging/media/imx/imx-media-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/imx/imx-media-utils.c +1 -1
index 411e907b68eb..eb44c09071de 100644
@@ -7,7 +7,7 @@
 #include <linux/module.h>
 #include "imx-media.h"
 
-#define IMX_BUS_FMTS(fmt...) (const u32[]) {fmt, 0}
+#define IMX_BUS_FMTS(fmt...) ((const u32[]) {fmt, 0})
 
 /*
  * List of supported pixel formats for the subdevs.
Signature · 1 line
2.40.0