public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Sunil V L <sunilvl@ventanamicro.com>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Andrew Jones <ajones@ventanamicro.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 -fixes] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address
Date: Mon, 24 Jul 2023 15:33:27 +0530	[thread overview]
Message-ID: <ZL5Mb65sejudi4Ri@sunil-laptop> (raw)
In-Reply-To: <20230724-phonics-earthling-d104ef807286@wendy>

On Mon, Jul 24, 2023 at 09:07:46AM +0100, Conor Dooley wrote:
> On Mon, Jul 24, 2023 at 12:47:58AM +0530, Sunil V L wrote:
> > acpi_os_ioremap() currently is a wrapper to memremap() on
> > RISC-V. But the callers of acpi_os_ioremap() expect it to
> > return __iomem address and hence sparse tool reports a new
> > warning. Fix this issue by type casting to  __iomem type.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202307230357.egcTAefj-lkp@intel.com/
> > Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
> > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> > ---
> > Changes since v1:
> > 	1) Removed enhancements from the fix patch.
> > 
> >  arch/riscv/include/asm/acpi.h | 2 +-
> >  arch/riscv/kernel/acpi.c      | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/riscv/include/asm/acpi.h b/arch/riscv/include/asm/acpi.h
> > index f71ce21ff684..d5604d2073bc 100644
> > --- a/arch/riscv/include/asm/acpi.h
> > +++ b/arch/riscv/include/asm/acpi.h
> > @@ -19,7 +19,7 @@ typedef u64 phys_cpuid_t;
> >  #define PHYS_CPUID_INVALID INVALID_HARTID
> >  
> >  /* ACPI table mapping after acpi_permanent_mmap is set */
> > -void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
> > +void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
> >  #define acpi_os_ioremap acpi_os_ioremap
> >  
> >  #define acpi_strict 1	/* No out-of-spec workarounds on RISC-V */
> > diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
> > index 5ee03ebab80e..e6fdb9edcdd9 100644
> > --- a/arch/riscv/kernel/acpi.c
> > +++ b/arch/riscv/kernel/acpi.c
> > @@ -215,9 +215,9 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
> >  	early_iounmap(map, size);
> >  }
> >  
> > -void *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
> > +void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
> >  {
> > -	return memremap(phys, size, MEMREMAP_WB);
> > +	return (__force void __iomem *) memremap(phys, size, MEMREMAP_WB);
> 
> Why's the __force needed? Does sparse complain about the cast too?
Nope, I think it is required only if the cast is other way. Let me remove
this in v3.

Thanks,
Sunil



_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2023-07-24 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23 19:17 [PATCH v2 -fixes] RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address Sunil V L
2023-07-24  8:07 ` Conor Dooley
2023-07-24 10:03   ` Sunil V L [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZL5Mb65sejudi4Ri@sunil-laptop \
    --to=sunilvl@ventanamicro.com \
    --cc=ajones@ventanamicro.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor.dooley@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox