lkml.org 
[lkml]   [2014]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers: tty: Remove redundant memset() in initialize_tty_struct
On 07/10/2014 06:16 PM, Rasmus Villemoes wrote:
> All callers (all two) of initialize_tty_struct() have just obtained
> the passed tty_struct from alloc_tty_struct(), which uses
> kzalloc(). So there is no reason to clear the memory again.

Actually I don't see a reason to have initialize_tty_struct as a
separate function. In both cases it is called after alloc_tty_struct. So
it would make sense to move the initialization to alloc_tty_struct. (And
move try_module_get before alloc_tty_struct in pty_common_install.)

Could you do that?

--
js
suse labs


\
 
 \ /
  Last update: 2014-07-10 19:01    [W:0.054 / U:1.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site