From patchwork Thu Nov 23 18:58:17 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: 13466603 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b="gJ7RVFr3" 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 A94B19E for ; Thu, 23 Nov 2023 10:58:29 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a00ac0101d9so159848566b.0 for ; Thu, 23 Nov 2023 10:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700765908; x=1701370708; 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=dhz1HO1TFrn+esU2JyrDQXLuWyA0tprcaBHDYdqjcxQ=; b=gJ7RVFr3BplZ5mzK9yqnTTzgxxePX12hdwZxTOZVjyvDkAHDNGRB9FOY1tBe9+Tciy v7+tjZrsyNjceJy18oL2Z0PyHfCOdBAa15uMgul5YIDOoogvZDnkNBz8RSJS8OeHMjlG hAU+224l4M7e5HgXkBk8ZP2krc+RG2WQMkmTJK/UIaU+wYVsssIBc4bQbKWJVqXmxvfD hkCm4zbKHfUKLnUOYqSq8HANBiB2FpLtzGTRmi8l6CQcN842fdGCr6pchNq2uSiwvp3J cZk79Z716Rz97DCQQXzbpTNlzgAXJFj5vVsv+doYGPWUVaxoW+jdHvP6vIYbyhBjx2sp DzdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700765908; x=1701370708; 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=dhz1HO1TFrn+esU2JyrDQXLuWyA0tprcaBHDYdqjcxQ=; b=fXlIO/hketUE75a4LSjlXFki5mTB3ZCktrCdfCP2Tu7RpTGji4MoGsR6/MzFck0rZp LeHiNJzueUQHcEo0EA++TQJLwWlvuAwF7t5Hy4LuDkKwd2DqLt/zKEiWaUF40paD5CAd veBCDfsIlGe/0YPruxbtAqeADQuyjEwSIh/FK8LsRhUqARK6f9sZgcZBIgNRe0XldeE9 cKCeS+pIBTSK5/WgbhE6vWcUb9MJNP/noBsyVcIlOjeASpf1fRyYFl8W8oADqZiHACTs f82i8pMIGMEa+I2WgH4xr51Fxvh3R3w68bB3XB2ys1apnnQRcYWwOvSsC6/72XL5l+uB 9scw== X-Gm-Message-State: AOJu0Yz5oe1M0383fBfp2+nKFemOcb9aB9fYPI+iF/EdmZRPQRwL9Kj/ AUVW8GP9PK63RnQhMtXjXgdT+A== X-Google-Smtp-Source: AGHT+IHuV5dXf2Er0VwPFonFK4Fp1h+h+XsSB+7tO9pY2bovS/v0cFYLhOuYH9heihq0E1lWqqNMWw== X-Received: by 2002:a17:906:d4:b0:a01:8ef2:849 with SMTP id 20-20020a17090600d400b00a018ef20849mr177665eji.4.1700765908104; Thu, 23 Nov 2023 10:58:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:58:27 -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 1/5] tools: selftests: riscv: Fix compile warnings in hwprobe Date: Thu, 23 Nov 2023 19:58:17 +0100 Message-ID: <20231123185821.2272504-2-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 hwprobe 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 Reviewed-by: Alexandre Ghiti --- tools/testing/selftests/riscv/hwprobe/hwprobe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/riscv/hwprobe/hwprobe.c b/tools/testing/selftests/riscv/hwprobe/hwprobe.c index c474891df307..abb825811c70 100644 --- a/tools/testing/selftests/riscv/hwprobe/hwprobe.c +++ b/tools/testing/selftests/riscv/hwprobe/hwprobe.c @@ -29,7 +29,7 @@ int main(int argc, char **argv) /* Fail if the kernel claims not to recognize a base key. */ if ((i < 4) && (pairs[i].key != i)) ksft_exit_fail_msg("Failed to recognize base key: key != i, " - "key=%ld, i=%ld\n", pairs[i].key, i); + "key=%lld, i=%ld\n", pairs[i].key, i); if (pairs[i].key != RISCV_HWPROBE_KEY_BASE_BEHAVIOR) continue; @@ -37,7 +37,7 @@ int main(int argc, char **argv) if (pairs[i].value & RISCV_HWPROBE_BASE_BEHAVIOR_IMA) continue; - ksft_exit_fail_msg("Unexpected pair: (%ld, %ld)\n", pairs[i].key, pairs[i].value); + ksft_exit_fail_msg("Unexpected pair: (%lld, %llu)\n", pairs[i].key, pairs[i].value); } out = riscv_hwprobe(pairs, 8, 0, 0, 0); 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: 13466604 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:19 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: 13466605 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b="Wut90YIg" Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 239561B3 for ; Thu, 23 Nov 2023 10:58:33 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-54acdd65c88so297358a12.2 for ; Thu, 23 Nov 2023 10:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700765911; x=1701370711; 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=+gBMT1D8EIh0bBWoj7ImRklCKaan3pldMceeCzs+vUQ=; b=Wut90YIgGWdeYAfFnYgnkugdn4Ab3YQZLngX+t7BRQtw0bQlJapmf/um1Yd5xyAIDU yzjHihrUKawz6T/TgU0M6EAU6hsuivLBqbHORBy2xZOhOgNjlAnMfVBf6wOOpg8tZmiK 7/n+6oC533vD+5tGEQRkJ7UjS0xYxqAUjH9QFMao/cP2hBBJczlXc6ijT+LfHn1RMyfc p+XX/GP3L5LTeWf3cQKGspTvXh5kmwEziwHFyLlRTD3X6NfS4Hc1b0ei9qhrS6jP9ZBA 1yleh2JLIUzbn/JCqJHoia363GAfwnQ7+VflDk6ysr1WAVF7PkMNSpjVp911t+DCZig0 2t/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700765911; x=1701370711; 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=+gBMT1D8EIh0bBWoj7ImRklCKaan3pldMceeCzs+vUQ=; b=pfuU20XngBswTRY3bHlqOlwr/JBHBFOXUIXP3QGECNV6dLBJiGE0emX5m4LgzpMmkq EnbWZLkzfAYd7Wb93vbP4AmKXL0CeUTiCpZY3YPqItLQIAmZ41/5H2V/aF7EaQ9eEqAY 4EQ5uEkRRc/ZSny5NCzNw+91F0IEi/4T4JcYNrCpDYxN+syYvjWX11MlnjC0aIl+KrI9 lIl5xWxDPMGp/6qYha0xQKa+vLZiD6YBwsi1NxMqIL+C9KA86KU4p8o+2Zqa+wBirDa3 3nD56llTz8RHcvqBRqUWCitHlCEL/ZqH966uqiZz9tKbYIJMBM3x6CZmdX14tuMAnUmE HvTg== X-Gm-Message-State: AOJu0YwC1zfUewgw4yYELHMUq2rmiCjm2ymPvlO25yxnszyGpIXk6fyd GghTymgc0PjJvek6SHa/jZYso/yJxH2hNPwr8zu1ljTT X-Google-Smtp-Source: AGHT+IHM33vf1NCGDtR+L8oDLbeP6Km4LXuLVeIqB8PR1IIY6cQtOKQe4/t/v35w1zVrGzfmN4G2PA== X-Received: by 2002:a17:907:d30c:b0:9bf:d65d:dc0f with SMTP id vg12-20020a170907d30c00b009bfd65ddc0fmr232442ejc.4.1700765911728; Thu, 23 Nov 2023 10:58:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:58:31 -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 3/5] tools: selftests: riscv: Add missing include for vector test Date: Thu, 23 Nov 2023 19:58:19 +0100 Message-ID: <20231123185821.2272504-4-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 raises the following warning: warning: 'status' may be used uninitialized The warning comes from the fact, that the signature of waitpid() is unknown and therefore the initialization of GCC cannot be guessed. Let's add the relevant header to address this warning. Signed-off-by: Christoph Müllner Reviewed-by: Alexandre Ghiti Reviewed-by: Andy Chiu --- tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c b/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c index 2c0d2b1126c1..1f9969bed235 100644 --- a/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c +++ b/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c @@ -1,4 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only + +#include + #define THIS_PROGRAM "./vstate_exec_nolibc" int main(int argc, char **argv) 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: 13466606 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; } From patchwork Thu Nov 23 18:58:21 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: 13466607 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vrull.eu header.i=@vrull.eu header.b="lMrpwtT8" Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6DA5D54 for ; Thu, 23 Nov 2023 10:58:36 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-991c786369cso166409866b.1 for ; Thu, 23 Nov 2023 10:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1700765915; x=1701370715; 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=vE4taij5q3MAjmiPUZKHE8qoF6TdBc6iBW1aIWJ4LYw=; b=lMrpwtT8QXuTgaqbLHjMRLG+t/59U5KedCK3NhKbEPpJsOdmFxMIlvx20vmYNZmfZ1 t13Y4JlUqz6slxj+Y1gpzbxy1iVr7T5P2iv44BpGYDowATlcyY54kL/bwWWCJWgUE0+n 9vl6cs0AL0N3jHUtD0nzAEs7oRP3sm8ss/blYAh150OvKZmTQJRRQq235qcHmienZaNr RRABTWM18akM09CCl/NxPIBNcKv1pkFrDN/pnXOunehrWUBmi6lHNdHwWmcWrgjli6mT i9bvVEy97zRThVaey22nhFtN2oau0W2qo6YwmpYcYG/rv+mMkfpTDd/xdNbdJfEx0x1J katA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700765915; x=1701370715; 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=vE4taij5q3MAjmiPUZKHE8qoF6TdBc6iBW1aIWJ4LYw=; b=HCigdOiUHgf5huj4oiNCPILIV2xHiNwLT7AkR9KjEiykYgFr/48melKPmJrgyZvOmx hunhzYt/zvlH3FBrdzJQCXwTFR8LckptHUGvsFy5c6ka83k2rNs1ZRjhQvfmSSEtgGFw Mo+Jgveq/Jg2zaM1oh4KuATl0FNXWS+DmvKir5Mt7up/hgqV4NEVtztP2nHHYwqeithJ EK1YuFOyDoydbg/Qzx0v3WQMKrtbzw7SxpXYqeUny1CeBNSt3K5IOYcwImKhDi8fc2XK MVwraOvf2Jhp4oTcV8qkr6eFcck1j+jq+sZRjpTS+WciwEYxxHcDfC5Xef7oUF7AGl4Q qCWg== X-Gm-Message-State: AOJu0Yz7rt6DiVCZF4reLyfMhKqPkir11f9NmFHjHrj4e8vr3RDNKzjV c55fjTdUBXtjQo97Yw6EQW6oAa88mKEKjAkYXDBFoVWd X-Google-Smtp-Source: AGHT+IGq6dOMJJMtU5Up+yGiMT76gDi7Z83Zw3jt75JpsMbNdpOYO4U2mN9YDUlYYRNjg8nPchbdWA== X-Received: by 2002:a17:906:1ccd:b0:a00:a591:929 with SMTP id i13-20020a1709061ccd00b00a00a5910929mr195955ejh.24.1700765915300; Thu, 23 Nov 2023 10:58:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 10:58:34 -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 5/5] tools: selftests: riscv: Fix compile warnings in mm tests Date: Thu, 23 Nov 2023 19:58:21 +0100 Message-ID: <20231123185821.2272504-6-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 When building the mm tests with a riscv32 compiler, we see a range of shift-count-overflow errors from shifting 1UL by more than 32 bits in do_mmaps(). Since, the relevant code is only called from code that is gated by `__riscv_xlen == 64`, we can just apply the same gating to do_mmaps(). Signed-off-by: Christoph Müllner Reviewed-by: Alexandre Ghiti --- tools/testing/selftests/riscv/mm/mmap_test.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/riscv/mm/mmap_test.h b/tools/testing/selftests/riscv/mm/mmap_test.h index 9b8434f62f57..2e0db9c5be6c 100644 --- a/tools/testing/selftests/riscv/mm/mmap_test.h +++ b/tools/testing/selftests/riscv/mm/mmap_test.h @@ -18,6 +18,8 @@ struct addresses { int *on_56_addr; }; +// Only works on 64 bit +#if __riscv_xlen == 64 static inline void do_mmaps(struct addresses *mmap_addresses) { /* @@ -50,6 +52,7 @@ static inline void do_mmaps(struct addresses *mmap_addresses) mmap_addresses->on_56_addr = mmap(on_56_bits, 5 * sizeof(int), prot, flags, 0, 0); } +#endif /* __riscv_xlen == 64 */ static inline int memory_layout(void) {