linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] drivers/pci/msi.c: move arch hooks to the top
@ 2007-12-11 22:19 Adrian Bunk
  2007-12-11 22:44 ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2007-12-11 22:19 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-pci

This patch fixes the following problem present with older gcc versions:

<--  snip  -->

...
  CC      drivers/pci/msi.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:692: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:704: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:724: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 drivers/pci/msi.c |   91 ++++++++++++++++++++++------------------------
 1 file changed, 45 insertions(+), 46 deletions(-)

6b61f9979425bec016aefdddfd415f6fa5240b67 
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 07c9f09..21c73d5 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -25,6 +25,51 @@
 
 static int pci_msi_enable = 1;
 
+/* Arch hooks */
+
+int __attribute__ ((weak))
+arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
+{
+	return 0;
+}
+
+int __attribute__ ((weak))
+arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *entry)
+{
+	return 0;
+}
+
+int __attribute__ ((weak))
+arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
+{
+	struct msi_desc *entry;
+	int ret;
+
+	list_for_each_entry(entry, &dev->msi_list, list) {
+		ret = arch_setup_msi_irq(dev, entry);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
+void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq)
+{
+	return;
+}
+
+void __attribute__ ((weak))
+arch_teardown_msi_irqs(struct pci_dev *dev)
+{
+	struct msi_desc *entry;
+
+	list_for_each_entry(entry, &dev->msi_list, list) {
+		if (entry->irq != 0)
+			arch_teardown_msi_irq(entry->irq);
+	}
+}
+
 static void msi_set_enable(struct pci_dev *dev, int enable)
 {
 	int pos;
@@ -683,49 +728,3 @@ void pci_msi_init_pci_dev(struct pci_dev *dev)
 {
 	INIT_LIST_HEAD(&dev->msi_list);
 }
-
-
-/* Arch hooks */
-
-int __attribute__ ((weak))
-arch_msi_check_device(struct pci_dev* dev, int nvec, int type)
-{
-	return 0;
-}
-
-int __attribute__ ((weak))
-arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *entry)
-{
-	return 0;
-}
-
-int __attribute__ ((weak))
-arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
-{
-	struct msi_desc *entry;
-	int ret;
-
-	list_for_each_entry(entry, &dev->msi_list, list) {
-		ret = arch_setup_msi_irq(dev, entry);
-		if (ret)
-			return ret;
-	}
-
-	return 0;
-}
-
-void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq)
-{
-	return;
-}
-
-void __attribute__ ((weak))
-arch_teardown_msi_irqs(struct pci_dev *dev)
-{
-	struct msi_desc *entry;
-
-	list_for_each_entry(entry, &dev->msi_list, list) {
-		if (entry->irq != 0)
-			arch_teardown_msi_irq(entry->irq);
-	}
-}


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

* Re: [2.6 patch] drivers/pci/msi.c: move arch hooks to the top
  2007-12-11 22:19 [2.6 patch] drivers/pci/msi.c: move arch hooks to the top Adrian Bunk
@ 2007-12-11 22:44 ` Michael Ellerman
  2007-12-11 23:00   ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2007-12-11 22:44 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: gregkh, linux-kernel, linux-pci

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

On Tue, 2007-12-11 at 23:19 +0100, Adrian Bunk wrote:
> This patch fixes the following problem present with older gcc versions:
> 
> <--  snip  -->
> 
> ...
>   CC      drivers/pci/msi.o
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:692: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:704: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:724: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
> ...
> 
> <--  snip  -->

They're declared in <linux/msi.h>, I don't see what it's problem is.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [2.6 patch] drivers/pci/msi.c: move arch hooks to the top
  2007-12-11 22:44 ` Michael Ellerman
@ 2007-12-11 23:00   ` Adrian Bunk
  2007-12-11 23:37     ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2007-12-11 23:00 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: gregkh, linux-kernel, linux-pci

On Wed, Dec 12, 2007 at 09:44:10AM +1100, Michael Ellerman wrote:
> On Tue, 2007-12-11 at 23:19 +0100, Adrian Bunk wrote:
> > This patch fixes the following problem present with older gcc versions:
> > 
> > <--  snip  -->
> > 
> > ...
> >   CC      drivers/pci/msi.o
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:692: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:704: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:724: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
> > ...
> > 
> > <--  snip  -->
> 
> They're declared in <linux/msi.h>, I don't see what it's problem is.

Older gcc versions don't like that they cannot see that they are weak 
functions at the time when they are used.

I'm not sure whether the generated code does the right thing, but even 
if it does rearranging the code doesn't do any harm here.

> cheers

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.6 patch] drivers/pci/msi.c: move arch hooks to the top
  2007-12-11 23:00   ` Adrian Bunk
@ 2007-12-11 23:37     ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2007-12-11 23:37 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: gregkh, linux-kernel, linux-pci

[-- Attachment #1: Type: text/plain, Size: 1510 bytes --]


On Wed, 2007-12-12 at 00:00 +0100, Adrian Bunk wrote:
> On Wed, Dec 12, 2007 at 09:44:10AM +1100, Michael Ellerman wrote:
> > On Tue, 2007-12-11 at 23:19 +0100, Adrian Bunk wrote:
> > > This patch fixes the following problem present with older gcc versions:
> > > 
> > > <--  snip  -->
> > > 
> > > ...
> > >   CC      drivers/pci/msi.o
> > > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:692: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
> > > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:704: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
> > > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:724: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
> > > ...
> > > 
> > > <--  snip  -->
> > 
> > They're declared in <linux/msi.h>, I don't see what it's problem is.
> 
> Older gcc versions don't like that they cannot see that they are weak 
> functions at the time when they are used.
> 
> I'm not sure whether the generated code does the right thing, but even 
> if it does rearranging the code doesn't do any harm here.

Sure.

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-12-11 23:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-11 22:19 [2.6 patch] drivers/pci/msi.c: move arch hooks to the top Adrian Bunk
2007-12-11 22:44 ` Michael Ellerman
2007-12-11 23:00   ` Adrian Bunk
2007-12-11 23:37     ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).