Commit 5b5ec04f authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

usb: gadget: goku_udc: Fix mask and set operation on variable master



The variable master is being masked with ~MST_R_BITS however this
masked value is never used, the following updates to master are
assignments. I suspect the original intention was to mask out the
MST_R_BITS and then bit-wise or in the appropriate read bits rather
than perform an assignment. Fix this by using the |= operator rather
than a straight assignment.

Note that this code is pre-git history, so I can't find a sha for
it.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20210910163131.94796-1-colin.king@canonical.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6854ccc4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -553,12 +553,12 @@ static int start_dma(struct goku_ep *ep, struct goku_request *req)

		master &= ~MST_R_BITS;
		if (unlikely(req->req.length == 0))
			master = MST_RD_ENA | MST_RD_EOPB;
			master |= MST_RD_ENA | MST_RD_EOPB;
		else if ((req->req.length % ep->ep.maxpacket) != 0
					|| req->req.zero)
			master = MST_RD_ENA | MST_EOPB_ENA;
			master |= MST_RD_ENA | MST_EOPB_ENA;
		else
			master = MST_RD_ENA | MST_EOPB_DIS;
			master |= MST_RD_ENA | MST_EOPB_DIS;

		ep->dev->int_enable |= INT_MSTRDEND;