Przeglądaj źródła

[isa] Avoid spurious compiler warning on gcc 4.7

gcc 4.7 produces a spurious warning about an array subscript being out
of bounds.  Use a pointer dereference instead of an array lookup to
inhibit this spurious warning.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 lat temu
rodzic
commit
a87c0c4f0f
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3
    3
      src/drivers/bus/isa.c

+ 3
- 3
src/drivers/bus/isa.c Wyświetl plik

@@ -46,9 +46,9 @@ static isa_probe_addr_t isa_extra_probe_addrs[] = {
46 46
 #endif
47 47
 
48 48
 #define ISA_IOADDR( driver, ioidx )					  \
49
-	( ( (ioidx) < 0 ) ?						  \
50
-	  isa_extra_probe_addrs[ (ioidx) + ISA_EXTRA_PROBE_ADDR_COUNT ] : \
51
-	  (driver)->probe_addrs[(ioidx)] )
49
+	( ( (ioidx) >= 0 ) ?						  \
50
+	  (driver)->probe_addrs[(ioidx)] :				  \
51
+	  *( isa_extra_probe_addrs + (ioidx) + ISA_EXTRA_PROBE_ADDR_COUNT ) )
52 52
 
53 53
 static void isabus_remove ( struct root_device *rootdev );
54 54
 

Ładowanie…
Anuluj
Zapisz