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>
This commit is contained in:
Colin Ian King 2018-10-09 13:11:57 +01:00 committed by Guenter Roeck
parent 68c0d69dee
commit 8b9bf554dd
1 changed files with 4 additions and 2 deletions

View File

@ -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;