[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <687bbcd940c59fbddd0e3a8b578fd3422962e50f.1675016180.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 29 Jan 2023 19:23:09 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: gregkh@...uxfoundation.org, peterz@...radead.org, pmladek@...e.com,
john.ogness@...utronix.de, baolu.lu@...ux.intel.com,
tglx@...utronix.de, mingo@...nel.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH 2/3] usb: early: xhci-dbc: Optimize early_xdbc_write()
There is no point in zeroing 'buf'.
It would be cleared only once, and if the 'while' loop is executed several
times, all but the first run would have a 'dirty' buffer.
Moreover, the size of the chunk is computed in the loop and this size is
passed to xdbc_bulk_write().
So remove this useless memset().
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Untested.
---
drivers/usb/early/xhci-dbc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index f3e23be227d4..965a24e47c0f 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -881,7 +881,7 @@ static void early_xdbc_write(struct console *con, const char *str, u32 n)
if (!xdbc.xdbc_reg)
return;
- memset(buf, 0, XDBC_MAX_PACKET);
+
while (n > 0) {
for (chunk = 0; chunk < XDBC_MAX_PACKET && n > 0; str++, chunk++, n--) {
--
2.34.1
Powered by blists - more mailing lists