[PATCH] powerpc: Fix warning in pci_64.c

STALE7053d

5 messages, 4 authors, 2007-05-15 · open the first message on its own page

[PATCH] powerpc: Fix warning in pci_64.c

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-05-15 04:16:35

Fix a warning due to unused result from device_create_file
in arch/powerpc/kernel/pci_64.c

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

 arch/powerpc/kernel/pci_64.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-cell/arch/powerpc/kernel/pci_64.c
===================================================================
--- linux-cell.orig/arch/powerpc/kernel/pci_64.c	2007-05-15 14:14:15.000000000 +1000
+++ linux-cell/arch/powerpc/kernel/pci_64.c	2007-05-15 14:14:54.000000000 +1000
@@ -878,7 +878,8 @@ static DEVICE_ATTR(devspec, S_IRUGO, pci
 
 void pcibios_add_platform_entries(struct pci_dev *pdev)
 {
-	device_create_file(&pdev->dev, &dev_attr_devspec);
+	int rc = device_create_file(&pdev->dev, &dev_attr_devspec);
+	WARN_ON(rc != 0);
 }
 
 #define ISA_SPACE_MASK 0x1

Re: [PATCH] powerpc: Fix warning in pci_64.c

From: Stephen Rothwell <hidden>
Date: 2007-05-15 04:30:53

On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
 void pcibios_add_platform_entries(struct pci_dev *pdev)
 {
-	device_create_file(&pdev->dev, &dev_attr_devspec);
+	int rc = device_create_file(&pdev->dev, &dev_attr_devspec);
+	WARN_ON(rc != 0);
If we really don't care if the file is not created, then it is probably
worth a comment as to why ...

--
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Re: [PATCH] powerpc: Fix warning in pci_64.c

From: Michael Ellerman <hidden>
Date: 2007-05-15 06:03:09

On Tue, 2007-05-15 at 14:30 +1000, Stephen Rothwell wrote:
On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
quoted
 void pcibios_add_platform_entries(struct pci_dev *pdev)
 {
-	device_create_file(&pdev->dev, &dev_attr_devspec);
+	int rc = device_create_file(&pdev->dev, &dev_attr_devspec);
+	WARN_ON(rc != 0);
If we really don't care if the file is not created, then it is probably
worth a comment as to why ...
Greg already has a patch from me to fix that.

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

Re: [PATCH] powerpc: Fix warning in pci_64.c

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-05-15 06:03:42

On Tue, 2007-05-15 at 14:30 +1000, Stephen Rothwell wrote:
On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
quoted
 void pcibios_add_platform_entries(struct pci_dev *pdev)
 {
-	device_create_file(&pdev->dev, &dev_attr_devspec);
+	int rc = device_create_file(&pdev->dev, &dev_attr_devspec);
+	WARN_ON(rc != 0);
If we really don't care if the file is not created, then it is probably
worth a comment as to why ...
Well, if it's not created, then something is badly wrong thus a
WARN_ON ... Do you think I should do more ?

Ben.

Re: [PATCH] powerpc: Fix warning in pci_64.c

From: Kumar Gala <hidden>
Date: 2007-05-15 08:23:37

On May 15, 2007, at 1:03 AM, Benjamin Herrenschmidt wrote:
On Tue, 2007-05-15 at 14:30 +1000, Stephen Rothwell wrote:
quoted
On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt  
[off-list ref] wrote:
quoted
 void pcibios_add_platform_entries(struct pci_dev *pdev)
 {
-	device_create_file(&pdev->dev, &dev_attr_devspec);
+	int rc = device_create_file(&pdev->dev, &dev_attr_devspec);
+	WARN_ON(rc != 0);
If we really don't care if the file is not created, then it is  
probably
worth a comment as to why ...
Well, if it's not created, then something is badly wrong thus a
WARN_ON ... Do you think I should do more ?
Yes, fix the pci_32.c version of this as well (if it hasn't been) :)

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help