mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] alpha: Fix warning comparing pointer to 0
@ 2023-02-08  1:12 Yang Li
  0 siblings, 0 replies; only message in thread
From: Yang Li @ 2023-02-08  1:12 UTC (permalink / raw)
  To: richard.henderson
  Cc: ink, mattst88, linux-alpha, linux-kernel, Yang Li, Abaci Robot

./arch/alpha/kernel/smp.c:271:39-40: WARNING comparing pointer to 0

Avoid pointer type value compared with 0 to make code clear.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3979
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 arch/alpha/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 0ede4b044e86..3edf1e572d10 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -268,7 +268,7 @@ recv_secondary_console_msg(void)
 			memcpy(cp2, cp1, cnt);
 			cp2[cnt] = '\0';
 			
-			while ((cp2 = strchr(cp2, '\r')) != 0) {
+			while ((cp2 = strchr(cp2, '\r'))) {
 				*cp2 = ' ';
 				if (cp2[1] == '\n')
 					cp2[1] = ' ';
-- 
2.20.1.7.g153144c


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-08  1:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08  1:12 [PATCH -next] alpha: Fix warning comparing pointer to 0 Yang Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®