Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8696082rwr; Thu, 11 May 2023 05:11:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DYjvcmFpIVKNvLG34tnSNLvPUwVwKUZTUjG3Xol9ScHh/NINbyrlVF2d/fibYQifPxE2B X-Received: by 2002:a05:6a00:883:b0:63b:2320:a39f with SMTP id q3-20020a056a00088300b0063b2320a39fmr28486888pfj.19.1683807064333; Thu, 11 May 2023 05:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807064; cv=none; d=google.com; s=arc-20160816; b=LxGL7cn/y/XNi9RFdkncDNeBNEm1z1Ch33SiN1nnSBk+yhdxpA8UlJROku8lDLkPn0 GVW3U4FzOL0EX3qq7WEuJ3zFEPt75IDTg4mNIdsOaaOW/SbOlx+3N2nh2XHfzbY5pC+n m3Pq2KedzxSy1DhkCir6KizqNiKH7tv/qZS1tGjLxyDLnO6lS0uoYOWrmALXfYcWRvJP o1Djqd/yU3ObUGovdQWwhiiAUkXFqeC3MULKTpSHTala5Gzwbrk9R52xiiMrhmKOLDqw ApFUpqdxb6mwvBmunQrDIk1iVYr/ZSGXFfsTbwjc87DdM8KtGIadjba224SM4bA7EiOk VELw== 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=p9HwjvVojH9hO+PcXlqtL0N9aNW9rB2MppMH77zfxVc=; b=WpUTKKT0ZRh0PboWtDy5aH+d25g4QIf2DKF1yucUG3dPp7cvOfdWgJmduVE2nYmXwS JJVEjMYJPFzdUNQqoHjxNqe+Tt7REsVs60pO0rXZyCVCZAXuzvfd+vZEyGVU/EDUSZTu PCwhnLSPO1Mq3e0tIbu37vpHIL6jKlJHSjqKmueN9gH+B+YeCYPmOy3NEShSZEOkuRA1 4SYHR7EKUnLKo6IwxB9YgvlET8wrzTSLxDszbhf/ZFlR5jCrgZ45TT5rgSf2a76jGfSf EiJ3d33cBvnaS7tlMtUySt6fwyVeY2d28pul3ERfgwUnf4WueRXULMxcmJa6mAJARMyf ho0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h0huwFcu; 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 y26-20020aa79e1a000000b0064359e09cecsi7846924pfq.18.2023.05.11.05.10.45; Thu, 11 May 2023 05:11:04 -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=h0huwFcu; 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 S237928AbjEKMAF (ORCPT + 99 others); Thu, 11 May 2023 08:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237927AbjEKL7y (ORCPT ); Thu, 11 May 2023 07:59:54 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD188A5B for ; Thu, 11 May 2023 04:59:50 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f14468ef54so9688774e87.0 for ; Thu, 11 May 2023 04:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806388; x=1686398388; 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=p9HwjvVojH9hO+PcXlqtL0N9aNW9rB2MppMH77zfxVc=; b=h0huwFcuyufkrW22b7sSvhGB+Ccc6Lvo9LGZiN8vwcbnU3/n9iarupyO8uSUn0mH7F UImAdUl3W888BP2VJ8/y8hWeLPQaZrBrjm/Nu0uLf1rKtgfpgHOHOP3tTQ9zFsRYQoKI fGAtPet9xa7ZtgZBS/HBd67ncf+0PhGxnnIJLi+0TR3kFXVIwxrxsSsx9kN2u2S00z2X 5KFPOq38DBsV6TYrMad4lE6aD4UesfNWsMyc8GuXrhIa7ASsSuoxihIooTid0hE5RsnF bNeaAbNDtKQlSprjkgw+hz3rwPgZB+BNN+D6bTWYVkWkC3zgqquZjKjZxaDyStXaw9xj elHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806388; x=1686398388; 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=p9HwjvVojH9hO+PcXlqtL0N9aNW9rB2MppMH77zfxVc=; b=CQCczD3KIR68UcPueQSClSUx7Ne0VmT3H7wk1/OaiM73L7LyLhIxR1QSQg4xxRZIsY GFYqGZCCLNBJbnjGLW9w8TlLGzb+Kh6l7wczUO6cjDzr+uIVjOge3jmaciKw4FiSB30y GIXf71fPcE9+MuzU1WKiz+wTWis4EBi30/wbtCBSrGKA1LuUmbMyA4TP1vuVWm6cLGp9 Zc3D4Nd+QbGiey/gTaDm7LUWHKZIy0ni29agFDhnjMaNPcGeDLFPYb5EyB8JizRT/6OD dLTkEi2F2qeewTuC3Iy6v5W/Pa+i6QCct2Mgw4gnREbnzM+Yxxw77ShI3xuyPkl+7SOe bD1g== X-Gm-Message-State: AC+VfDzMNqbwCHOAVJ+UdVWor5a0yul/fwzQbokZFAYhmIN+2Wp+2EXB MioWCZHVuwZYv9yEWHoWKRElZg== X-Received: by 2002:a19:f813:0:b0:4ec:a48a:28c0 with SMTP id a19-20020a19f813000000b004eca48a28c0mr2749652lff.25.1683806388439; Thu, 11 May 2023 04:59:48 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:48 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:19 +0200 Subject: [PATCH 02/12] m68k: Pass a pointer to virt_to_pfn() 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-v1-2-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: 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 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 up the offending calls in arch/m68k with explicit casts. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Add an extra parens around the page argument to the PD_PTABLE() macro, as is normally required. --- arch/m68k/mm/motorola.c | 4 ++-- arch/m68k/mm/sun3mmu.c | 2 +- arch/m68k/sun3/dvma.c | 2 +- arch/m68k/sun3x/dvma.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c index 911301224078..c75984e2d86b 100644 --- a/arch/m68k/mm/motorola.c +++ b/arch/m68k/mm/motorola.c @@ -102,7 +102,7 @@ static struct list_head ptable_list[2] = { LIST_HEAD_INIT(ptable_list[1]), }; -#define PD_PTABLE(page) ((ptable_desc *)&(virt_to_page(page)->lru)) +#define PD_PTABLE(page) ((ptable_desc *)&(virt_to_page((void *)(page))->lru)) #define PD_PAGE(ptable) (list_entry(ptable, struct page, lru)) #define PD_MARKBITS(dp) (*(unsigned int *)&PD_PAGE(dp)->index) @@ -201,7 +201,7 @@ int free_pointer_table(void *table, int type) list_del(dp); mmu_page_dtor((void *)page); if (type == TABLE_PTE) - pgtable_pte_page_dtor(virt_to_page(page)); + pgtable_pte_page_dtor(virt_to_page((void *)page)); free_page (page); return 1; } else if (ptable_list[type].next != dp) { diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c index b619d0d4319c..c5e6a23e0262 100644 --- a/arch/m68k/mm/sun3mmu.c +++ b/arch/m68k/mm/sun3mmu.c @@ -75,7 +75,7 @@ void __init paging_init(void) /* now change pg_table to kernel virtual addresses */ pg_table = (pte_t *) __va ((unsigned long) pg_table); for (i=0; i= (unsigned long)high_memory) pte_val (pte) = 0; set_pte (pg_table, pte); diff --git a/arch/m68k/sun3/dvma.c b/arch/m68k/sun3/dvma.c index f15ff16b9997..83fcae6a0e79 100644 --- a/arch/m68k/sun3/dvma.c +++ b/arch/m68k/sun3/dvma.c @@ -29,7 +29,7 @@ static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr) j = *(volatile unsigned long *)kaddr; *(volatile unsigned long *)kaddr = j; - ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL); + ptep = pfn_pte(virt_to_pfn((void *)kaddr), PAGE_KERNEL); pte = pte_val(ptep); // pr_info("dvma_remap: addr %lx -> %lx pte %08lx\n", kaddr, vaddr, pte); if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) { diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index 08bb92113026..a6034ba05845 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c @@ -125,7 +125,7 @@ inline int dvma_map_cpu(unsigned long kaddr, do { pr_debug("mapping %08lx phys to %08lx\n", __pa(kaddr), vaddr); - set_pte(pte, pfn_pte(virt_to_pfn(kaddr), + set_pte(pte, pfn_pte(virt_to_pfn((void *)kaddr), PAGE_KERNEL)); pte++; kaddr += PAGE_SIZE; -- 2.34.1