Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40703 )
Change subject: device: Constify struct device * parameter to dev_name ......................................................................
device: Constify struct device * parameter to dev_name
dev_name() does not need to modify the device structure. Hence, this change makes the struct device * parameter to dev_name() as const.
Change-Id: I6a94394385e45fd76f68218bf57914bddd2e2121 Signed-off-by: Furquan Shaikh furquan@google.com --- M src/device/device_util.c M src/include/device/device.h 2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/40703/1
diff --git a/src/device/device_util.c b/src/device/device_util.c index 25e95cf..aa2f06a 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -225,7 +225,7 @@ return buffer; }
-const char *dev_name(struct device *dev) +const char *dev_name(const struct device *dev) { if (dev->name) return dev->name; diff --git a/src/include/device/device.h b/src/include/device/device.h index 295415a..40aa2d0 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -182,7 +182,7 @@ int reset_bus(struct bus *bus); void scan_bridges(struct bus *bus); void assign_resources(struct bus *bus); -const char *dev_name(struct device *dev); +const char *dev_name(const struct device *dev); const char *dev_path(const struct device *dev); u32 dev_path_encode(const struct device *dev); const char *bus_path(struct bus *bus);