# \[PATCH v11 1/3\] tty: hvc: use correct dma alignment size

- From: Xianting Tian \<hidden\>
- Date: 2021-10-15 02:47:09 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2021/10/1542681
- Thread: https://ratatoskr.run/linuxppc-dev/2021/10/1542679/t.md

```text
Use L1_CACHE_BYTES as the dma alignment size, use 'sizeof(long)' as
dma alignment is wrong.

Signed-off-by: Xianting Tian <redacted>
Signed-off-by: Shile Zhang <redacted>
---
 drivers/tty/hvc/hvc_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 5bb8c4e44..5957ab728 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -49,7 +49,7 @@
 #define N_OUTBUF	16
 #define N_INBUF		16
 
-#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
+#define __ALIGNED__ __attribute__((__aligned__(L1_CACHE_BYTES)))
 
 static struct tty_driver *hvc_driver;
 static struct task_struct *hvc_task;
-- 
2.17.1

```
