Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp764991rdb; Fri, 17 Nov 2023 12:01:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVp9SHUztgMfDo+orAOR6J6pcn3Cl+PB3uyTdSZDF4klmYp0KceEPv/dkxUiUG0wpdE6gw X-Received: by 2002:a05:6808:10c9:b0:3a7:48eb:2dc1 with SMTP id s9-20020a05680810c900b003a748eb2dc1mr43740ois.22.1700251308240; Fri, 17 Nov 2023 12:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700251308; cv=none; d=google.com; s=arc-20160816; b=xqFVAOgZvYiKBn1YfVXUBVmpQp80s5A+NTtbyLsVztigchgrCOEb4E6JXAGXtm364q g5yhLSA6LMgyP48ya0GIrHotCydRwfN5ElcU2n7Wiy/NTwe3atLFCzpOrXsu1rgwlgUA cIhEtXQ+ZdUHyZ4oMMspyhAvGJT5sLsIT4tSNe80D5SYe5/BgkR7M7BflQaC1JAMIUfj 9H9/Lww3Wcf502mRFpNWF1v7xI5FSvT1BYw4onEZyngK+ACN76j4aaUMszqtD3hfrX1q ZxmsB5bryBQmyAiCQD5OZOCWwxyE0YkP/AXPX2uM667kApnDQvNFZcRUtk3EUizkScet gXPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=PagaqPISiFMUN5ZfGlzy9E8bahGMoCf4MLBDz6dwo3U=; fh=kw4Z/sSXEfnzVF7S5naQFfkIg6ezWm8mQYNglyA9etg=; b=XM0qi9g8v7fDPHx8MC6y72CV0D6DPfehzpqCDbkZG+2J4UW+JbFaGUx2AT/KEc2mQO Bjvhe5Fhw9PuzhRB/M6UtlyHHxw4h4SCUjgo7fLQVwDY+/e/o+5SOCHziMZjHTIRukPo hUIb402qRKAK/AqCkggzCAfS5/UCiEGzAwoxj3ZNPTKGIuUtZ8KJwDyY23B9AzMj1Bsn Cm3vA0sioT1CWhWV53grijga1Z+oNBGi+pcoTESvYOvmgwu8fdzfwsv5Bgslv4jdmp5Q Hi6aHeMloVq+qWbofjbUvlV6gYCIipzsdGKXM0Qe/0TQiTy4U+xPQ47Gqu2JfZu0U+kP UnlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=qrEa9VIk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l2-20020a056808020200b003b2f5885aa2si827573oie.216.2023.11.17.12.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 12:01:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=qrEa9VIk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id D31E6831805E; Fri, 17 Nov 2023 12:01:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232339AbjKQUBW (ORCPT + 99 others); Fri, 17 Nov 2023 15:01:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjKQUBS (ORCPT ); Fri, 17 Nov 2023 15:01:18 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F017AD for ; Fri, 17 Nov 2023 12:01:14 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1ce618b7919so5934275ad.0 for ; Fri, 17 Nov 2023 12:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1700251274; x=1700856074; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PagaqPISiFMUN5ZfGlzy9E8bahGMoCf4MLBDz6dwo3U=; b=qrEa9VIkFCMc8UBv7aN8NJGTiooZ3UXuqTzX9IXIH9ecQaAlMXRgmud2bwOJ5autrh bGI6CsxP5fGAs62q462ClRCpxepC24dE7VSLqKg8YOO8FdcfTcn2y7AWfyXFlrXbR/Ge aCNLa3zRDr/xs03Qhp+AdBZBDo2VF54PzuUVKAaRgkJZK/Up06vcQdLFzVC/4sQv7AKY 2b58QpujQeY7AaIHJQH8F27596dG1cg7JUFKE7wONJNgJnfcPzYEKke/nPMh4O4t/oVF 9QyxexuSeulKwx1CfulQplwD/LYICJfeCv2P4JU8UhqvsvAOgY0acEiSzaTuOtrhR8wm QP2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700251274; x=1700856074; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PagaqPISiFMUN5ZfGlzy9E8bahGMoCf4MLBDz6dwo3U=; b=PhwrRHmDd6nsCqLncrMDbfG9pTJ3KwgBIhz6dxVipd5JvwpSUQugdtwDeqyKGLiY/p Vhp3euMF37SApmXO/0RwPWA5QpGKwovw9kKUskOztFQ9mmNExt0OCKBA5oOGOgZc1YKf hQKmwXP0kaCWKRTPCwJMsa6pNGx6CeBaKjWmaC87QKYaiR/bOE+v4OHgI6yTdFqc71xU dZl4hA2bZd9dnRz4kG/YCaAe3XK0AVWYmEo1axzTSqRVMaQT63xKUFz+G+EMG7lgD9t4 294Pq3bsiBrJ94KsqCV/5TdOzHZ2kELXLxfINObiRpqtfQA77glewTVjnPjRpSR6VRly ZEbw== X-Gm-Message-State: AOJu0YxLZj744PdIguIjfFmTpXu8+8iSDqDQlTI9Fall+7xgeZkOHFar l5O8MfINvNlo+bpPSCC3xC6U4A== X-Received: by 2002:a17:902:f684:b0:1c0:afda:7707 with SMTP id l4-20020a170902f68400b001c0afda7707mr127578plg.34.1700251273779; Fri, 17 Nov 2023 12:01:13 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id bf1-20020a170902b90100b001b53953f306sm1749737plb.178.2023.11.17.12.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 12:01:13 -0800 (PST) From: Charlie Jenkins Date: Fri, 17 Nov 2023 11:56:12 -0800 Subject: [PATCH 2/2] Correct type casting in module loading MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231117-module_fixup-v1-2-62bb777f6825@rivosinc.com> References: <20231117-module_fixup-v1-0-62bb777f6825@rivosinc.com> In-Reply-To: <20231117-module_fixup-v1-0-62bb777f6825@rivosinc.com> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Randy Dunlap Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 17 Nov 2023 12:01:44 -0800 (PST) Make static variables static and use __le16. Fixes: 8fd6c5142395 ("riscv: Add remaining module relocations") Signed-off-by: Charlie Jenkins --- arch/riscv/kernel/module.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index 56a8c78e9e21..9f2dc2c0e436 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c @@ -45,9 +45,9 @@ void process_accumulated_relocations(struct module *me); int add_relocation_to_accumulate(struct module *me, int type, void *location, unsigned int hashtable_bits, Elf_Addr v); -struct hlist_head *relocation_hashtable; +static struct hlist_head *relocation_hashtable; -struct list_head used_buckets_list; +static struct list_head used_buckets_list; /* * The auipc+jalr instruction pair can reach any PC-relative offset @@ -64,7 +64,7 @@ static bool riscv_insn_valid_32bit_offset(ptrdiff_t val) static int riscv_insn_rmw(void *location, u32 keep, u32 set) { - u16 *parcel = location; + __le16 *parcel = location; u32 insn = (u32)le16_to_cpu(parcel[0]) | (u32)le16_to_cpu(parcel[1]) << 16; insn &= keep; @@ -77,7 +77,7 @@ static int riscv_insn_rmw(void *location, u32 keep, u32 set) static int riscv_insn_rvc_rmw(void *location, u16 keep, u16 set) { - u16 *parcel = location; + __le16 *parcel = location; u16 insn = le16_to_cpu(*parcel); insn &= keep; -- 2.34.1