public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Squash pci_fixup_irqs() compiler warning
@ 2011-04-17 19:01 Kevin Cernekee
  2011-04-18 17:27 ` David Daney
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Cernekee @ 2011-04-17 19:01 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Wu Zhangjin, linux-mips, linux-kernel

MIPS Linux is unique in that it uses a "const struct pci_dev *" argument
to discourage bad coding practices in pcibios_map_irq().  Add a cast so
that this warning goes away:

arch/mips/pci/pci.c: In function 'pcibios_init':
arch/mips/pci/pci.c:165:45: warning: passing argument 2 of 'pci_fixup_irqs' from incompatible pointer type
include/linux/pci.h:856:6: note: expected 'int (*)(struct pci_dev *, u8,  u8)' but argument is of type 'struct pci_dev *'

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---

Reference:

http://www.mail-archive.com/gnewsense-dev@nongnu.org/msg00706.html

It's been two years since the original discussion, and the warning is
still there.  It is now the only warning left in my kernel build.

I was hoping we could get this resolved for good (one way or another).

 arch/mips/pci/pci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 33bba7b..9a35cd6 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -157,7 +157,8 @@ static int __init pcibios_init(void)
 	for (hose = hose_head; hose; hose = hose->next)
 		pcibios_scanbus(hose);
 
-	pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);
+	pci_fixup_irqs(pci_common_swizzle,
+		       (int (*)(struct pci_dev *, u8, u8))pcibios_map_irq);
 
 	pci_initialized = 1;
 
-- 
1.7.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-19 13:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-17 19:01 [PATCH] MIPS: Squash pci_fixup_irqs() compiler warning Kevin Cernekee
2011-04-18 17:27 ` David Daney
2011-05-13 10:17   ` Ralf Baechle
2011-05-19 13:15     ` [PATCH] PCI: Make the struct pci_dev * argument of map_irq const Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox