Commit d04dfc4c authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu

Blackfin arch: cplb mananger: use a do...while loop rather than a for loop

use a do...while loop rather than a for loop to get slightly better
optimization and to avoid gcc "may be used uninitialized" warnings ...
we know that the [id]cplb_nr_bounds variables will never be 0, so this
is OK
Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent bf324cb8
...@@ -163,12 +163,14 @@ MGR_ATTR static int icplb_miss(int cpu) ...@@ -163,12 +163,14 @@ MGR_ATTR static int icplb_miss(int cpu)
nr_icplb_supv_miss[cpu]++; nr_icplb_supv_miss[cpu]++;
base = 0; base = 0;
for (idx = 0; idx < icplb_nr_bounds; idx++) { idx = 0;
do {
eaddr = icplb_bounds[idx].eaddr; eaddr = icplb_bounds[idx].eaddr;
if (addr < eaddr) if (addr < eaddr)
break; break;
base = eaddr; base = eaddr;
} } while (++idx < icplb_nr_bounds);
if (unlikely(idx == icplb_nr_bounds)) if (unlikely(idx == icplb_nr_bounds))
return CPLB_NO_ADDR_MATCH; return CPLB_NO_ADDR_MATCH;
...@@ -208,12 +210,14 @@ MGR_ATTR static int dcplb_miss(int cpu) ...@@ -208,12 +210,14 @@ MGR_ATTR static int dcplb_miss(int cpu)
nr_dcplb_supv_miss[cpu]++; nr_dcplb_supv_miss[cpu]++;
base = 0; base = 0;
for (idx = 0; idx < dcplb_nr_bounds; idx++) { idx = 0;
do {
eaddr = dcplb_bounds[idx].eaddr; eaddr = dcplb_bounds[idx].eaddr;
if (addr < eaddr) if (addr < eaddr)
break; break;
base = eaddr; base = eaddr;
} } while (++idx < dcplb_nr_bounds);
if (unlikely(idx == dcplb_nr_bounds)) if (unlikely(idx == dcplb_nr_bounds))
return CPLB_NO_ADDR_MATCH; return CPLB_NO_ADDR_MATCH;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment