Skip to contentSkip to conversation

checks: Fix bus-range check

PATCH Applied Thierry Reding 2 participants 2 messages Jun 29, 2021 – Jun 30, 2021 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checks: Fix bus-range check

From: Thierry Reding <[email protected]>

The upper limit of the bus-range is specified by the second cell of the bus-range property.

---
 checks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checks.c +1 -1
index e2690e90f90c..fb3fc9cda4b1 100644
@@ -892,7 +892,7 @@ static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struc
 	} else {
 		cells = (cell_t *)prop->val.val;
 		min_bus = fdt32_to_cpu(cells[0]);
-		max_bus = fdt32_to_cpu(cells[0]);
+		max_bus = fdt32_to_cpu(cells[1]);
 	}
 	if ((bus_num < min_bus) || (bus_num > max_bus))
 		FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)",
Signature · 1 line
2.32.0

A message that is not in the archive (sent off-list or not yet received): 20210629114304.2451114-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Applied
#2 lore raw
Quoted 6 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The upper limit of the bus-range is specified by the second cell of the bus-range property.

Applied, thanks.

Quoted 17 lines
---
 checks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
checks.c +1 -1
index e2690e90f90c..fb3fc9cda4b1 100644
@@ -892,7 +892,7 @@ static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struc
 	} else {
 		cells = (cell_t *)prop->val.val;
 		min_bus = fdt32_to_cpu(cells[0]);
-		max_bus = fdt32_to_cpu(cells[0]);
+		max_bus = fdt32_to_cpu(cells[1]);
 	}
 	if ((bus_num < min_bus) || (bus_num > max_bus))
 		FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)",
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson