From 9a81ffa7ad4b31056fa7b68b5b0ad6eb6925f667 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Wed, 28 Sep 2016 12:11:14 -0700 Subject: [PATCH] device: Make device_get_binding() const correct Currently passing a constant string (other than a string literal) to device_get_binding() generates a spurious warning. The warning is spurious because device_get_binding() does not, nor is it ever likely to, modify its argument. To fix the warning we modify the prototype to make clear name will never be modified. Change-Id: I2df22de61eb2580b2086a685549900d7ed4a322d Signed-off-by: Daniel Thompson --- include/device.h | 2 +- kernel/nanokernel/device.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/device.h b/include/device.h index 7d7fcf3f57e..e63d254ed6f 100644 --- a/include/device.h +++ b/include/device.h @@ -419,7 +419,7 @@ void _sys_device_do_config_level(int level); * * @return pointer to device structure; NULL if not found or cannot be used. */ -struct device* device_get_binding(char *name); +struct device *device_get_binding(const char *name); /** * @brief Device Power Management APIs diff --git a/kernel/nanokernel/device.c b/kernel/nanokernel/device.c index 078c14bc0a3..44a519cf5de 100644 --- a/kernel/nanokernel/device.c +++ b/kernel/nanokernel/device.c @@ -66,7 +66,7 @@ void _sys_device_do_config_level(int level) } } -struct device *device_get_binding(char *name) +struct device *device_get_binding(const char *name) { struct device *info;