From 440e547dd0f812c3082f81192e5c965e61c64dfa Mon Sep 17 00:00:00 2001 From: Souptick Joarder Date: Sun, 25 Apr 2021 13:46:05 +0530 Subject: usb: cdns3: Corrected comment to align with kernel-doc comment Minor update in comment. Signed-off-by: Souptick Joarder Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/1619338565-4574-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Peter Chen --- drivers/usb/cdns3/cdns3-gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/cdns3') diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 9b1bd417cec0..21f026c6006d 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -484,7 +484,7 @@ static void __cdns3_descmiss_copy_data(struct usb_request *request, } /** - * cdns3_wa2_descmiss_copy_data copy data from internal requests to + * cdns3_wa2_descmiss_copy_data - copy data from internal requests to * request queued by class driver. * @priv_ep: extended endpoint object * @request: request object -- cgit v1.2.3 From 4ae08bc23e1b29894b1af34990409a454cccf242 Mon Sep 17 00:00:00 2001 From: Pawel Laszczak Date: Wed, 5 May 2021 07:58:54 +0200 Subject: usb: cdnsp: Useless condition has been removed This code generates a Smatch warning: drivers/usb/cdns3/cdnsp-mem.c:1085 cdnsp_mem_cleanup() warn: variable dereferenced before check 'pdev->dcbaa' (see line 1067) The unchecked dereference happens inside the function when we call: cdnsp_free_priv_device(pdev); But fortunately, the "pdev->dcbaa" pointer can never be NULL so it does not lead to a runtime issue. We can just remove the NULL check which silences the warning and makes the code consistent. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20210505055854.40240-1-pawell@gli-login.cadence.com Signed-off-by: Peter Chen --- drivers/usb/cdns3/cdnsp-mem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/usb/cdns3') diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c index 5d4c4bfe15b7..a47948a1623f 100644 --- a/drivers/usb/cdns3/cdnsp-mem.c +++ b/drivers/usb/cdns3/cdnsp-mem.c @@ -1082,9 +1082,8 @@ void cdnsp_mem_cleanup(struct cdnsp_device *pdev) dma_pool_destroy(pdev->device_pool); pdev->device_pool = NULL; - if (pdev->dcbaa) - dma_free_coherent(dev, sizeof(*pdev->dcbaa), - pdev->dcbaa, pdev->dcbaa->dma); + dma_free_coherent(dev, sizeof(*pdev->dcbaa), + pdev->dcbaa, pdev->dcbaa->dma); pdev->dcbaa = NULL; -- cgit v1.2.3 From 33e99b65a13495247b4e35ec97ab82696c0fc6e0 Mon Sep 17 00:00:00 2001 From: Baokun Li Date: Wed, 9 Jun 2021 15:27:20 +0800 Subject: usb: cdns3: cdns3-gadget: Use list_move_tail instead of list_del/list_add_tail Using list_move_tail() instead of list_del() + list_add_tail(). Reported-by: Hulk Robot Signed-off-by: Baokun Li Link: https://lore.kernel.org/r/20210609072720.1358527-1-libaokun1@huawei.com Signed-off-by: Peter Chen --- drivers/usb/cdns3/cdns3-gadget.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/usb/cdns3') diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 21f026c6006d..2341cf84fe2d 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -430,9 +430,7 @@ static int cdns3_start_all_request(struct cdns3_device *priv_dev, if (ret) return ret; - list_del(&request->list); - list_add_tail(&request->list, - &priv_ep->pending_req_list); + list_move_tail(&request->list, &priv_ep->pending_req_list); if (request->stream_id != 0 || (priv_ep->flags & EP_TDLCHK_EN)) break; } -- cgit v1.2.3