mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 20:50:53 +07:00
spi/bitbang: (cosmetic) simplify list manipulation
Use a proper list iterator instead of an open-coded loop and remove a superfluous list head initialisation. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
parent
b82b576bc7
commit
edba9bf99d
@ -260,11 +260,11 @@ static void bitbang_work(struct work_struct *work)
|
||||
struct spi_bitbang *bitbang =
|
||||
container_of(work, struct spi_bitbang, work);
|
||||
unsigned long flags;
|
||||
struct spi_message *m, *_m;
|
||||
|
||||
spin_lock_irqsave(&bitbang->lock, flags);
|
||||
bitbang->busy = 1;
|
||||
while (!list_empty(&bitbang->queue)) {
|
||||
struct spi_message *m;
|
||||
list_for_each_entry_safe(m, _m, &bitbang->queue, queue) {
|
||||
struct spi_device *spi;
|
||||
unsigned nsecs;
|
||||
struct spi_transfer *t = NULL;
|
||||
@ -273,9 +273,7 @@ static void bitbang_work(struct work_struct *work)
|
||||
int status;
|
||||
int do_setup = -1;
|
||||
|
||||
m = container_of(bitbang->queue.next, struct spi_message,
|
||||
queue);
|
||||
list_del_init(&m->queue);
|
||||
list_del(&m->queue);
|
||||
spin_unlock_irqrestore(&bitbang->lock, flags);
|
||||
|
||||
/* FIXME this is made-up ... the correct value is known to
|
||||
|
Loading…
Reference in New Issue
Block a user