Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1045648rwb; Thu, 15 Dec 2022 05:57:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf4gUnOQyr78/OiU81Ahnyz2IE5rd5aENscmAa+/qFA/EezbsDXYCg6WDSC8JbAyW5nSZk9k X-Received: by 2002:a05:6a20:2a98:b0:ad:f2bf:bc2b with SMTP id v24-20020a056a202a9800b000adf2bfbc2bmr12609810pzh.60.1671112658647; Thu, 15 Dec 2022 05:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671112658; cv=none; d=google.com; s=arc-20160816; b=WhQ6m3pKl+5sKLhTMc04NwQbeVADYvb46fpYHq7VNJl2J7nRlnpRxR1fNkXNmPlYKD 4w9sd7Lhg/qIWUbx5kChq0oXo+K44S/G/epVadYAV+aFp0pUTh9+g6xI5k45zCz+sltY EZKtrvZE3UUrZFzNa+kNjPnQr/0PjQU0/qfFB50kLCUTfX+QD35SGM5DKgdg0O7ys7/C F9jMoo0Z9Xjm2PIjnPL8lyvukprAja7QDW9cbksGCk7liDykMGJJQAQWXFb0Dhqj9Hjk pNaCLRIhRFCAX4XCutIzbc54rCpI42C8AQnJIx+rK4S80akPC3kGD9X64wyueL4lESCW Ravg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=pcqZYeVyaxkmHHU1cgBhxDu3204FqLsSTDVigYyu6IE=; b=G1DPbW32JelouzQzv7MZBQ+KvcI7n13SHzJbYQ/4GfRhi18EkoWrgyCkt94Xttep45 ey4o2sp3J0uJmLoNynRFXbOIEFxJe1i2M3W4V46FbpGTe3Zg13RZ2B/jUEUf/NUnB7xr cyLTR1KgkFm8Evmnr/NLiqUz6MP85FhLfChW1mIwos4aev5zY/ql+u3tcejkFkHv9ltl xZ5NGvl2EC60Fn+CyFsPm+BgElXjGfBO+p4wvNGfDgKPnHGMJ0DyhT63q1WwS/3xRFhe eK/tTucEA7yu/RxlpzSAD0Evos8c0a+vMNJlXoP3MyPFSJwh5Oec5q9IDH9pQ+pyKs+5 cZVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s27-20020a63ff5b000000b00477be505f98si2818676pgk.867.2022.12.15.05.57.30; Thu, 15 Dec 2022 05:57:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiLONaS (ORCPT + 68 others); Thu, 15 Dec 2022 08:30:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiLONaP (ORCPT ); Thu, 15 Dec 2022 08:30:15 -0500 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AB782124B for ; Thu, 15 Dec 2022 05:30:13 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:2d49:7a8c:85ed:ab2b]) by michel.telenet-ops.be with bizsmtp id wdW92800w4DzhY606dW9S1; Thu, 15 Dec 2022 14:30:10 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1p5oJM-000GrD-Fy; Thu, 15 Dec 2022 14:30:08 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1p5oJL-001mxT-SL; Thu, 15 Dec 2022 14:30:07 +0100 From: Geert Uytterhoeven To: "Jason A . Donenfeld" Cc: linux-m68k@lists.linux-m68k.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] m68k: string: Make char intermediate in strcmp() signed Date: Thu, 15 Dec 2022 14:30:04 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since char became unsigned, strcmp() always returns a positive number. "res" is used to store a byte difference, so it should be signed. Fixes: 3bc753c06dd02a35 ("kbuild: treat char as always unsigned") Signed-off-by: Geert Uytterhoeven --- See "Re: [PATCH v9] kallsyms: Add self-test facility" https://lore.kernel.org/r/CAMuHMdWM6+pC3yUqy+hHRrAf1BCz2sz1KQv2zxS+Wz-639X-aA@mail.gmail.com I'm wondering how many surprises like this are still hidden... --- arch/m68k/include/asm/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index f759d944c4499404..b8f4ae19e8f6ee2c 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h @@ -42,7 +42,7 @@ static inline char *strncpy(char *dest, const char *src, size_t n) #define __HAVE_ARCH_STRCMP static inline int strcmp(const char *cs, const char *ct) { - char res; + signed char res; asm ("\n" "1: move.b (%0)+,%2\n" /* get *cs */ -- 2.25.1