dect
/
linux-2.6
Archived
13
0
Fork 0

spi/bitbang: avoid needless loop flow manipulations

This patch makes a loop look cleaner by replacing a "break" and a "continue"
in its body by a single "if".

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Guennadi Liakhovetski 2012-05-21 13:25:13 +02:00 committed by Grant Likely
parent 77b67063bb
commit b82b576bc7
1 changed files with 8 additions and 11 deletions

View File

@ -346,17 +346,14 @@ static void bitbang_work(struct work_struct *work)
if (t->delay_usecs)
udelay(t->delay_usecs);
if (!cs_change)
continue;
if (t->transfer_list.next == &m->transfers)
break;
/* sometimes a short mid-message deselect of the chip
* may be needed to terminate a mode or command
*/
ndelay(nsecs);
bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
ndelay(nsecs);
if (cs_change && !list_is_last(&t->transfer_list, &m->transfers)) {
/* sometimes a short mid-message deselect of the chip
* may be needed to terminate a mode or command
*/
ndelay(nsecs);
bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
ndelay(nsecs);
}
}
m->status = status;