All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthew Garrett <mjg@redhat.com>,
	Seth Forshee <seth.forshee@canonical.com>
Subject: Re: linux-next: build warning after merge of the pci tree
Date: Mon, 10 Dec 2012 14:25:45 -0700	[thread overview]
Message-ID: <20121210212545.GA15884@google.com> (raw)
In-Reply-To: <20121210200321.1343445856179c58d0d0cb16@canb.auug.org.au>

On Mon, Dec 10, 2012 at 08:03:21PM +1100, Stephen Rothwell wrote:
> Hi Bjorn,
> 
> After merging the pci tree, today's linux-next build (powerpc
> ppc44x_defconfig) produced this warning:
> 
> drivers/pci/rom.c: In function 'pci_map_rom':
> drivers/pci/rom.c:125:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 
> Introduced by commit 84c1b80e3263 ("PCI: Add support for non-BAR ROMs").

I propose the following patch to fix this warning.  Any comments?  If
it looks OK, I'll add it this afternoon.

commit dbd3fc3345390a989a033427aa915a0dfb62149f
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Mon Dec 10 11:24:42 2012 -0700

    PCI: Use phys_addr_t for physical ROM address
    
    Use phys_addr_t rather than "void *" for physical memory address.
    This removes casts and fixes a "cast from pointer to integer of different
    size" warning on ppc44x_defconfig.
    
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index fddb9f6..d07f3bb 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -628,8 +628,8 @@ int pcibios_add_device(struct pci_dev *dev)
 			    (PCI_FUNC(dev->devfn) == rom->function) &&
 			    (dev->vendor == rom->vendor) &&
 			    (dev->device == rom->devid)) {
-				dev->rom = (void *)(unsigned long)(pa_data +
-				      offsetof(struct pci_setup_rom, romdata));
+				dev->rom = pa_data +
+				      offsetof(struct pci_setup_rom, romdata);
 				dev->romlen = rom->pcilen;
 			}
 		}
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index 3a3828f..ab886b7 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -122,7 +122,7 @@ void __iomem *pci_map_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 phys_to_virt(pdev->rom);
 	/*
 	 * IORESOURCE_ROM_SHADOW set on x86, x86_64 and IA64 supports legacy
 	 * memory map if the VGA enable bit of the Bridge Control register is
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f116b2d..957563b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -333,7 +333,7 @@ struct pci_dev {
 	};
 	struct pci_ats	*ats;	/* Address Translation Service */
 #endif
-	void *rom; /* Physical pointer to ROM if it's not from the BAR */
+	phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */
 	size_t romlen; /* Length of ROM if it's not from the BAR */
 };
 

  reply	other threads:[~2012-12-10 21:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10  9:03 linux-next: build warning after merge of the pci tree Stephen Rothwell
2012-12-10 21:25 ` Bjorn Helgaas [this message]
2012-12-10 23:21   ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2025-07-18 12:41 Stephen Rothwell
2025-05-21 10:26 Stephen Rothwell
2025-05-21 12:10 ` Krzysztof Wilczyński
2025-03-03  7:26 Stephen Rothwell
2025-03-03  7:50 ` Krzysztof Wilczyński
2025-03-03  9:46   ` Krzysztof Wilczyński
2024-07-01  9:24 Stephen Rothwell
2024-07-01 19:37 ` Bjorn Helgaas
2024-07-01 20:15   ` Krzysztof Wilczyński
2024-07-02  6:59     ` Philipp Stanner
2020-09-09  2:38 Stephen Rothwell
2020-09-15  3:43 ` Stephen Rothwell
2020-09-09  2:37 Stephen Rothwell
2020-09-09 16:06 ` Rob Herring
2020-09-15  3:47   ` Stephen Rothwell
2020-09-15 10:53     ` Lorenzo Pieralisi
2020-09-15 17:22       ` Bjorn Helgaas
2020-09-02  1:07 Stephen Rothwell
2020-09-02 12:33 ` Bjorn Helgaas
2020-09-02 14:13   ` Vaibhav Gupta
2020-08-05  1:32 Stephen Rothwell
2020-08-05  2:29 ` Bjorn Helgaas
2016-06-23  1:51 Stephen Rothwell
2016-06-23 16:48 ` Bjorn Helgaas
2016-06-24  8:07   ` Johannes Thumshirn
2013-09-03 23:55 Stephen Rothwell
2013-09-03 23:59 ` Bjorn Helgaas
2012-05-01  6:08 Stephen Rothwell
2012-05-01  7:35 ` Yinghai Lu

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=20121210212545.GA15884@google.com \
    --to=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=seth.forshee@canonical.com \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.