lkml.org 
[lkml]   [2017]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 2/4] axonram: Improve a size determination in axon_ram_probe()
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Thu, 3 Aug 2017 20:00:16 +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>
    ---
    arch/powerpc/sysdev/axonram.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
    index b82d1b023a15..bf1506ec2ca4 100644
    --- a/arch/powerpc/sysdev/axonram.c
    +++ b/arch/powerpc/sysdev/axonram.c
    @@ -191,7 +191,7 @@ static int axon_ram_probe(struct platform_device *device)
    dev_info(&device->dev, "Found memory controller on %s\n",
    device->dev.of_node->full_name);

    - bank = kzalloc(sizeof(struct axon_ram_bank), GFP_KERNEL);
    + bank = kzalloc(sizeof(*bank), GFP_KERNEL);
    if (bank == NULL) {
    rc = -ENOMEM;
    goto failed;
    --
    2.13.4
    \
     
     \ /
      Last update: 2017-08-03 21:20    [W:2.185 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site