Message ID | 20180318130101.19945-1-xypron.glpk@gmx.de |
---|---|
State | Accepted |
Delegated to: | Bin Meng |
Headers | show |
Series | [U-Boot,1/1] usb: xhci-ring: remove superfluous assignment | expand |
On Sun, Mar 18, 2018 at 9:01 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: > No need to set a variable to NULL if the next use is an assignment. > Do not define variables in the middle of nowhere. > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> > --- > drivers/usb/host/xhci-ring.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
On Mon, Mar 19, 2018 at 11:00 AM, Bin Meng <bmeng.cn@gmail.com> wrote: > On Sun, Mar 18, 2018 at 9:01 PM, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: >> No need to set a variable to NULL if the next use is an assignment. >> Do not define variables in the middle of nowhere. >> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> >> --- >> drivers/usb/host/xhci-ring.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> > > Reviewed-by: Bin Meng <bmeng.cn@gmail.com> applied to u-boot-usb/topic-xhci, thanks!
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 7599c9183a..76580a1905 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -762,6 +762,7 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, struct xhci_virt_device *virt_dev = ctrl->devs[slot_id]; struct xhci_ring *ep_ring; union xhci_trb *event; + struct xhci_ep_ctx *ep_ctx; debug("req=%u (%#x), type=%u (%#x), value=%u (%#x), index=%u\n", req->request, req->request, @@ -786,7 +787,6 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe, xhci_inval_cache((uintptr_t)virt_dev->out_ctx->bytes, virt_dev->out_ctx->size); - struct xhci_ep_ctx *ep_ctx = NULL; ep_ctx = xhci_get_ep_ctx(ctrl, virt_dev->out_ctx, ep_index); /* 1 TRB for setup, 1 for status */
No need to set a variable to NULL if the next use is an assignment. Do not define variables in the middle of nowhere. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> --- drivers/usb/host/xhci-ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)