Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5539986rwd; Wed, 24 May 2023 03:23:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55KyWaWT0RSrUPsweKDOLIydtXq0Pyf6jqEZCyUq86LWH8K36LzNASU5axw/16cN2NB9mP X-Received: by 2002:a05:6a20:6a1e:b0:103:b448:ddd8 with SMTP id p30-20020a056a206a1e00b00103b448ddd8mr20402756pzk.58.1684923820701; Wed, 24 May 2023 03:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684923820; cv=none; d=google.com; s=arc-20160816; b=olsYpBcDkv54G0o8OkShSO/hm+PbDPk9h/b2Ra1BvgQmu0TaiOPgqihxdocQkEs1OB sOYIhczyAMGzBXpqHTM1ta3DBaHKxo9oXCsKqqAbxTdUMkAn1/8CRlvNU8EQ5C+lFA5w Y6EVJVJnyfxjPk9YKAh+f2IlUvcQtD6DReKPdUUBMvoEKIv6mJj4ckIiZKjj9bDCeFpo uNIA9GiqB0E2yZ8ipCPZNU3PRqq5RhPrRMT0qX00uQb8iA6z9yhEdD3Su2Nf1l9X/cxE V/SgJrarr8xcq0lqn8heKciQhvWI2Z9ZEO837mVMvn+dV03tTnieC776QKZ/OaPgkXbw daVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=cbLA+EdNZOhndSS9V5BWEfUqUJPrO6A9v7Kr16VhQLA=; b=d9ahiMOE5zg+i69MPgFa1AFo5JUU4bHSfPTEE/06CF5XBhyNpBnahi044D8oMa6ZYv 4i3HTyFOvpk80vFx3RftuYDcS5w4lLniXYiYo4ZhJre+GgEcZrtIXaXq9jFDml6WNZNT ENn5nZ5GykFLXechoaFVWd7C/Z7UMYYMC7C8W2+f3BCTest07dWG+CLi2tRKoRgPaQF2 mETm0Ey6bemqGj5LT4YqwMGuDYs+p7ZuANOaRhECDxqaPmfNokKrmZUS0Ihb7kNfKq/F ZrXOkLidsK9U5ZzYsz2kAEiur/O3hKdieBPi25W4M+Gx6X+2hGhfjgRx1TmuhyaC6C7B mx2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a637203000000b0052ca3209fc0si593808pgc.651.2023.05.24.03.23.28; Wed, 24 May 2023 03:23:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbjEXKKz convert rfc822-to-8bit (ORCPT + 99 others); Wed, 24 May 2023 06:10:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbjEXKKv (ORCPT ); Wed, 24 May 2023 06:10:51 -0400 Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D4BFFC; Wed, 24 May 2023 03:10:50 -0700 (PDT) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-563b1e5f701so7005407b3.3; Wed, 24 May 2023 03:10:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684923049; x=1687515049; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qjsS8fRbVoZU8c34Ms8NTam545AKBDbkDG6TRRcdYb4=; b=LjtrAJ8Z85MESZw25ozmK2IDUbJ9EQMNlRFB6a03PSPp4vRG2qSs1Xg2B0+QfdYUFh eVkflIxZznOABD692XTjfe1/1FPAUSBS3CRDVW9S01s3nQm5CuDOCfgujL6x5l9LqqGR lOUYTKkPrDTcXfxbg2lQC/G31quMWfuJYyS50PXfZecOBQ9XKvtwjnmejuX6M6ph9ifS YNdgRDaUkf+P2AGyiQyjctdX/K6TbSgtmfrYGBR1wySp7yPQDkJGrEOrPNtStAPzhB0a NeOznzVlGZBWO+yqYk9bBJkPvs/O5nETJXfFNWpdWYIaF+PfrpGORLnB7RjtSpbCyTTo ZjPQ== X-Gm-Message-State: AC+VfDym/LE86ixzpJ1ERmgA30CdRPCAfKBsXebaWw40QH16Y8jR5SMI TVvob1fPlxCo0OsJu5CQ3Jt23SJ7iF53pg== X-Received: by 2002:a81:a107:0:b0:55a:1f2:ef6 with SMTP id y7-20020a81a107000000b0055a01f20ef6mr16756863ywg.9.1684923049215; Wed, 24 May 2023 03:10:49 -0700 (PDT) Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com. [209.85.128.169]) by smtp.gmail.com with ESMTPSA id x11-20020a817c0b000000b0055aaccfa2c7sm3592626ywc.91.2023.05.24.03.10.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 May 2023 03:10:48 -0700 (PDT) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-564dc3dc075so7136977b3.1; Wed, 24 May 2023 03:10:48 -0700 (PDT) X-Received: by 2002:a0d:c007:0:b0:560:ee0d:1d95 with SMTP id b7-20020a0dc007000000b00560ee0d1d95mr18669163ywd.3.1684923047913; Wed, 24 May 2023 03:10:47 -0700 (PDT) MIME-Version: 1.0 References: <20230503-virt-to-pfn-v6-4-rc1-v3-0-a16c19c03583@linaro.org> <20230503-virt-to-pfn-v6-4-rc1-v3-2-a16c19c03583@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v3-2-a16c19c03583@linaro.org> From: Geert Uytterhoeven Date: Wed, 24 May 2023 12:10:36 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 02/12] m68k: Pass a pointer to virt_to_pfn() virt_to_page() To: Linus Walleij Cc: Andrew Morton , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer , 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, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Linus, On Tue, May 23, 2023 at 4:05 PM Linus Walleij wrote: > 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. > > The page table include will include different > variants of the defines depending on whether you build for > classic m68k, ColdFire or Sun3, so fix all variants. > > Tested-by: Geert Uytterhoeven > Signed-off-by: Linus Walleij Thanks for your patch! > --- > ChangeLog v2->v3: > - Fix up versioning. This is v3. > - Let Coldfire __pte_page() return a (void *) instead of __va > - Delete Coldfire pte_pagenr() which was using unsigned long > semantics from __pte_page() You may want to mention this removal in the patch descriptin. > - Drop ill-advised change to Coldfire pmd_page_vaddr() > --- a/arch/m68k/include/asm/sun3_pgtable.h > +++ b/arch/m68k/include/asm/sun3_pgtable.h > @@ -111,7 +111,7 @@ static inline void pte_clear (struct mm_struct *mm, unsigned long addr, pte_t *p > > #define pte_page(pte) virt_to_page(__pte_page(pte)) > #define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT) > -#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd)) > +#define pmd_page(pmd) virt_to_page((void *)pmd_page_vaddr(pmd)) There's an extra space between "void" and "*". Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds