lkml.org 
[lkml]   [2002]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    Subject[Q] get_ma_area() function
    Hi,

    looking at mm/vmalloc.c i found one strange (for me) line of code.

    From mm/vmalloc.c:

    struct vm_struct * get_vm_area(unsigned long size, unsigned long flags)
    {
    unsigned long addr;
    struct vm_struct **p, *tmp, *area;

    area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
    if (!area)
    return NULL;
    size += PAGE_SIZE;
    ^^^^^^^^^^^^^^^^^^
    Why ? Maybe size = PAGE_ALIGN(size); is more correct here ?

    Best regards.

    --
    Andrey Panin | Embedded systems software engineer
    pazke@orbita1.ru | PGP key: wwwkeys.eu.pgp.net[unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2005-03-22 13:25    [W:0.021 / U:29.980 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site