Skip to contentSkip to conversation

replace logical- by bit-and in pci_process_ISA_OF_ranges(), arch/powerpc/kernel/isa-bridge.c

PATCH Superseded Roel Kluin 1 participant 1 message Jan 28, 2008 PowerPC

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 replace logical- by bit-and in pci_process_ISA_OF_ranges(), arch/powerpc/kernel/isa-bridge.c

in arch/powerpc/kernel/isa-bridge.c:
41:#define ISA_SPACE_MASK 0x1
42:#define ISA_SPACE_IO 0x1
...
54: struct isa_address {
55: u32 a_hi;
...
65: const struct isa_range *range;

83: if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
...
89: if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)

shouldn't these be a single &?
then consider the untested patch below.
--
replace logical "&&" by bit "&" for ISA_SPACE_MASK

---

arch/powerpc/kernel/isa-bridge.c +2 -2
index f0f49d1..406a9e6 100644
@@ -80,13 +80,13 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
 	 *			(size depending on dev->n_addr_cells)
 	 *   cell 5:		the size of the range
 	 */
-	if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
+	if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO) {
 		range++;
 		rlen -= sizeof(struct isa_range);
 		if (rlen < sizeof(struct isa_range))
 			goto inval_range;
 	}
-	if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)
+	if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO)
 		goto inval_range;
 
 	isa_addr = range->isa_addr.a_lo;