2020-12-07 19:35:05

by Philipp Gerlesberger

[permalink] [raw]
Subject: [PATCH 06/12] media: atomisp: Add parentheses

ERROR:COMPLEX_MACRO: Macros with complex values should be
enclosed in parentheses

Co-developed-by: Andrey Khlopkov <[email protected]>
Signed-off-by: Andrey Khlopkov <[email protected]>
Signed-off-by: Philipp Gerlesberger <[email protected]>
---
.../media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h b/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
index 9cd3d92b34c9..2c02dd1cf27a 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
@@ -22,8 +22,8 @@
#define STORAGE_CLASS_RMGR_H extern
#define STORAGE_CLASS_RMGR_C
#else /* __INLINE_RMGR__ */
-#define STORAGE_CLASS_RMGR_H static inline
-#define STORAGE_CLASS_RMGR_C static inline
+#define STORAGE_CLASS_RMGR_H (static inline)
+#define STORAGE_CLASS_RMGR_C (static inline)
#endif /* __INLINE_RMGR__ */

/**
--
2.20.1


2020-12-08 11:36:31

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 06/12] media: atomisp: Add parentheses

On Mon, Dec 07, 2020 at 08:26:33PM +0100, Philipp Gerlesberger wrote:
> ERROR:COMPLEX_MACRO: Macros with complex values should be
> enclosed in parentheses
>
> Co-developed-by: Andrey Khlopkov <[email protected]>
> Signed-off-by: Andrey Khlopkov <[email protected]>
> Signed-off-by: Philipp Gerlesberger <[email protected]>
> ---
> .../media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h b/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
> index 9cd3d92b34c9..2c02dd1cf27a 100644
> --- a/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
> +++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/interface/ia_css_rmgr.h
> @@ -22,8 +22,8 @@
> #define STORAGE_CLASS_RMGR_H extern
> #define STORAGE_CLASS_RMGR_C
> #else /* __INLINE_RMGR__ */
> -#define STORAGE_CLASS_RMGR_H static inline
> -#define STORAGE_CLASS_RMGR_C static inline
> +#define STORAGE_CLASS_RMGR_H (static inline)
> +#define STORAGE_CLASS_RMGR_C (static inline)

This will break the build.

You should just remove these defines. They don't make any sort of
sense. The programmer should know what things need to be static and
what not. Generally leave "inline" out, and let the compiler decide.
If you have a legit reason to think you are smarter than the compiler
(benchmarking data) then probably __always_inline is more appropriate.

regards,
dan carpenter