Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1424876 > unrolled thread

[RESEND PATCH 3/4] tty/serial: atmel: add comment for the ring buffer size macro

Started byNicolas Ferre <nicolas.ferre@atmel.com>
First post2016-06-17 12:10 +0200
Last post2016-06-17 12:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RESEND PATCH 3/4] tty/serial: atmel: add comment for the ring buffer size macro Nicolas Ferre <nicolas.ferre@atmel.com> - 2016-06-17 12:10 +0200

#1424876 — [RESEND PATCH 3/4] tty/serial: atmel: add comment for the ring buffer size macro

FromNicolas Ferre <nicolas.ferre@atmel.com>
Date2016-06-17 12:10 +0200
Subject[RESEND PATCH 3/4] tty/serial: atmel: add comment for the ring buffer size macro
Message-ID<rKYSS-5cu-9@gated-at.bofh.it>
From: Ludovic Desroches <ludovic.desroches@atmel.com>

There is a macro named ATMEL_SERIAL_RINGSIZE which suggesting that it
corresponds to the real size of the ring buffer. Let warn people that
there is a factor of four since allocation size is
sizeof(struct atmel_uart_char) * ATMEL_SERIAL_RINGSIZE.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/tty/serial/atmel_serial.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 6c1ec7d0d497..857016367a7a 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -108,6 +108,12 @@ struct atmel_uart_char {
 	u16		ch;
 };
 
+/*
+ * Be careful, the real size of the ring buffer is
+ * sizeof(atmel_uart_char) * ATMEL_SERIAL_RINGSIZE. It means that ring buffer
+ * can contain up to 1024 characters in PIO mode and up to 4096 characters in
+ * DMA mode.
+ */
 #define ATMEL_SERIAL_RINGSIZE 1024
 
 /*
-- 
2.9.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web