lkml.org 
[lkml]   [2010]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 35/37] drivers/block/aoe: Use kmemdup
On Sun, 16 May 2010, Dan Carpenter wrote:

> On Sun, May 16, 2010 at 08:42:59AM -0400, Ed Cashin wrote:
> > On May 15, 2010, at 5:23 PM, Julia Lawall wrote:
> >
> > > From: Julia Lawall <julia@diku.dk>
> > >
> > > Use kmemdup when some other buffer is immediately copied into the
> > > allocated region.
> >
> > I have seen this patch but have no comment about it specifically.
> >
> > (Because the argument about whether this kind of change
> > adds value in general has already taken place. I'd say no, but that's
> > based on a maybe faulty idea that if folks weren't doing this they'd have
> > more time for reviewing patches, etc.)
>
> Nah nah. Nit-picky patches like this is what you get when people start
> reviewing code. It's really hard to review code properly without being
> annoyed and writing clean up patches is very calming.

Actually, someone asked me to convery a kmalloc to kstrdup, and I saw
kmemdup nearby, and thought why not... There is also the similar
memdup_user. Using that would more significantly simplify the code, in
particular reducing the amount of error handling code, since it
encompasses two calls that can fail (kmalloc and copy_from_user).

julia


\
 
 \ /
  Last update: 2010-05-16 18:05    [W:0.046 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site