2023-04-09 20:50:38

by Angel Alberto Carretero

[permalink] [raw]
Subject: [PATCH] media: imx: fix macro style error

Wrap macro in parenthesis to fix checkpatch error.

Tested it by compiling the driver successfully.

Signed-off-by: Angel Alberto Carretero <[email protected]>
---
drivers/staging/media/imx/imx-media-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 411e907b68eb..eb44c09071de 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -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.
--
2.40.0


2023-04-11 00:04:05

by Alison Schofield

[permalink] [raw]
Subject: Re: [PATCH] media: imx: fix macro style error

On Sun, Apr 09, 2023 at 10:01:36PM +0200, Angel Alberto Carretero wrote:
> Wrap macro in parenthesis to fix checkpatch error.
>
> Tested it by compiling the driver successfully.
>
> Signed-off-by: Angel Alberto Carretero <[email protected]>
> ---

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

> drivers/staging/media/imx/imx-media-utils.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
> index 411e907b68eb..eb44c09071de 100644
> --- a/drivers/staging/media/imx/imx-media-utils.c
> +++ b/drivers/staging/media/imx/imx-media-utils.c
> @@ -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.
> --
> 2.40.0
>

2023-04-12 18:01:58

by Angel Alberto Carretero

[permalink] [raw]
Subject: [PATCH v2] media: imx: utils: Enclose IMX_BUS_FMTS macro in parenthesis

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

Signed-off-by: Angel Alberto Carretero <[email protected]>
---
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(-)

diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 411e907b68eb..eb44c09071de 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -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.
--
2.40.0