From: Guenter Roeck <linux@roeck-us.net>
To: Yu Zhe <yuzhe@nfschina.com>
Cc: sander@svanheule.net, wim@linux-watchdog.org,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: change "char *" string form to "char []"
Date: Mon, 23 May 2022 17:42:32 -0700 [thread overview]
Message-ID: <20220524004232.GA241892@roeck-us.net> (raw)
In-Reply-To: <20220524003335.64801-1-yuzhe@nfschina.com>
On Mon, May 23, 2022 at 05:33:35PM -0700, Yu Zhe wrote:
> The string form of "char []" declares a single variable. It is better
> than "char *" which creates two variables.
>
Huh, what ? One is a character array, the other a pointer.
It is still a single variable.
I don't mind if you want to use [] in your own code, but please
stop making such changes in other people's code.
Guenter
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
> ---
> drivers/watchdog/realtek_otto_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/realtek_otto_wdt.c b/drivers/watchdog/realtek_otto_wdt.c
> index 60058a0c3ec4..c653ec73a999 100644
> --- a/drivers/watchdog/realtek_otto_wdt.c
> +++ b/drivers/watchdog/realtek_otto_wdt.c
> @@ -265,7 +265,7 @@ static int otto_wdt_probe_clk(struct otto_wdt_ctrl *ctrl)
>
> static int otto_wdt_probe_reset_mode(struct otto_wdt_ctrl *ctrl)
> {
> - static const char *mode_property = "realtek,reset-mode";
> + static const char mode_property[] = "realtek,reset-mode";
> const struct fwnode_handle *node = ctrl->dev->fwnode;
> int mode_count;
> u32 mode;
> --
> 2.25.1
>
prev parent reply other threads:[~2022-05-24 0:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 0:33 [PATCH] watchdog: change "char *" string form to "char []" Yu Zhe
2022-05-24 0:42 ` 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=20220524004232.GA241892@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=sander@svanheule.net \
--cc=wim@linux-watchdog.org \
--cc=yuzhe@nfschina.com \
/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