diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2010-10-22 09:48:43 +0200 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-10-22 09:48:43 +0200 |
commit | b4627321e18582dcbdeb45d77df29d3177107c65 (patch) | |
tree | f494dae7f39f219d73aa9752dfd3844293d65f50 /block/blk-map.c | |
parent | block: Turn bvec_k{un,}map_irq() into static inline functions (diff) | |
download | linux-b4627321e18582dcbdeb45d77df29d3177107c65.tar.xz linux-b4627321e18582dcbdeb45d77df29d3177107c65.zip |
cfq-iosched: Fix a gcc 4.5 warning and put some comments
- Andi encountedred following warning with gcc 4.5
linux/block/cfq-iosched.c: In function ‘cfq_dispatch_requests’:
linux/block/cfq-iosched.c:2156:3: warning: array subscript is above array
bounds
- Warning happens due to following code.
slice = group_slice * count /
max_t(unsigned, cfqg->busy_queues_avg[cfqd->serving_prio],
cfq_group_busy_queues_wl(cfqd->serving_prio, cfqd, cfqg));
gcc is complaining about cfqg->busy_queues_avg[] being indexed by CFQ
prio classes (RT, BE and IDLE) while the array size is only 2.
- At run time, we never access cfqg->busy_queues_avg[IDLE] and return from
function before this code hits.
- To fix warning increase the array size though it will remain unused. This
patch also puts some comments to clarify some of the confusions.
- I have taken Jens's patch and modified it a bit.
- Compile tested with gcc 4.4 and boot tested. I don't have gcc 4.5
running, Andi can you please test it with gcc 4.5 to make sure it
worked.
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-map.c')
0 files changed, 0 insertions, 0 deletions