why do both kobjects and ksets have a "kobj_type" member?

From: Robert P. J. Day
Date: Sun Dec 03 2006 - 12:30:07 EST



what is the rationale for both the kobject structs and the kset
structs having a kobj_type? can those values possibly be different?
from kobject.h:

...
* kset - a set of kobjects of a specific type, belonging
* to a specific subsystem.
*
* All kobjects of a kset should be embedded in an identical
* type.
...

so that suggests that the types can't be *different* within a single
kset. furthermore, we have:

...
static inline struct kobj_type * get_ktype(struct kobject * k)
{
if (k->kset && k->kset->ktype)
return k->kset->ktype;
else
return k->ktype;
}
...

which seem to clearly show that the ktype of the kset overrides that
of the kobject, unless the kset *has* no ktype, or the kobject is not
even a member of a kset. are either of those situations possible?
just being inordinately curious.

rday

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/