From: Rob Herring <robh@kernel.org>
To: Jason Wang <wangborong@cdjrlc.com>
Cc: frowand.list@gmail.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: unneed to initialise statics to 0 or NULL
Date: Wed, 15 Dec 2021 14:07:43 -0600 [thread overview]
Message-ID: <YbpLDxhsSW43kMKj@robh.at.kernel.org> (raw)
In-Reply-To: <20211212071454.298251-1-wangborong@cdjrlc.com>
On Sun, Dec 12, 2021 at 03:14:54PM +0800, Jason Wang wrote:
> Static variables do not need to be initialised to 0 or NULL,
> because compilers will initialise all uninitialised statics
> to 0 or NULL. Thus, remove the unneeded initializations.
>
Not required, but I think it helps statics stand out more as-is.
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
> drivers/of/pdt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c
> index 7eda43c66c91..37d02fcb81d0 100644
> --- a/drivers/of/pdt.c
> +++ b/drivers/of/pdt.c
> @@ -40,7 +40,7 @@ static inline void irq_trans_init(struct device_node *dp) { }
>
> static char * __init of_pdt_build_full_name(struct device_node *dp)
> {
> - static int failsafe_id = 0; /* for generating unique names on failure */
> + static int failsafe_id; /* for generating unique names on failure */
> const char *name;
> char path[256];
> char *buf;
> @@ -67,7 +67,7 @@ static struct property * __init of_pdt_build_one_prop(phandle node, char *prev,
> void *special_val,
> int special_len)
> {
> - static struct property *tmp = NULL;
> + static struct property *tmp;
> struct property *p;
> int err;
>
> --
> 2.34.1
>
>
prev parent reply other threads:[~2021-12-15 20:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-12 7:14 [PATCH] of: unneed to initialise statics to 0 or NULL Jason Wang
2021-12-15 20:07 ` Rob Herring [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=YbpLDxhsSW43kMKj@robh.at.kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wangborong@cdjrlc.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;
as well as URLs for NNTP newsgroup(s).