Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -163,12 +163,14 @@ MGR_ATTR static int icplb_miss(int cpu)
		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 @@ MGR_ATTR static int dcplb_miss(int cpu)
		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;