Skip to contentSkip to conversation

arch/frv/mb93090-mb00/pci-frv.c: fix build warning

PATCH New [email protected] 1 participant 1 message Feb 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 93/124 arch/frv/mb93090-mb00/pci-frv.c: fix build warning

From: Sudip Mukherjee <[email protected]>
Subject: arch/frv/mb93090-mb00/pci-frv.c: fix build warning

The build of frv defconfig gives warning:

arch/frv/mb93090-mb00/pci-frv.c:176:5: warning:
ignoring return value of 'pci_assign_resource',
declared with attribute warn_unused_result

Just print an error message to silence the warning. We can not do much here on error.

---

 arch/frv/mb93090-mb00/pci-frv.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
arch/frv/mb93090-mb00/pci-frv.c renamed from arch/frv/mb93090-mb00/pci-frv.c~frv-pci-frv-fix-build-warning +8 -3
diff -puN arch/frv/mb93090-mb00/pci-frv.c~frv-pci-frv-fix-build-warning arch/frv/mb93090-mb00/pci-frv.c
@@ -147,7 +147,7 @@ static void __init pcibios_allocate_reso
 static void __init pcibios_assign_resources(void)
 {
 	struct pci_dev *dev = NULL;
-	int idx;
+	int idx, err;
 	struct resource *r;
 
 	for_each_pci_dev(dev) {
@@ -172,8 +172,13 @@ static void __init pcibios_assign_resour
 			 *  the BIOS forgot to do so or because we have decided the old
 			 *  address was unusable for some reason.
 			 */
-			if (!r->start && r->end)
-				pci_assign_resource(dev, idx);
+			if (!r->start && r->end) {
+				err = pci_assign_resource(dev, idx);
+				if (err)
+					dev_err(&dev->dev,
+						"Failed to assign new address to %d\n",
+						idx);
+			}
 		}
 	}
 }

_