From 13066c303769b5c6bc67c0b990a4eb80058fb1b4 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Tue, 10 Aug 2021 16:08:06 -0700 Subject: xtensa: ISS: don't use string pointer before NULL check Move strlen call inside the if block that checks string pointer for NULL. While at it also fix the following coccicheck warning: ./arch/xtensa/platforms/iss/console.c:204:10-11: WARNING comparing pointer to 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Max Filippov --- arch/xtensa/platforms/iss/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 21184488c277..f6e5fc5579be 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -186,10 +186,10 @@ late_initcall(rs_init); static void iss_console_write(struct console *co, const char *s, unsigned count) { - int len = strlen(s); - - if (s != 0 && *s != 0) + if (s && *s != 0) { + int len = strlen(s); simc_write(1, s, count < len ? count : len); + } } static struct tty_driver* iss_console_device(struct console *c, int *index) -- cgit v1.2.3 From 7b7cec477fc3cd42ce565dfc3e53f144504fc95c Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 12 Aug 2021 01:37:31 +0900 Subject: xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild Use obj-y to clean up Makefile. Signed-off-by: Masahiro Yamada Message-Id: <20210811163731.186125-4-masahiroy@kernel.org> Signed-off-by: Max Filippov --- arch/xtensa/platforms/Makefile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 arch/xtensa/platforms/Makefile (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/Makefile b/arch/xtensa/platforms/Makefile new file mode 100644 index 000000000000..e2e7e0726979 --- /dev/null +++ b/arch/xtensa/platforms/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_XTENSA_PLATFORM_XT2000) += xt2000/ +obj-$(CONFIG_XTENSA_PLATFORM_ISS) += iss/ +obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += xtfpga/ -- cgit v1.2.3