Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2253375rdg; Sun, 15 Oct 2023 19:54:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv4yv/G3pKf4+8Bt0VKKLZ1RGhIsO1kNxJvVUSxSPXidNMepZKb8oGwqcy10x3P+axNeCs X-Received: by 2002:a05:6808:1149:b0:3af:db70:4aff with SMTP id u9-20020a056808114900b003afdb704affmr31332115oiu.28.1697424864683; Sun, 15 Oct 2023 19:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697424864; cv=none; d=google.com; s=arc-20160816; b=WuHiLATeW/6nKzbWdwGxSljB/UtaFLo2frSNDp8m82rt7r1bO/M87jxAWCFTkZkS/8 6qK2EAtr8jOsTJMlHT33L906iRFkKgtHCddquOyW2/Z0FmDWXxqvqUdQ4vdWKRLUTbvw hWkFgUe0HdO/Ek0pnflvzgbgh5W/gJukZBhUS/RFNiQrjVXo6FzeT0aSR7OHHvZ0Xyy8 kAosmPdZ2F2WuR9Iky1xOQQGGzQLFbTDwXiOCEzs4TNuM/pHaXxorRjR/Th0KxEHIdPZ eNQGSVXuQNXhbs+I1FYhj+aLxJ1eHM2xu2I8tWiCMAlPmaJKcXfEgNzaIx0JP1AmNetL P4WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=W973SkUzSi52EyNuqGg/IiCt5l7KS6E/onMMdjSAdi0=; fh=cqkLf6OKQ0UuLy/4fQCXH8PvyduGMZsO9BEW+wWaqDo=; b=SE41ykuJiass5IHeYS4ZobFa9qHjuGP2m8M/OsNbRPXa7/6Xx92jzlCCoMRsAw5n+3 nKqaWz19lKibwPM8ec6EcFfi3jsNeicSltqExZqD4eWSiHydM0HfLwRGee7H8Lv3K4dx smLmXaTtBr57BRP90SmfLCY2eb8KQdkU1FZzHL04IyhkJahEUh6wetQ+SShhE4Y1U+h9 xNcTFJ6MDE7EctEQRnyyJ1Cu+qEKQcFkyB0A85FOboyIUo9o9LXw//wtfs4SmDk6BTET lhUWobpbuqBfiE6zN+Xpx/gsUVSTTpguyWFhyhGjig0OJhz+8Ru1eP1dnFu6Fd+hpCmt RwYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 66-20020a630145000000b005b4ef61bfc7si2880771pgb.596.2023.10.15.19.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 19:54:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id DD150804DDA9; Sun, 15 Oct 2023 19:54:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbjJPCyW (ORCPT + 99 others); Sun, 15 Oct 2023 22:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbjJPCyV (ORCPT ); Sun, 15 Oct 2023 22:54:21 -0400 Received: from cmccmta1.chinamobile.com (cmccmta4.chinamobile.com [111.22.67.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2BBDD6; Sun, 15 Oct 2023 19:53:45 -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-app04-12004 (RichMail) with SMTP id 2ee4652ca502bbd-fe48d; Mon, 16 Oct 2023 10:50:42 +0800 (CST) X-RM-TRANSID: 2ee4652ca502bbd-fe48d X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from ubuntu.localdomain (unknown[10.54.5.252]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee2652ca500a2c-27a95; Mon, 16 Oct 2023 10:50:41 +0800 (CST) X-RM-TRANSID: 2ee2652ca500a2c-27a95 From: zhujun2 To: shuah@kernel.org Cc: nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, zhujun2@cmss.chinamobile.com Subject: [PATCH] selftests:modify the incorrect print format Date: Sun, 15 Oct 2023 19:50:38 -0700 Message-Id: <20231016025038.1677-1-zhujun2@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 15 Oct 2023 19:54:24 -0700 (PDT) printf %d in format string requires 'int' but the argument type is 'unsigned int' 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