浏览代码

[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 年前
父节点
当前提交
a87c0c4f0f
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      src/drivers/bus/isa.c

+ 3
- 3
src/drivers/bus/isa.c 查看文件

@@ -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
 

正在加载...
取消
保存