Skip to content

Commit

Permalink
tty: xtensa/iss: Use min() to fix Coccinelle warning
Browse files Browse the repository at this point in the history
Inline strlen() and use min() to fix the following Coccinelle/coccicheck
warning reported by minmax.cocci:

	WARNING opportunity for min()

Signed-off-by: Thorsten Blum <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Jiri Slaby <[email protected]>
Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
toblux authored and jcmvbkbc committed Apr 4, 2024
1 parent 0e60f0b commit 11cca8c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/xtensa/platforms/iss/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,8 @@ late_initcall(rs_init);

static void iss_console_write(struct console *co, const char *s, unsigned count)
{
if (s && *s != 0) {
int len = strlen(s);
simc_write(1, s, count < len ? count : len);
}
if (s && *s != 0)
simc_write(1, s, min(count, strlen(s)));
}

static struct tty_driver* iss_console_device(struct console *c, int *index)
Expand Down

0 comments on commit 11cca8c

Please sign in to comment.