lkml.org 
[lkml]   [2017]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/6] mm: add kmalloc_array_node and kcalloc_node
    On Wed, 27 Sep 2017, Johannes Thumshirn wrote:

    > +static inline void *kmalloc_array_node(size_t n, size_t size, gfp_t flags,
    > + int node)
    > +{
    > + if (size != 0 && n > SIZE_MAX / size)
    > + return NULL;
    > + if (__builtin_constant_p(n) && __builtin_constant_p(size))
    > + return kmalloc_node(n * size, flags, node);

    Isnt the same check done by kmalloc_node already? The result of
    multiplying two constants is a constant after all.

    \
     
     \ /
      Last update: 2017-09-27 10:58    [W:2.313 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site