2022-12-13 20:16:10

by Abhirup Deb

[permalink] [raw]
Subject: [PATCH] staging: vme_user: Add spaces around "<<"

Add spaces around the "<<" in adherence to the Linux kernel coding-style.
The issues were reported by checkpatch.pl.

Signed-off-by: Abhirup Deb <[email protected]>
---
drivers/staging/vme_user/vme.h | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
index 98da8d039d60..a74724457d29 100644
--- a/drivers/staging/vme_user/vme.h
+++ b/drivers/staging/vme_user/vme.h
@@ -54,20 +54,20 @@ enum vme_resource_type {
#define VME_R_ROBIN_MODE 0x1
#define VME_PRIORITY_MODE 0x2

-#define VME_DMA_PATTERN (1<<0)
-#define VME_DMA_PCI (1<<1)
-#define VME_DMA_VME (1<<2)
-
-#define VME_DMA_PATTERN_BYTE (1<<0)
-#define VME_DMA_PATTERN_WORD (1<<1)
-#define VME_DMA_PATTERN_INCREMENT (1<<2)
-
-#define VME_DMA_VME_TO_MEM (1<<0)
-#define VME_DMA_MEM_TO_VME (1<<1)
-#define VME_DMA_VME_TO_VME (1<<2)
-#define VME_DMA_MEM_TO_MEM (1<<3)
-#define VME_DMA_PATTERN_TO_VME (1<<4)
-#define VME_DMA_PATTERN_TO_MEM (1<<5)
+#define VME_DMA_PATTERN (1 << 0)
+#define VME_DMA_PCI (1 << 1)
+#define VME_DMA_VME (1 << 2)
+
+#define VME_DMA_PATTERN_BYTE (1 << 0)
+#define VME_DMA_PATTERN_WORD (1 << 1)
+#define VME_DMA_PATTERN_INCREMENT (1 << 2)
+
+#define VME_DMA_VME_TO_MEM (1 << 0)
+#define VME_DMA_MEM_TO_VME (1 << 1)
+#define VME_DMA_VME_TO_VME (1 << 2)
+#define VME_DMA_MEM_TO_MEM (1 << 3)
+#define VME_DMA_PATTERN_TO_VME (1 << 4)
+#define VME_DMA_PATTERN_TO_MEM (1 << 5)

struct vme_dma_attr {
u32 type;
--
2.31.1


2022-12-14 07:31:02

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH] staging: vme_user: Add spaces around "<<"

On 12/13/22 20:55, Abhirup Deb wrote:
> Add spaces around the "<<" in adherence to the Linux kernel coding-style.
> The issues were reported by checkpatch.pl.
>
> Signed-off-by: Abhirup Deb <[email protected]>
> ---
> drivers/staging/vme_user/vme.h | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
> index 98da8d039d60..a74724457d29 100644
> --- a/drivers/staging/vme_user/vme.h
> +++ b/drivers/staging/vme_user/vme.h
> @@ -54,20 +54,20 @@ enum vme_resource_type {
> #define VME_R_ROBIN_MODE 0x1
> #define VME_PRIORITY_MODE 0x2
>
> -#define VME_DMA_PATTERN (1<<0)
> -#define VME_DMA_PCI (1<<1)
> -#define VME_DMA_VME (1<<2)
> -
> -#define VME_DMA_PATTERN_BYTE (1<<0)
> -#define VME_DMA_PATTERN_WORD (1<<1)
> -#define VME_DMA_PATTERN_INCREMENT (1<<2)
> -
> -#define VME_DMA_VME_TO_MEM (1<<0)
> -#define VME_DMA_MEM_TO_VME (1<<1)
> -#define VME_DMA_VME_TO_VME (1<<2)
> -#define VME_DMA_MEM_TO_MEM (1<<3)
> -#define VME_DMA_PATTERN_TO_VME (1<<4)
> -#define VME_DMA_PATTERN_TO_MEM (1<<5)
> +#define VME_DMA_PATTERN (1 << 0)
> +#define VME_DMA_PCI (1 << 1)
> +#define VME_DMA_VME (1 << 2)
> +
> +#define VME_DMA_PATTERN_BYTE (1 << 0)
> +#define VME_DMA_PATTERN_WORD (1 << 1)
> +#define VME_DMA_PATTERN_INCREMENT (1 << 2)
> +
> +#define VME_DMA_VME_TO_MEM (1 << 0)
> +#define VME_DMA_MEM_TO_VME (1 << 1)
> +#define VME_DMA_VME_TO_VME (1 << 2)
> +#define VME_DMA_MEM_TO_MEM (1 << 3)
> +#define VME_DMA_PATTERN_TO_VME (1 << 4)
> +#define VME_DMA_PATTERN_TO_MEM (1 << 5)
>
> struct vme_dma_attr {
> u32 type;

I propose to use the BIT macro as checkpatch proposes it when I apply
checkpatch to your patch. Please also correct the number of tabs to align.

Thanks,

Bye Philipp

CHECK: Prefer using the BIT macro
#37: FILE: drivers/staging/vme_user/vme.h:57:
+#define VME_DMA_PATTERN (1 << 0)