From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F23C530F94D for ; Mon, 2 Mar 2026 10:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772446721; cv=none; b=T92xkihQ4Q1yg7pp/GTuXOpQlsuRRAzOvPg30GZvYYKclzSeUP2o+xnyntdiuy4iYxU9KYkPMyGqQ9xH4239dpoROWw0S37137Az6Rv9r6yTH31D5KtHZKdOFpKGCawQ7Zxhj2B5ttW00p7q/8STqR5+0Z3pLKRbZ55d3v5RTIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772446721; c=relaxed/simple; bh=hjUAa9YKRvK7qqDyTf9kNhtjL1yAdZa9hoVLxRCF+uo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Cv+YI+9iPapqq8LxNc1ZeElFRP1teW8xzyyGNDdnPx6uQjnTS6TF52yDQDYb2vmL49sZfEBXfa5koWpx0/DUIcDTk8JYfHRwDAaf1SGDV3Uex6b00dKlTilveSXjwLq4/RQFNnmXgm640Qk5futn51cn9S9rONk8GsGVvPb8Nww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=runbox.com; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b=bbYK6iwH; arc=none smtp.client-ip=185.226.149.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=runbox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b="bbYK6iwH" Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1vx0M9-0037zJ-PT; Mon, 02 Mar 2026 11:18:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To :Message-Id:Date:Subject:Cc:To:From; bh=C13mqcG2akqQnwf5EJbKQoyR2tuPHd4Usz9szFB2aMI=; b=bbYK6iwHBfONdSuJ2IopRU28bh hhMmDF7fjaouy8fPCd/rL6WyNFab1SF9l4p2qiqZ8FU6eN+fnQRBn07DRNgkYuErJpfqNfeLkFuCy I/YWMBPr9SzGC8c3NvSbhBlFPIVmcnsu42qnhKamcmOgoXJYi+gyHdTKBUk7mS3j1w8Z2K16F4wm5 +LQQ9U8pixLOcmfn4JXbumCr1PJbMOXET/G0FNEi2LoeHu4Vf+dT/UXb+YZuTLGFYDUCl7Wt5cyKL WrP3djTNpVmYUrx+CQoN5P7Rshi8wyXHrN/zW/G/LYwp+ehODGX0RFodkHgru/F4LiGAWtA3PNYyv KtddpJGw==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1vx0M9-0002wu-Fu; Mon, 02 Mar 2026 11:18:29 +0100 Received: by submission01.runbox with esmtpsa [Authenticated ID (1493616)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1vx0M9-006y7o-5b; Mon, 02 Mar 2026 11:18:29 +0100 From: david.laight.linux@gmail.com To: Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org, Cheng Li Cc: David Laight Subject: [PATCH v4 next 03/23] selftests/nolibc: Return correct value when printf test fails Date: Mon, 2 Mar 2026 10:17:55 +0000 Message-Id: <20260302101815.3043-4-david.laight.linux@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260302101815.3043-1-david.laight.linux@gmail.com> References: <20260302101815.3043-1-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: David Laight Correctly return 1 (the number of errors) when strcmp() fails rather than the return value from strncmp() which is the signed difference between the mismatching characters. Signed-off-by: David Laight --- New patch for v4. Corrects the error reporting for test failures. But is really replaced by the next patch. tools/testing/selftests/nolibc/nolibc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 0e8b3b9a86ef..9787e493523c 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1683,7 +1683,7 @@ static int expect_vfprintf(int llen, int c, const char *expected, const char *fm } llen += printf(" \"%s\" = \"%s\"", expected, buf); - ret = strncmp(expected, buf, c); + ret = strncmp(expected, buf, c) != 0; result(llen, ret ? FAIL : OK); return ret; -- 2.39.5