Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2553094rwd; Mon, 22 May 2023 00:06:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Inm97Zi4Ri8dF2+lANlILBTV235oCcLHfB822/jo9wPi36EOEsXTM8LfJedfLwxDTKmFx X-Received: by 2002:a05:6a00:804:b0:64d:1e10:5000 with SMTP id m4-20020a056a00080400b0064d1e105000mr14234315pfk.14.1684739183410; Mon, 22 May 2023 00:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684739183; cv=none; d=google.com; s=arc-20160816; b=Y3IvH0vXunCSCAYdBZw1aUhUx+DdWcPTxy7dYGX5cH723DzJczopTYvuVUVMB2gpR0 o2wXwXtZ8DSEZpfe0t3fWegHzWc3NYBmKAX7TCrruMmndu/UBQ1eI2Eeuyo5fLrLIMiM HPS+0chqG3fXkeOh6TKmXPF/bpbQ2Cvxk8GBSldkTGVdIZxrSDSpdbDrinuiRvxDxAJq 4lOfH0IaeO61f1zfJ4kLnGqJh6JzxS8Y12q3RPxFzRSiwX2ygxKnf9FPzt8CG/wuw62N vNs2d0HKCE8qQwrqtLhNMt3bOJaR//niG5VLvY7pqRyJZPnsg7liNeSiB3lJStCwSju9 QGgA== 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=SZOtWVS1lCOxds2QCY7M+hAIKv6XvV3Hqis31ERV0mU=; b=YTX4Tz4CcBGOc47UheSp+g/bVVrlmTcO43VxvIAqLxkTHZTTNLd+6xhPNeOxWORSZ1 XMvyz4RzOYpuwFCbqMdF3ra0uiIh+hANB4UrlJNnoVusFDpz/NjKzZ88UJzj5+aar4em iD9M6vFzNoyrlLZZVavxymqeKWh1VFAHiL6uEscSiaLH4S2FcitLsvqLOavZM4XAWWst gBEj3ZrqbK9DO8yvwZQILMt2j3NMzEnHxxu+hryI3dsjAcrAgfK/UC+QbQ0evHmldlA2 3FGLGf+y38Hj3uyYotLZV9XckyxgXBqzHOc1UfyNR7zU2V91c0myOkuhq/JPORCabo1r uRjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HPynyF9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a63b90a000000b005348fd7cb66si2594454pge.873.2023.05.22.00.06.08; Mon, 22 May 2023 00:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HPynyF9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232239AbjEVHBV (ORCPT + 99 others); Mon, 22 May 2023 03:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbjEVHAt (ORCPT ); Mon, 22 May 2023 03:00:49 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CD4110 for ; Mon, 22 May 2023 00:00:44 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2af31dc49f9so17197671fa.0 for ; Mon, 22 May 2023 00:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684738842; x=1687330842; 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=SZOtWVS1lCOxds2QCY7M+hAIKv6XvV3Hqis31ERV0mU=; b=HPynyF9dBnm8kzZsPMGuzG4tGQ0wQ3Xr3WZ6xD7T/LfVcLe2V89yhp9749clY9crPm qG+Ir4rpDSBK6txtleKSHHAoDkcHodUiVZEGspM78lo5oN/1e608teWeY9dzCA81mmGY 3yD/wym5h4WqSG+LrMozqn4fKUqn/qUP59x8v5zFk9cHktPKlbrYTkPbim+gsAhI7K0m 5w8V6qXvcsdSkuS2CIyEV8/smObrHzuoNcRONSSEORXDMznpyIH08pgdb9ej7EcewhPn nAN3lOIxQfwpuzpgrFnVMITkhgAvyIakdv0L6ph868VTBX1lS5f2Q1HzQjhTiA+la9hW 2/zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684738842; x=1687330842; 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=SZOtWVS1lCOxds2QCY7M+hAIKv6XvV3Hqis31ERV0mU=; b=Rl81qynsRXvJhAHXf8aPtWIXlIcOgqzmYCDJE3GdTXNNkjR2CE3uUnOOLICXonECdF Qqm3t6q3VGj+Zrt+zod3OvizTswNnvMzUD619L0LsO1rprix3bzkzk7i1rwMO0jw4+HW R8KzKuxFUlBu/eFN9+tPc/LuUEMQphojn4S9k0SxZiMo0a19WN6zvUxioWLedE8ZDxsO 3mOmlBbNSnPcvbJW0XcZt9sicdgFRyd6E+gi4o+6cLvb8i0K+80i5VRIC6UGgQvawnVH 3h5L1DyGOwGRpoLtP8IlZwVpG9Stj3d0CfDl5FU9/0O8dYSkoZHDxSJOK+xvasVDlEVF 4sVQ== X-Gm-Message-State: AC+VfDyk/29rJpxcnl5FhsD4cLTnhWE7Uf07s7NHfvJ85zbWU7xNMFUj t7+QM/P6aSRaax8mShMYlvQ4zw== X-Received: by 2002:a2e:a40d:0:b0:2a8:bd1f:a377 with SMTP id p13-20020a2ea40d000000b002a8bd1fa377mr3256924ljn.20.1684738842484; Mon, 22 May 2023 00:00:42 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id q4-20020a2e8744000000b002adb98fdf81sm1010187ljj.7.2023.05.22.00.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 00:00:41 -0700 (PDT) From: Linus Walleij Date: Mon, 22 May 2023 09:00:39 +0200 Subject: [PATCH v2 04/12] riscv: mm: init: Pass a pointer to virt_to_page() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v2-4-0948d38bddab@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v2-0-0948d38bddab@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v2-0-0948d38bddab@linaro.org> To: Andrew Morton , Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-mm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij , Alexandre Ghiti X-Mailer: b4 0.12.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this in the RISCV mm init code, so we can implement a strongly typed virt_to_pfn(). Reviewed-by: Alexandre Ghiti Signed-off-by: Linus Walleij --- arch/riscv/mm/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 747e5b1ef02d..2f7a7c345a6a 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -356,7 +356,7 @@ static phys_addr_t __init alloc_pte_late(uintptr_t va) unsigned long vaddr; vaddr = __get_free_page(GFP_KERNEL); - BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr))); + BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page((void *)vaddr))); return __pa(vaddr); } @@ -439,7 +439,7 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va) unsigned long vaddr; vaddr = __get_free_page(GFP_KERNEL); - BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page(vaddr))); + BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page((void *)vaddr))); return __pa(vaddr); } -- 2.34.1