Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4538688pxv; Tue, 27 Jul 2021 09:41:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPofalo33krRnw6VkNScJS+anlFYZtDLgSXNgd+CYauhoVF66zWXtgVTMAhOmxefS+7dsc X-Received: by 2002:a6b:490d:: with SMTP id u13mr20020371iob.176.1627404080073; Tue, 27 Jul 2021 09:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627404080; cv=none; d=google.com; s=arc-20160816; b=KCmwOXe8qM226bUsYsjUn7x5FOgm3PQ0h0X8hL/d+XqIGNhXhzf79Hc8xSjjBGxfw3 WdS2tSelBrhfiM4wozn8WAbBiW83W9BUjHVT+PP1N6trd45jIMN8RFow9xFbcmmBkjS/ WdlWvvrITkMpy3oHFklTTLiL3ZRYnZ3L567fTjei/Qu1oj5WT3nWbW8qSHe9CJmbHADP rNt3W+Pvr07X9ZrR1RatFUD9KDENP3XRLf2VRd9DA9a96SnrA6/AWSGCJP9qPv2j/2oM DjjPIyzq7cvbpWWpgQjVqZJ/dJmonrGsDcEa7z1M3MyDytzxVt4kgX9ZTR6gYf9PkfEp 9mGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=B38AyboTkC/mNsU5eDXVrzbwWKVsUOUNO1r/hr1RHTY=; b=U2jAY4g6IQzOI1voLl+3tYeoD3t1qiRYf1bGw2zIda3xbs1k+k6nOm9/E5tyJh3Aun dCjmQkdtQTPSo7mj66AlF6I5EXRpIZmeDe5wnG9YbrDiHZ+DTDBr6DojKPrHM5gpRe1E 06YqoTWgwiy86Xc1aRZ0HdT3jYvn6QZrrex7mKXbHQuU7yi84vq4SqSfnMvcg20vyPqQ 4vQXBQqCZ+Hb4jdO5a+oDB5ibBaVnKXv7SVPuxa6EExUQWz/EfOOzmocYbapydnL6oW4 4QZU5JnmG5xdgqljNHLh5ukmZz5NR1zAA5ofKhYnRyTREdmW3juSvatM11SMereQhUVN oQJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si3399643jah.86.2021.07.27.09.41.07; Tue, 27 Jul 2021 09:41:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbhG0Qix (ORCPT + 99 others); Tue, 27 Jul 2021 12:38:53 -0400 Received: from foss.arm.com ([217.140.110.172]:41142 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbhG0Qiw (ORCPT ); Tue, 27 Jul 2021 12:38:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 653EC31B; Tue, 27 Jul 2021 09:38:52 -0700 (PDT) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BA32D3F70D; Tue, 27 Jul 2021 09:38:50 -0700 (PDT) Date: Tue, 27 Jul 2021 17:38:45 +0100 From: Lorenzo Pieralisi To: Ard Biesheuvel Cc: Linux Kernel Mailing List , Will Deacon , Hanjun Guo , Sudeep Holla , Catalin Marinas , "Rafael J. Wysocki" , ACPI Devel Maling List , Linux ARM , Veronika kabatova , Robin Murphy Subject: Re: [PATCH] ACPI: Add memory semantics to acpi_os_map_memory() Message-ID: <20210727163845.GA16478@lpieralisi> References: <20210726100026.12538-1-lorenzo.pieralisi@arm.com> <20210727100645.GA7108@lpieralisi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 27, 2021 at 12:09:47PM +0200, Ard Biesheuvel wrote: [...] > > > > +void __iomem __ref > > > > +*acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) > > > > > > I am aware that this just duplicated the prototype above, but I think > > > this should be > > > > > > void __iomem *__ref > > > > > > given that the __ref comes after the * in the prototype below. > > > > Yes I just moved/duplicated the prototype above but I believe this is > > consistent with include/acpi/acpi_io.h unless I have not understood > > what you meant ? > > > > It is probably worth changing it in both places to > > > > void __iomem *__ref > > > > ? > > > > I can do that with an additional patch. > > > > Yes, as long as they are all mutually consistent. The __ref is not > part of the type at all, so it should not be between the void and the > *, even if the compiler appears to allow it. Updated into a small series, will repost next week when I am back. Thanks, Lorenzo > > > > +{ > > > > + return __acpi_os_map_iomem(phys, size, false); > > > > +} > > > > EXPORT_SYMBOL_GPL(acpi_os_map_iomem); > > > > > > > > void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size) > > > > { > > > > - return (void *)acpi_os_map_iomem(phys, size); > > > > + return (void *)__acpi_os_map_iomem(phys, size, true); > > > > > > I think this should be (__force void *) to shut up sparse address > > > space warnings. > > > > Yes I can add that attribute in an additional patch and rebase this one > > on top of it. > > > > Thanks, > > Lorenzo > > > > > > > > > } > > > > EXPORT_SYMBOL_GPL(acpi_os_map_memory); > > > > > > > > diff --git a/include/acpi/acpi_io.h b/include/acpi/acpi_io.h > > > > index 027faa8883aa..a0212e67d6f4 100644 > > > > --- a/include/acpi/acpi_io.h > > > > +++ b/include/acpi/acpi_io.h > > > > @@ -14,6 +14,14 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, > > > > } > > > > #endif > > > > > > > > +#ifndef acpi_os_memmap > > > > +static inline void __iomem *acpi_os_memmap(acpi_physical_address phys, > > > > + acpi_size size) > > > > +{ > > > > + return ioremap_cache(phys, size); > > > > +} > > > > +#endif > > > > + > > > > extern bool acpi_permanent_mmap; > > > > > > > > void __iomem __ref > > > > -- > > > > 2.31.0 > > > >