提交 b82b576b 编写于 作者: G Guennadi Liakhovetski 提交者: 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: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 77b67063
...@@ -346,11 +346,7 @@ static void bitbang_work(struct work_struct *work) ...@@ -346,11 +346,7 @@ 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;
if (t->transfer_list.next == &m->transfers)
break;
/* sometimes a short mid-message deselect of the chip /* sometimes a short mid-message deselect of the chip
* may be needed to terminate a mode or command * may be needed to terminate a mode or command
*/ */
...@@ -358,6 +354,7 @@ static void bitbang_work(struct work_struct *work) ...@@ -358,6 +354,7 @@ static void bitbang_work(struct work_struct *work)
bitbang->chipselect(spi, BITBANG_CS_INACTIVE); bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
ndelay(nsecs); ndelay(nsecs);
} }
}
m->status = status; m->status = status;
m->complete(m->context); m->complete(m->context);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册