lkml.org 
[lkml]   [2007]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: The use of KOBJ_NAME_LEN
On Mon, 3 Dec 2007, Greg KH wrote:

> On Tue, Dec 04, 2007 at 01:50:53AM -0500, Robert P. J. Day wrote:
> > On Tue, 4 Dec 2007, Dave Young wrote:
> >
> > > Hi,
> > > Does the KOBJ_NAME_LEN really means the limit of kobject name length? seems not . And if it's true, is the KOBJ_NAME_LEN of 20 enough to use?
> > >
> > > In the kobject_set_name, the limit is 1024. Looks like either the comment or the code should be updated.
> > >
> > > /**
> > > * kobject_set_name - Set the name of an object
> > > * @kobj: object.
> > > * @fmt: format string used to build the name
> > > *
> > > * If strlen(name) >= KOBJ_NAME_LEN, then use a dynamically allocated
> > > * string that @kobj->k_name points to. Otherwise, use the static
> > > * @kobj->name array.
> > > */
> >
> > the comment seems fairly clear -- if the name is sufficiently short,
> > it's stored in the static array. if not, then it's stored in
> > dynamically allocated space.
>
> Unfortunately, it's totally wrong, the code was updated by the comment
> wasn't, sorry. See my patch to fix this.

ah, quite right, now i see what dave was talking about.

rday
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================


\
 
 \ /
  Last update: 2007-12-04 09:05    [W:0.043 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site