Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2631251rdh; Sun, 26 Nov 2023 13:30:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqWmho8dRJuPj+O/VrI8PGSkMiEANXOtL3YGL7IS+lcB/RXFfVa0i2H45krJXubH42MRx1 X-Received: by 2002:a05:6a00:1993:b0:6cb:cdd0:76f7 with SMTP id d19-20020a056a00199300b006cbcdd076f7mr10550985pfl.21.1701034216762; Sun, 26 Nov 2023 13:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701034216; cv=none; d=google.com; s=arc-20160816; b=CTjaqGtvIoPV2oTM4ksAv7W8eUG3n+B2LU7++f28EiEAH8kw9uwpNV93YtdClHkVsw fL11k1Vf3Cccd7CAvuDQNsfUktUBx/XtXGTQuNHktrTdT2YwZe84SI9wz0l3ULgTxFGm +wOKl8/534QN9hYJ3rlodsCTt1vM/6C6O08tfitLUEx/Es8T3XzXspS2JkGW5XUrGfak SVnelTu/RIFp9W5QgyL+Mxma8kanqIyV7enC2VRarHtV4rjpxBGFnG/PszyjSpqT6QRN lm4A4IejtcDeByitNXCkIbxY5E7SLRucEynhZL9XKB3XU6JmEAf940AXxtW+BjVq6g6H Lu0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vE4taij5q3MAjmiPUZKHE8qoF6TdBc6iBW1aIWJ4LYw=; fh=/eO5nk+0DJTE9DN9tCVbd3UjUSmw806IPGhK6G20PBw=; b=P73vFee6PRUSdveON3pgSAO1IfjfSGSY7Z+HfsOrdVUwIZ9UIp7IxLcCRxG78zd8KO Dqc6vJ7mCFx6BarSxfR4CquuskphE6KdS/Z1SVTGte36KB6zg3O5yJPM7NjNvPTKmw0f igEBY+tjSCIigSB5nYDmPrGk8ZJOpRWb/H6c5K8bOyTkw1mx8vIaVH/qS6lIhMslRHs3 sLdLKtMTRoVJXpH8WocZ4hprdOtDfVVVlpDSZeCXC/RFkMKBhYzLKL7WPJmW19Q1O7pz vh27kuCzhoRwEuCq93B5dqNANYCPZeuH52RydVJ6e02pducHCkRqE0ty2Zg8hXKTcMfG UbHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=lMrpwtT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p18-20020a634f52000000b005b5c68e2c92si8234599pgl.371.2023.11.26.13.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 13:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=lMrpwtT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 9A44E8068953; Thu, 23 Nov 2023 10:59:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345889AbjKWS6i (ORCPT + 99 others); Thu, 23 Nov 2023 13:58:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbjKWS6a (ORCPT ); Thu, 23 Nov 2023 13:58:30 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA777D60 for ; Thu, 23 Nov 2023 10:58:36 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a02d91ab195so164042766b.3 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=bOAKAL1MJVHW89gGGqonDJbbLkxb/RRvjx3D98TrYpug+rhRYyIq958up1YPjwdffO 31OCYrZPG+P3YgaVjEASd571oVJMYisZzgVdAwj0g+cFae1F2zUMvLQ4jcmkafu6HYMM 3mZvOB7tXYza486DwFY2FvXYj25OeykXzgJDe1gfzwemi+UB9njFKEF046zQOcqpMzTA HC8Kz++eJX5n4IKHf91279S1/4nkPkSGmQw2C1S4m3Orw/AxBbdDHOPWCWNnSVb1hsU4 TlPXgipap1AJObRxVvnnbkhbBQNvu+byGNMONtwg0xRzApMW2V4D24mcee2/lDemQ11Q vY4g== X-Gm-Message-State: AOJu0Yxg8ZUj3bNXGkHKhpCXDQm8Ludata0aQk9RDJ4CHD/4ucCcOdgu yaoeQA2XiIlbuY2N6+zXE/msog== 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?q?Bj=C3=B6rn=20T=C3=B6pel?= , Charlie Jenkins , =?UTF-8?q?Christoph=20M=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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 23 Nov 2023 10:59:11 -0800 (PST) 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 --- 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) { -- 2.41.0