mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Colin King <colin.king@canonical.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (tmp421) make const array 'names' static
Date: Tue, 9 Oct 2018 17:36:23 -0700	[thread overview]
Message-ID: <20181010003623.GA21661@roeck-us.net> (raw)
In-Reply-To: <20181009121157.21656-1-colin.king@canonical.com>

On Tue, Oct 09, 2018 at 01:11:57PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/tmp421.c | 6 ++++--
>  1 file 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;
>  

      reply	other threads:[~2018-10-10  0:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 12:11 Colin King
2018-10-10  0:36 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181010003623.GA21661@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=colin.king@canonical.com \
    --cc=jdelvare@suse.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®