lkml.org 
[lkml]   [2006]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] sysfs representation of stacked devices (common) (rev.2)
Hi Greg,

Thank you for the comments.

Greg KH wrote:
>>+static inline struct kobject *add_dir(struct kobject *parent, const char *name)
>>+{
>>+ struct kobject *k;
>>+
>>+ if (!parent)
>>+ return NULL;
>>+
>>+ k = kmalloc(sizeof(*k), GFP_KERNEL);
>>+ if (!k)
>>+ return NULL;
>>+
>>+ memset(k, 0, sizeof(*k));
>>+ k->parent = parent;
>>+ k->ktype = &dir_ktype;
>>+ kobject_set_name(k, name);
>>+ kobject_register(k);
>>+
>>+ return k;
>>+}
>
> This code looks good enough that we should add it to the core kobject
> code, don't you think? Also, you might use kzalloc instead of kmalloc
> here.

Yes, it would be nice if kobject core has this function.
I'll move them to lib/kobject.c.

--
Jun'ichi Nomura, NEC Solutions (America), Inc.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-27 17:11    [W:0.091 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site