From: Guenter Roeck <linux@roeck-us.net>
To: Colin Ian King <colin.i.king@gmail.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: (fschmd) Make const arrays static const
Date: Wed, 5 Oct 2022 11:31:16 -0700 [thread overview]
Message-ID: <20221005183116.GA2734583@roeck-us.net> (raw)
In-Reply-To: <20221005152752.318493-1-colin.i.king@gmail.com>
On Wed, Oct 05, 2022 at 04:27:52PM +0100, Colin Ian King wrote:
> Don't populate the read-only const arrays names and watchdog_minors
> on the stack but instead make them static const. Also makes the
> object code a little smaller.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> drivers/hwmon/fschmd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
> index 0a77d6161928..e1f426e86f36 100644
> --- a/drivers/hwmon/fschmd.c
> +++ b/drivers/hwmon/fschmd.c
> @@ -1083,9 +1083,9 @@ static int fschmd_detect(struct i2c_client *client,
> static int fschmd_probe(struct i2c_client *client)
> {
> struct fschmd_data *data;
> - const char * const names[7] = { "Poseidon", "Hermes", "Scylla",
> + static const char * const names[7] = { "Poseidon", "Hermes", "Scylla",
> "Heracles", "Heimdall", "Hades", "Syleus" };
> - const int watchdog_minors[] = { WATCHDOG_MINOR, 212, 213, 214, 215 };
> + static const int watchdog_minors[] = { WATCHDOG_MINOR, 212, 213, 214, 215 };
> int i, err;
> enum chips kind = i2c_match_id(fschmd_id, client)->driver_data;
>
prev parent reply other threads:[~2022-10-05 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 15:27 [PATCH] hwmon: (fschmd) Make const arrays static const Colin Ian King
2022-10-05 18:31 ` 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=20221005183116.GA2734583@roeck-us.net \
--to=linux@roeck-us.net \
--cc=colin.i.king@gmail.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