[lkml]   [2005]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/5] Misc driver core changes (constness)

It all started when code like this:

static const char driver_name = "blah";
static struct device_driver {
.name = driver_name,

would give me compiler warning about removing constness because driver
core has "name" fields drclared simply as "char *". I think it is a good
idea to have them as "const char *" since whoever accesses them should
not try to change them.

- kobject_hotplug should use kobject_name() instead of
accessing kobj->name directly since for objects with
long names it can contain garbage.

- make sysfs_{create|remove}_link to take const char * name.

- make kobject's name const char * since users should not
attempt to change it (except by calling kobject_rename).

- change name() method in kset_hiotplug_ops return const char *
since users shoudl not try to modify returned data.

- change driver's, bus's, class's and platform device's names
to be const char * so one can use const char *drv_name = "asdfg";
when initializing structures.
Also kill couple of whitespaces.

Please consider for inclusion.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-04-26 09:39    [W:0.044 / U:3.280 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site