lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.14 084/238] usb: phy: tegra: Avoid use of sizeof(void)
    Date
    3.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Thierry Reding <treding@nvidia.com>

    commit 9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8 upstream.

    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)
    Signed-off-by: Thierry Reding <treding@nvidia.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/usb/phy/phy-tegra-usb.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/drivers/usb/phy/phy-tegra-usb.c
    +++ b/drivers/usb/phy/phy-tegra-usb.c
    @@ -881,8 +881,8 @@ static int utmi_phy_probe(struct tegra_u
    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");



    \
     
     \ /
      Last update: 2014-10-04 02:21    [W:3.866 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site