* [PATCH v2] usb: host: tegra: remove pointless NULL check in tegra_ehci_remove()
@ 2012-11-08 8:27 Wei Yongjun
[not found] ` <CAPgLHd9cJmoJWUAXr-Hpjfar=WH3FKcyDMK_ar3EXeUgi9aTEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-11-08 8:27 UTC (permalink / raw)
To: stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
Test for tegra and hcd in tegra_ehci_remove() look like potential
NULL pointer dereference, but in fact those tests are not needed,
so remove these pointless tests entirely.
Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
v1 -> v2: remove those tests entirely
---
drivers/usb/host/ehci-tegra.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 6223d175..40daeaa 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -778,9 +778,6 @@ static int tegra_ehci_remove(struct platform_device *pdev)
struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
- if (tegra == NULL || hcd == NULL)
- return -EINVAL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] usb: host: tegra: remove pointless NULL check in tegra_ehci_remove()
[not found] ` <CAPgLHd9cJmoJWUAXr-Hpjfar=WH3FKcyDMK_ar3EXeUgi9aTEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-11-08 16:05 ` Alan Stern
0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2012-11-08 16:05 UTC (permalink / raw)
To: Wei Yongjun
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
On Thu, 8 Nov 2012, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>
> Test for tegra and hcd in tegra_ehci_remove() look like potential
> NULL pointer dereference, but in fact those tests are not needed,
> so remove these pointless tests entirely.
>
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> ---
> v1 -> v2: remove those tests entirely
> ---
> drivers/usb/host/ehci-tegra.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
> index 6223d175..40daeaa 100644
> --- a/drivers/usb/host/ehci-tegra.c
> +++ b/drivers/usb/host/ehci-tegra.c
> @@ -778,9 +778,6 @@ static int tegra_ehci_remove(struct platform_device *pdev)
> struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
> struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
>
> - if (tegra == NULL || hcd == NULL)
> - return -EINVAL;
> -
> pm_runtime_get_sync(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> pm_runtime_put_noidle(&pdev->dev);
Acked-by: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-08 16:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 8:27 [PATCH v2] usb: host: tegra: remove pointless NULL check in tegra_ehci_remove() Wei Yongjun
[not found] ` <CAPgLHd9cJmoJWUAXr-Hpjfar=WH3FKcyDMK_ar3EXeUgi9aTEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-08 16:05 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).