Skip to contentSkip to conversation

driver core: device_rename's new_name can be const

PATCH In review Johannes Berg 2 participants 2 messages Aug 5, 2010 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: device_rename's new_name can be const

The new_name argument to device_rename() can be
const as kobject_rename's new_name argument is.

---
I have a patch that I would like to push into the wireless tree for .37 that relies on this to not generate a compiler warning, it would be nice if this could get into .36 but I don't know if that's possible now.

 drivers/base/core.c    |    2 +-
 include/linux/device.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/base/core.c +1 -1
@@ -1599,7 +1599,7 @@ EXPORT_SYMBOL_GPL(device_destroy);
  * on the same device to ensure that new_name is valid and
  * won't conflict with other devices.
  */
-int device_rename(struct device *dev, char *new_name)
+int device_rename(struct device *dev, const char *new_name)
 {
 	char *old_class_name = NULL;
 	char *new_class_name = NULL;
include/linux/device.h +1 -1
@@ -551,7 +551,7 @@ extern int device_for_each_child(struct
 		     int (*fn)(struct device *dev, void *data));
 extern struct device *device_find_child(struct device *dev, void *data,
 				int (*match)(struct device *dev, void *data));
-extern int device_rename(struct device *dev, char *new_name);
+extern int device_rename(struct device *dev, const char *new_name);
 extern int device_move(struct device *dev, struct device *new_parent,
 		       enum dpm_order dpm_order);
 extern const char *device_get_devnode(struct device *dev,
#1 lore raw
Quoted 8 lines · Johannes Berg

The new_name argument to device_rename() can be
const as kobject_rename's new_name argument is.

---
I have a patch that I would like to push into the wireless tree for .37 that relies on this to not generate a compiler warning, it would be nice if this could get into .36 but I don't know if that's possible now.

Yes, it's simple enough for me to get into this merge.

thanks,

greg k-h