Skip to contentSkip to conversation

powerpc: Fix warning in pci_64.c

PATCH In review Benjamin Herrenschmidt 4 participants 5 messages May 15, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix warning in pci_64.c

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

 arch/powerpc/kernel/pci_64.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/pci_64.c +2 -1
Index: linux-cell/arch/powerpc/kernel/pci_64.c
===================================================================
@@ -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
#1 lore raw

arch/powerpc/kernel/pci_64.c static DEVICE_ATTR(devspec, S_IRUGO, pci · line 882

Quoted 6 lines · On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt…

void pcibios_add_platform_entries(struct pci_dev *pdev) {

arch/powerpc/kernel/pci_64.c +2 -1
-	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 [email protected]
http://www.canb.auug.org.au/~sfr/

#2 lore raw
Quoted 10 lines · Stephen Rothwell

arch/powerpc/kernel/pci_64.c static DEVICE_ATTR(devspec, S_IRUGO, pci · line 882

Quoted 6 lines · On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt…

void pcibios_add_platform_entries(struct pci_dev *pdev) {

arch/powerpc/kernel/pci_64.c +2 -1
-	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

Signature · 8 lines
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
#3 lore raw
In reply to Stephen Rothwell
Quoted 10 lines · Stephen Rothwell

arch/powerpc/kernel/pci_64.c static DEVICE_ATTR(devspec, S_IRUGO, pci · line 882

Quoted 6 lines · On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt…

void pcibios_add_platform_entries(struct pci_dev *pdev) {

arch/powerpc/kernel/pci_64.c +2 -1
-	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.

#4 lore raw
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 10 lines · Stephen Rothwell

arch/powerpc/kernel/pci_64.c static DEVICE_ATTR(devspec, S_IRUGO, pci · line 882

Quoted 6 lines · On Tue, 15 May 2007 14:16:35 +1000 Benjamin Herrenschmidt…

void pcibios_add_platform_entries(struct pci_dev *pdev) {

arch/powerpc/kernel/pci_64.c +2 -1
-	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 ...

Quoted 2 lines

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