All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: serial: qcom_geni_serial: Clean up an ARRAY_SIZE() vs sizeof()
@ 2020-06-24 13:27 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-06-24 13:27 UTC (permalink / raw)
  To: Andy Gross, Karthikeyan Ramasubramanian
  Cc: Bjorn Andersson, Greg Kroah-Hartman, Jiri Slaby, linux-arm-msm,
	linux-serial, kernel-janitors

The ARRAY_SIZE() is the number of elements but we want the number of
bytes so sizeof() is more appropriate.  Fortunately, it's the same
thing here because this is an array of u8 so this doesn't change
runtime.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/tty/serial/qcom_geni_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 457c0bf8cbf8..1ed3d354e16d 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -718,7 +718,7 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport, bool done,
 		u8 buf[sizeof(u32)];
 		int c;
 
-		memset(buf, 0, ARRAY_SIZE(buf));
+		memset(buf, 0, sizeof(buf));
 		tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw);
 
 		for (c = 0; c < tx_bytes ; c++) {
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-24 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-24 13:27 [PATCH] tty: serial: qcom_geni_serial: Clean up an ARRAY_SIZE() vs sizeof() Dan Carpenter
2020-06-24 13:27 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.