summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp421.c
diff options
context:
space:
mode:
authorColin Ian King2018-10-09 14:11:57 +0200
committerGuenter Roeck2018-10-11 05:37:13 +0200
commit8b9bf554dd530a40cd06a709edb8ec96b4de1d1a (patch)
tree435f3b7ba99b62c5ad08224c3b94e83554751164 /drivers/hwmon/tmp421.c
parenthwmon: (core) Add hwmon_in_enable attribute (diff)
downloadkernel-qcow2-linux-8b9bf554dd530a40cd06a709edb8ec96b4de1d1a.tar.gz
kernel-qcow2-linux-8b9bf554dd530a40cd06a709edb8ec96b4de1d1a.tar.xz
kernel-qcow2-linux-8b9bf554dd530a40cd06a709edb8ec96b4de1d1a.zip
hwmon: (tmp421) make const array 'names' static
The const array 'names' can be made static, saves populating it on the stack and will make it read-only. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/tmp421.c')
-rw-r--r--drivers/hwmon/tmp421.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index e36399213324..8844c9565d2a 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -226,8 +226,10 @@ static int tmp421_detect(struct i2c_client *client,
{
enum chips kind;
struct i2c_adapter *adapter = client->adapter;
- const char * const names[] = { "TMP421", "TMP422", "TMP423",
- "TMP441", "TMP442" };
+ static const char * const names[] = {
+ "TMP421", "TMP422", "TMP423",
+ "TMP441", "TMP442"
+ };
int addr = client->addr;
u8 reg;