Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1691622 > unrolled thread

[PATCH] pci: add missing __iomem cast

Started byCarlos Palminha <CARLOS.PALMINHA@synopsys.com>
First post2017-07-19 14:10 +0200
Last post2017-07-21 13:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] pci: add missing __iomem cast Carlos Palminha <CARLOS.PALMINHA@synopsys.com> - 2017-07-19 14:10 +0200
    Re: [PATCH] pci: add missing __iomem cast Christoph Hellwig <hch@infradead.org> - 2017-07-20 10:10 +0200
      Re: [PATCH] pci: add missing __iomem cast Carlos Palminha <CARLOS.PALMINHA@synopsys.com> - 2017-07-21 13:40 +0200

#1691622 — [PATCH] pci: add missing __iomem cast

FromCarlos Palminha <CARLOS.PALMINHA@synopsys.com>
Date2017-07-19 14:10 +0200
Subject[PATCH] pci: add missing __iomem cast
Message-ID<u4VXH-8ol-11@gated-at.bofh.it>
Add missing __iomem annotation to fix sparse warning:
- incorrect type in return expression (different address spaces)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
---
 drivers/pci/rom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index b6edb187d160..fa92d8fe6778 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -193,7 +193,7 @@ void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size)
 {
 	if (pdev->rom && pdev->romlen) {
 		*size = pdev->romlen;
-		return phys_to_virt((phys_addr_t)pdev->rom);
+		return (void __iomem *)phys_to_virt((phys_addr_t)pdev->rom);
 	}

 	return NULL;
--
2.11.0

[toc] | [next] | [standalone]


#1692535

FromChristoph Hellwig <hch@infradead.org>
Date2017-07-20 10:10 +0200
Message-ID<u5eGZ-4x4-7@gated-at.bofh.it>
In reply to#1691622
On Wed, Jul 19, 2017 at 01:05:35PM +0100, Carlos Palminha wrote:
> Add missing __iomem annotation to fix sparse warning:
> - incorrect type in return expression (different address spaces)

How is this going to shut up sparse without a __force?

And once you add the __force please also add a comment explaining
why it's safe.

[toc] | [prev] | [next] | [standalone]


#1693633

FromCarlos Palminha <CARLOS.PALMINHA@synopsys.com>
Date2017-07-21 13:40 +0200
Message-ID<u5ErM-4gx-25@gated-at.bofh.it>
In reply to#1692535
Hi Christoph,

Looking deep into to this, i think there is no need to use phy_to_virts since pdev->rom is already a physical address.
That's what pci_platform_rom should return, right?!

I'll probably send a new patch removing the usage of phys_to_virt.

Regards,
C.Palminha

On 20-07-2017 09:07, Christoph Hellwig wrote:
> On Wed, Jul 19, 2017 at 01:05:35PM +0100, Carlos Palminha wrote:
>> Add missing __iomem annotation to fix sparse warning:
>> - incorrect type in return expression (different address spaces)
> 
> How is this going to shut up sparse without a __force?
> 
> And once you add the __force please also add a comment explaining
> why it's safe.
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web