lkml.org 
[lkml]   [2011]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] checkpatch: Test for kmalloc/memset(0) pairs
    On Thu, 17 Mar 2011 22:52:24 -0400
    Steven Rostedt <rostedt@goodmis.org> wrote:

    > The use of kzalloc() is preferred over kmalloc/memset(0) pairs.
    >
    > When a match is made with "memset(p, 0, s);" a search back through the
    > patch hunk is made looking for "p = kmalloc(s,". If that is found, then
    > a warning is given, suggesting to use kzalloc() instead.

    The Coccinelle stuff already has a lot of this kind of test. See, for
    example, scripts/coccinelle/api/alloc/kzalloc-simple.cocci. Suppose
    there is some way all this nice analysis infrastructure could be
    integrated instead of duplicated? Or am I just a crazy dreamer?

    jon


    \
     
     \ /
      Last update: 2011-03-18 04:17    [W:3.999 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site