]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: dwc3: gadget: Remove redundant assignment to pointer trb
authorColin Ian King <colin.i.king@gmail.com>
Wed, 7 Feb 2024 12:03:19 +0000 (12:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2024 15:43:27 +0000 (16:43 +0100)
The pointer trb is being assigned a value that is not being
read afterwards, it is being re-assigned later inside a for_each_sg
loop. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/usb/dwc3/gadget.c:3432:19: warning: Value stored to 'trb'
during its initialization is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20240207120319.2445123-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c

index 76d6011c8ebdb188e3f7288b3a0ab90c878007b8..3a8c4c28573e2297d6e01271da444f9685b668f6 100644 (file)
@@ -3416,7 +3416,7 @@ static int dwc3_gadget_ep_reclaim_trb_sg(struct dwc3_ep *dep,
                struct dwc3_request *req, const struct dwc3_event_depevt *event,
                int status)
 {
-       struct dwc3_trb *trb = &dep->trb_pool[dep->trb_dequeue];
+       struct dwc3_trb *trb;
        struct scatterlist *sg = req->sg;
        struct scatterlist *s;
        unsigned int num_queued = req->num_queued_sgs;