mirror of
https://github.com/torvalds/linux.git
synced 2024-12-17 00:21:32 +00:00
tty: serial: qcom_geni_serial: Clean up an ARRAY_SIZE() vs sizeof()
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> Link: https://lore.kernel.org/r/20200624132744.GD9972@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c89511f61c
commit
3550f8979a
@ -718,7 +718,7 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport, bool done,
|
|||||||
u8 buf[sizeof(u32)];
|
u8 buf[sizeof(u32)];
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
memset(buf, 0, ARRAY_SIZE(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw);
|
tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw);
|
||||||
|
|
||||||
for (c = 0; c < tx_bytes ; c++) {
|
for (c = 0; c < tx_bytes ; c++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user