From: Colin Ian King Date: Tue, 9 Oct 2018 12:11:57 +0000 (+0100) Subject: hwmon: (tmp421) make const array 'names' static X-Git-Tag: v4.20-rc1~188^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b9bf554dd530a40cd06a709edb8ec96b4de1d1a;p=thirdparty%2Flinux.git 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 Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index e36399213324d..8844c9565d2a4 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;