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

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

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
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -346,11 +346,7 @@ 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;

			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
				 */
@@ -358,6 +354,7 @@ static void bitbang_work(struct work_struct *work)
				bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
				ndelay(nsecs);
			}
		}

		m->status = status;
		m->complete(m->context);