Skip to content

Commit

Permalink
usb: phy: tegra: Avoid use of sizeof(void)
Browse files Browse the repository at this point in the history
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: 81d5dfe (usb: phy: tegra: Read UTMIP parameters from device tree)
Cc: stable@vger.kernel.org
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Thierry Reding authored and Felipe Balbi committed Sep 3, 2014
1 parent 36687e3 commit 9ce9ec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/phy/phy-tegra-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 9ce9ec9

Please sign in to comment.