]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: aspeed_udc: cleanup loop in ast_dma_descriptor_setup()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 18 Jun 2022 08:54:20 +0000 (11:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jun 2022 14:30:31 +0000 (16:30 +0200)
commitf49fd2de5b68d9adbb287662ac101cdb18f6fb48
treedfaebbea6e79f7a82571c3de04c0d30ac99a0728
parent4dd8f4e0575df827bf62b7b199c0cbe1fc376306
usb: gadget: aspeed_udc: cleanup loop in ast_dma_descriptor_setup()

The "chunk >= 0" condition does not work because count is a u32.
Also, really we shouldn't enter the loop when "chunk" is zero.

Once that condition is fixed then there is no need for the "last"
variable.  I reversed the "if (chunk <= ep->chunk_max)" as well.
The new loop is much simpler.

Fixes: 774a4c6069cf ("usb: gadget: add Aspeed ast2600 udc driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yq2SvM2bbrtSd1H9@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/aspeed_udc.c