From: Ludovic Desroches <ludovic.desroches@atmel.com>
To: <nicolas.ferre@atmel.com>, <gregkh@linuxfoundation.org>
Cc: <jslaby@suse.com>, <linux-serial@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Ludovic Desroches <ludovic.desroches@atmel.com>
Subject: [PATCH 3/3] tty/serial: atmel: add comment for the ring buffer size macro
Date: Thu, 12 May 2016 17:37:36 +0200 [thread overview]
Message-ID: <1463067456-6983-3-git-send-email-ludovic.desroches@atmel.com> (raw)
In-Reply-To: <1463067456-6983-1-git-send-email-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>
---
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 6c1ec7d..8570163 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.5.0
next prev parent reply other threads:[~2016-05-12 15:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 15:37 [PATCH 1/3] tty/serial: atmel: re-integrate status check in irq handler Ludovic Desroches
2016-05-12 15:37 ` [PATCH 2/3] tty/serial: atmel: split tx and rx paths Ludovic Desroches
2016-05-12 15:37 ` Ludovic Desroches [this message]
2016-05-12 15:57 ` [PATCH 3/3] tty/serial: atmel: add comment for the ring buffer size macro Nicolas Ferre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463067456-6983-3-git-send-email-ludovic.desroches@atmel.com \
--to=ludovic.desroches@atmel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®