Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp58493rdb; Wed, 18 Oct 2023 18:17:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqOSzfyvEJvQqZH/X0MBEoKThb3yLtuirrK0brtvczqWaw/uB2datlN8k2GSsqqvan70Q9 X-Received: by 2002:a05:690c:88:b0:5a7:bc5d:125e with SMTP id be8-20020a05690c008800b005a7bc5d125emr1082634ywb.38.1697678275800; Wed, 18 Oct 2023 18:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697678275; cv=none; d=google.com; s=arc-20160816; b=fXKcDyl8M0NeR58UF/mH4+rqh5GFhFSGADJO90tE/R1hUJqc+3ueJblFy/jVnDnRbW HaoziXVNZq6MJZ2Up5dKVMgW328UlkyHZiBlm7rZk5WdBm/vAKeLRZwWYA9cJtHFN7/Y NLgmLFL1lI+AhEyZcf4v771zwcmRHdn9fO/4YwieY/kBlmYE/+xS5KstjRhEsQxvNKLb Tmpf5txBzFXeS5Q8gVUPE2Ek5cwR6gAm3CIIMyVixkYRGgqnXh/KiCW72MQtVYZb2QeW qAw688RlQfppNHYa6WB9kbkW4EAUHLeQcdhwpM1A91xZK5CthEIkwMDRmcxvkeSuq4UY 3Kkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=gnegQSL7vYbyrnXFx0tSbM0OCntuNAYQe89AyMnInX4=; fh=8BhRMHZCXfSOgagnBI6ziKLAdCV7A8DvDZ3IlFFfyV8=; b=hYX5ngMsG0a+tRcqPVrTCJ8GqM8CNzUSWbCN7tmLWhip/O/OfiLOmLkuU8UPxwyVP3 3+9ttLOGxP42BWBslWJfoSJANRCN/vPtQGDMDNdeOjdvs9W4EqTh9HggnE0voyA3hByk RP4Qny50jFqgcUFDsqQ2Asv9KhyXSvG42eSEdWXFwxfHnAApAZVxz6YmJPAmyEM0OjJ/ /PiAyLFmuNqte5TcAmuviuH31RxaLx71StPLIby/xLlwdyS89v5EGrjLtv0+vMzlJWO1 wvA6uvEqiOJ1E6lY7GF9Dd/wNIF4tR47MZY18PPF5ErnDidSfytBwaSmmehcNz7avDUU AKTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i131-20020a636d89000000b005655bf61e32si3220926pgc.23.2023.10.18.18.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 18:17:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F08FF8256C9D; Wed, 18 Oct 2023 18:17:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231204AbjJSBRJ (ORCPT + 99 others); Wed, 18 Oct 2023 21:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbjJSBRH (ORCPT ); Wed, 18 Oct 2023 21:17:07 -0400 Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [111.22.67.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 47EDBB0; Wed, 18 Oct 2023 18:16:59 -0700 (PDT) X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee765308387330-12b6c; Thu, 19 Oct 2023 09:16:55 +0800 (CST) X-RM-TRANSID: 2ee765308387330-12b6c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from ubuntu.localdomain (unknown[10.54.5.255]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee665308385d83-50e4c; Thu, 19 Oct 2023 09:16:54 +0800 (CST) X-RM-TRANSID: 2ee665308385d83-50e4c From: zhujun2 To: skhan@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, nathan@kernel.org, ndesaulniers@google.com, shuah@kernel.org, trix@redhat.com, zhujun2@cmss.chinamobile.com Subject: [PATCH] selftests:modify the incorrect print format Date: Wed, 18 Oct 2023 18:16:52 -0700 Message-Id: <20231019011652.20343-1-zhujun2@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 18:17:52 -0700 (PDT) when the argument type is 'unsigned int',printf '%u' in format string that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index 529d29a35..bec2fae58 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -129,7 +129,7 @@ static inline void ksft_print_header(void) static inline void ksft_set_plan(unsigned int plan) { ksft_plan = plan; - printf("1..%d\n", ksft_plan); + printf("1..%u\n", ksft_plan); } static inline void ksft_print_cnts(void) @@ -137,7 +137,7 @@ static inline void ksft_print_cnts(void) if (ksft_plan != ksft_test_num()) printf("# Planned tests != run tests (%u != %u)\n", ksft_plan, ksft_test_num()); - printf("# Totals: pass:%d fail:%d xfail:%d xpass:%d skip:%d error:%d\n", + printf("# Totals: pass:%u fail:%u xfail:%u xpass:%u skip:%u error:%u\n", ksft_cnt.ksft_pass, ksft_cnt.ksft_fail, ksft_cnt.ksft_xfail, ksft_cnt.ksft_xpass, ksft_cnt.ksft_xskip, ksft_cnt.ksft_error); @@ -163,7 +163,7 @@ static inline void ksft_test_result_pass(const char *msg, ...) ksft_cnt.ksft_pass++; va_start(args, msg); - printf("ok %d ", ksft_test_num()); + printf("ok %u ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); @@ -177,7 +177,7 @@ static inline void ksft_test_result_fail(const char *msg, ...) ksft_cnt.ksft_fail++; va_start(args, msg); - printf("not ok %d ", ksft_test_num()); + printf("not ok %u ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); @@ -203,7 +203,7 @@ static inline void ksft_test_result_xfail(const char *msg, ...) ksft_cnt.ksft_xfail++; va_start(args, msg); - printf("ok %d # XFAIL ", ksft_test_num()); + printf("ok %u # XFAIL ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); @@ -217,7 +217,7 @@ static inline void ksft_test_result_skip(const char *msg, ...) ksft_cnt.ksft_xskip++; va_start(args, msg); - printf("ok %d # SKIP ", ksft_test_num()); + printf("ok %u # SKIP ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); @@ -232,7 +232,7 @@ static inline void ksft_test_result_error(const char *msg, ...) ksft_cnt.ksft_error++; va_start(args, msg); - printf("not ok %d # error ", ksft_test_num()); + printf("not ok %u # error ", ksft_test_num()); errno = saved_errno; vprintf(msg, args); va_end(args); -- 2.17.1