From patchwork Thu Nov 23 18:58:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 746694 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b="cSdtf/wV" Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AF2CD40 for ; Thu, 23 Nov 2023 10:58:31 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9fa2714e828so155763266b.1 for ; Thu, 23 Nov 2023 10:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700765910; x=1701370710; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D52mho4bbVBLhO1MqSHLzeH5mafSEJrrR5dOy4gDBr8=; b=cSdtf/wVdnMJpBcJIHXBcSzwoCpd9ei0cVYoiTlsuwkgwzmMX2rsXqh7DHqJZb2GR6 txjD7zh/dpMHGYLNjJ0pjnEAArPzqd9/sGVgLNirIjC65CIDO3vZdyEHLHMZpHudpD+o O3Ewgk1y5KE/2OyFRGwBZnCEWW4N1ggOKX6EOvTmUA4+CAfKWATRqeOhx+F89hWYXlP0 0hDEF4OM/PJK079sHxwfNyiEzAxVX8TIyRVhO5k5CgI9t6VUXViKAVZMaWAaq0Znqe5a H/1oPod2UF2tq4WfmSMaY6fBrsEB4q7yXuupPXzwgrjQCBjyWatLxl0NmOE9Gknn7MSm 5DGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700765910; x=1701370710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D52mho4bbVBLhO1MqSHLzeH5mafSEJrrR5dOy4gDBr8=; b=qkxZd5yV02oTo1ojD6xD23fDF93I+s9bIJPZUkolyQAQsigzO9e2lJMDf8r0GxtzPw n39CJAps2CYPwDQxZIcHlOfv2pKP5DHXxS0OHsiby6SuDuVy40Idac77b8tmVBXKNwep FrxTvQsnbi0rGcQzsU5wk86s67Bcick3jV9cZomvyP82RvBBipEcZEJlPfDwcVAfmidj T6bqCwJNOAUzpHA+CFp4a/sGTN6gafNvYs7h1xQXsGegmsYJJ2HRHpH7n2O2xwmChgdU ykG8xnzjKg7Iul5dTvvuG3zNqVI49qLov7MgEBydFvwy5HSQWrgt5Ud83J1wUXTWs3Q8 Pvpg== X-Gm-Message-State: AOJu0YzvTMYtYbPzS0QPIRsuRc1ltFE2uWFlt2WlF2sWRp7R45yFS9UK RpLw6yPDlYxbQ637VACYNCi9Mw== X-Google-Smtp-Source: AGHT+IFVVpG1Z6gxPdaL7IaaTFJinrPmrgoX6cwu9dsiRja9dZsbaJhr6jSoHE3EsEV83YZM2drU6A== X-Received: by 2002:a17:906:738b:b0:9f8:2f30:d74f with SMTP id f11-20020a170906738b00b009f82f30d74fmr185134ejl.7.1700765909911; Thu, 23 Nov 2023 10:58:29 -0800 (PST) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id l23-20020a170906231700b009ff1997ce86sm1115944eja.149.2023.11.23.10.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:58:29 -0800 (PST) From: Christoph Muellner To: linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Shuah Khan Cc: Philipp Tomsich , Andrew Jones , Evan Green , Xiao Wang , Alexandre Ghiti , Andy Chiu , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Charlie Jenkins , =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [PATCH 2/5] tools: selftests: riscv: Fix compile warnings in cbo Date: Thu, 23 Nov 2023 19:58:18 +0100 Message-ID: <20231123185821.2272504-3-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123185821.2272504-1-christoph.muellner@vrull.eu> References: <20231123185821.2272504-1-christoph.muellner@vrull.eu> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Müllner GCC prints a couple of format string warnings when compiling the cbo test. Let's follow the recommendation in Documentation/printk-formats.txt to fix these warnings. Signed-off-by: Christoph Müllner Reviewed-by: Alexandre Ghiti --- tools/testing/selftests/riscv/hwprobe/cbo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/riscv/hwprobe/cbo.c b/tools/testing/selftests/riscv/hwprobe/cbo.c index 50a2cc8aef38..c6a83ab11e22 100644 --- a/tools/testing/selftests/riscv/hwprobe/cbo.c +++ b/tools/testing/selftests/riscv/hwprobe/cbo.c @@ -97,7 +97,7 @@ static void test_zicboz(void *arg) block_size = pair.value; ksft_test_result(rc == 0 && pair.key == RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE && is_power_of_2(block_size), "Zicboz block size\n"); - ksft_print_msg("Zicboz block size: %ld\n", block_size); + ksft_print_msg("Zicboz block size: %llu\n", block_size); illegal_insn = false; cbo_zero(&mem[block_size]); @@ -121,7 +121,7 @@ static void test_zicboz(void *arg) for (j = 0; j < block_size; ++j) { if (mem[i * block_size + j] != expected) { ksft_test_result_fail("cbo.zero check\n"); - ksft_print_msg("cbo.zero check: mem[%d] != 0x%x\n", + ksft_print_msg("cbo.zero check: mem[%llu] != 0x%x\n", i * block_size + j, expected); return; } @@ -201,7 +201,7 @@ int main(int argc, char **argv) pair.key = RISCV_HWPROBE_KEY_IMA_EXT_0; rc = riscv_hwprobe(&pair, 1, sizeof(cpu_set_t), (unsigned long *)&cpus, 0); if (rc < 0) - ksft_exit_fail_msg("hwprobe() failed with %d\n", rc); + ksft_exit_fail_msg("hwprobe() failed with %ld\n", rc); assert(rc == 0 && pair.key == RISCV_HWPROBE_KEY_IMA_EXT_0); if (pair.value & RISCV_HWPROBE_EXT_ZICBOZ) { From patchwork Thu Nov 23 18:58:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 746693 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b="cQMI8JJm" Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EC2D40 for ; Thu, 23 Nov 2023 10:58:35 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a04196fc957so167463166b.2 for ; Thu, 23 Nov 2023 10:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700765913; x=1701370713; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r701pvo9PbgE9h16+HzDZMKOHNQtZ1R5aBMPWWKprHM=; b=cQMI8JJmM8qjaLeMVk4RNlEsMuL127P+aY4k8iy/iz8h0VwIqjg0Qihxdk99fZNmxL Hz8KX4+zHEUEgjPLGnVccBEMSwprXl1g+Wy2X9BtTwsIXXL/WI3D1WxCxHnwEwqbHC12 zoLilQGEH+gfogv7ZzS4MqET4mzHT4Nw38xvqIl8jaycFnsVCVqixr6bGi5jENyzqCPS mVO6VuOE8QmSNgbqsp0J1wl9z9PDAqlzX4vJtrhduJFmL6ElRHQbNMPkpunXJMQFLILe KzRmKazci7LYxbgKyg/FhlFJnOH/NgQH0U2ch9v9WtJ1dHq09Rt4EpArQzZUIjfDVYr/ fvVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700765913; x=1701370713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r701pvo9PbgE9h16+HzDZMKOHNQtZ1R5aBMPWWKprHM=; b=LOQqFqYp+j5tzKKV9omoJydo9NCQZ5nl7uQmIDtoRP0MoakbvMDm2bKz0WjoNXKyfA WwsZM0CI5JyMLq2gBE0CZgWBWrKmIJaYjikTjzV35Qhf2DxBR8BXtwFGgH4JAmUaG0FJ 3Kva7uZB+veWy+bMAUzV/yszqD/Fkni1C/rwCZBLEwj8m+sV2600BuxXZvV4jU4rNNqK liMYiUODH69ccU8HjeQ14+ZpCVG2eaTLGl0vkpmiSgnzX8d3YRk+GcEQvxqRyiFcVBsO ddnpi7bymixHZDXsdmvwGt0vd6wIKe3J/s2t8p+sPA2IRD1/JnVkWkZ6F+vwjJf6nl9c KDPg== X-Gm-Message-State: AOJu0Yy2ZjskxyRGiIJ8Sr11M5htHQRlH01tp16/WXe4dG079NNoU6/Y jR0VcRrMF8U+1v8XqTr/M9su7SlcnL+s67lS2Kh2lU6X X-Google-Smtp-Source: AGHT+IGo/4pGiY2CzvH24z/qYlIQMvNju8tGcNRKHAO+YNqcSuXvNbr1QJbcmN9PcnnekmGYewrQBw== X-Received: by 2002:a17:906:b188:b0:9e6:f7c6:792f with SMTP id w8-20020a170906b18800b009e6f7c6792fmr159047ejy.17.1700765913533; Thu, 23 Nov 2023 10:58:33 -0800 (PST) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id l23-20020a170906231700b009ff1997ce86sm1115944eja.149.2023.11.23.10.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:58:32 -0800 (PST) From: Christoph Muellner To: linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Shuah Khan Cc: Philipp Tomsich , Andrew Jones , Evan Green , Xiao Wang , Alexandre Ghiti , Andy Chiu , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Charlie Jenkins , =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [PATCH 4/5] tools: selftests: riscv: Fix compile warnings in vector tests Date: Thu, 23 Nov 2023 19:58:20 +0100 Message-ID: <20231123185821.2272504-5-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123185821.2272504-1-christoph.muellner@vrull.eu> References: <20231123185821.2272504-1-christoph.muellner@vrull.eu> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Müllner GCC prints a couple of format string warnings when compiling the vector tests. Let's follow the recommendation in Documentation/printk-formats.txt to fix these warnings. Signed-off-by: Christoph Müllner Reviewed-by: Alexandre Ghiti --- tools/testing/selftests/riscv/vector/v_initval_nolibc.c | 2 +- tools/testing/selftests/riscv/vector/vstate_prctl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/riscv/vector/v_initval_nolibc.c b/tools/testing/selftests/riscv/vector/v_initval_nolibc.c index 66764edb0d52..1dd94197da30 100644 --- a/tools/testing/selftests/riscv/vector/v_initval_nolibc.c +++ b/tools/testing/selftests/riscv/vector/v_initval_nolibc.c @@ -27,7 +27,7 @@ int main(void) datap = malloc(MAX_VSIZE); if (!datap) { - ksft_test_result_fail("fail to allocate memory for size = %lu\n", MAX_VSIZE); + ksft_test_result_fail("fail to allocate memory for size = %d\n", MAX_VSIZE); exit(-1); } diff --git a/tools/testing/selftests/riscv/vector/vstate_prctl.c b/tools/testing/selftests/riscv/vector/vstate_prctl.c index b348b475be57..8ad94e08ff4d 100644 --- a/tools/testing/selftests/riscv/vector/vstate_prctl.c +++ b/tools/testing/selftests/riscv/vector/vstate_prctl.c @@ -68,7 +68,7 @@ int test_and_compare_child(long provided, long expected, int inherit) } rc = launch_test(inherit); if (rc != expected) { - ksft_test_result_fail("Test failed, check %d != %d\n", rc, + ksft_test_result_fail("Test failed, check %d != %ld\n", rc, expected); return -2; } @@ -87,7 +87,7 @@ int main(void) pair.key = RISCV_HWPROBE_KEY_IMA_EXT_0; rc = riscv_hwprobe(&pair, 1, 0, NULL, 0); if (rc < 0) { - ksft_test_result_fail("hwprobe() failed with %d\n", rc); + ksft_test_result_fail("hwprobe() failed with %ld\n", rc); return -1; }