Title: [5860] trunk/arch/blackfin/kernel/cplb-nompu/cplbmgr.c: use a do...while loop rather than a for loop to get slightly better optimization and to avoid gcc "may be used uninitialized" warnings ...
- Revision
- 5860
- Author
- vapier
- Date
- 2008-12-12 14:53:38 -0600 (Fri, 12 Dec 2008)
Log Message
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
Modified Paths
Diff
Modified: trunk/arch/blackfin/kernel/cplb-nompu/cplbmgr.c (5859 => 5860)
--- trunk/arch/blackfin/kernel/cplb-nompu/cplbmgr.c 2008-12-12 20:42:27 UTC (rev 5859)
+++ trunk/arch/blackfin/kernel/cplb-nompu/cplbmgr.c 2008-12-12 20:53:38 UTC (rev 5860)
@@ -163,12 +163,14 @@
nr_icplb_supv_miss[cpu]++;
base = 0;
- for (idx = 0; idx < icplb_nr_bounds; idx++) {
+ idx = 0;
+ do {
eaddr = icplb_bounds[idx].eaddr;
if (addr < eaddr)
break;
base = eaddr;
- }
+ } while (++idx < icplb_nr_bounds);
+
if (unlikely(idx == icplb_nr_bounds))
return CPLB_NO_ADDR_MATCH;
@@ -208,12 +210,14 @@
nr_dcplb_supv_miss[cpu]++;
base = 0;
- for (idx = 0; idx < dcplb_nr_bounds; idx++) {
+ idx = 0;
+ do {
eaddr = dcplb_bounds[idx].eaddr;
if (addr < eaddr)
break;
base = eaddr;
- }
+ } while (++idx < dcplb_nr_bounds);
+
if (unlikely(idx == dcplb_nr_bounds))
return CPLB_NO_ADDR_MATCH;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits