Commit b82b576b authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Grant Likely

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 77b67063
...@@ -346,17 +346,14 @@ static void bitbang_work(struct work_struct *work) ...@@ -346,17 +346,14 @@ static void bitbang_work(struct work_struct *work)
if (t->delay_usecs) if (t->delay_usecs)
udelay(t->delay_usecs); udelay(t->delay_usecs);
if (!cs_change) if (cs_change && !list_is_last(&t->transfer_list, &m->transfers)) {
continue; /* sometimes a short mid-message deselect of the chip
if (t->transfer_list.next == &m->transfers) * may be needed to terminate a mode or command
break; */
ndelay(nsecs);
/* sometimes a short mid-message deselect of the chip bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
* may be needed to terminate a mode or command ndelay(nsecs);
*/ }
ndelay(nsecs);
bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
ndelay(nsecs);
} }
m->status = status; m->status = status;
......
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