lkml.org 
[lkml]   [2016]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 05/24] ste_dma40: Improve a size determination in d40_of_probe()
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sat, 17 Sep 2016 08:28:05 +0200

    Replace the specification of a data structure by a pointer dereference
    as the parameter for the operator "sizeof" to make the corresponding size
    determination a bit safer according to the Linux coding style convention.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    drivers/dma/ste_dma40.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
    index 220129e..57d87a8 100644
    --- a/drivers/dma/ste_dma40.c
    +++ b/drivers/dma/ste_dma40.c
    @@ -3487,9 +3487,7 @@ static int __init d40_of_probe(struct platform_device *pdev,
    int num_phy = 0, num_memcpy = 0, num_disabled = 0;
    const __be32 *list;

    - pdata = devm_kzalloc(&pdev->dev,
    - sizeof(struct stedma40_platform_data),
    - GFP_KERNEL);
    + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
    if (!pdata)
    return -ENOMEM;

    --
    2.10.0
    \
     
     \ /
      Last update: 2016-09-17 17:12    [W:4.030 / U:0.776 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site