From: Thierry Reding Date: Mon, 21 Jul 2014 11:37:37 +0000 (+0200) Subject: usb: phy: tegra: Avoid use of sizeof(void) X-Git-Tag: v3.17-rc5~16^2^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8;p=platform%2Fkernel%2Flinux-exynos.git usb: phy: tegra: Avoid use of sizeof(void) The PHY configuration is stored in an opaque "config" field, but when allocating the structure, its proper size needs to be known. In the case of UTMI, the proper structure is tegra_utmip_config of which a local variable already exists, so we can use that to obtain the size from. Fixes the following warning from the sparse checker: drivers/usb/phy/phy-tegra-usb.c:882:17: warning: expression using sizeof(void) Fixes: 81d5dfe6d8b3 (usb: phy: tegra: Read UTMIP parameters from device tree) Cc: stable@vger.kernel.org Signed-off-by: Thierry Reding Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index 13b4fa2..886f180 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -878,8 +878,8 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy, return -ENOMEM; } - tegra_phy->config = devm_kzalloc(&pdev->dev, - sizeof(*tegra_phy->config), GFP_KERNEL); + tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config), + GFP_KERNEL); if (!tegra_phy->config) { dev_err(&pdev->dev, "unable to allocate memory for USB UTMIP config\n");