linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "Amit Dhingra" <mechanicalamit@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	kernel@pengutronix.de, kernel-janitors@vger.kernel.org
Cc: linux-spi@vger.kernel.org, cocci@inria.fr,
	Mark Brown <broonie@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: spi: cadence-xspi: Drop useless assignment to NULL
Date: Tue, 21 Nov 2023 08:34:35 +0100	[thread overview]
Message-ID: <53db2c8f-7b9b-47f7-89ba-d78584c12d7b@web.de> (raw)
In-Reply-To: <CAO=gReGA17gHSr4ftN1Jwrjt5t76oAgaL6+n6X4wD0osJnuq4g@mail.gmail.com>

>>> Static structs are initialized with zeros for unspecified fields.
>>> So there is no advantage to explicitly initialize .remove with NULL
>>> and the assignment can be dropped without side effects.
>>
>> Would you become interested to delete redundant initialisation repetitions
>> at any more source code places?
>>
>> A corresponding script for the semantic patch language (Coccinelle software)
>> can point more remaining update candidates out for various components.
>
> Coccinelle shows 471 files.

I got the impression that more source code places can be reconsidered accordingly.

@deletion@
identifier member, s, var;
@@
 static struct s var =
 {
 ...,
-.member = \( 0 \| NULL \) ,
 ...
 };


Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> rg '^-\s' …/Projekte/Bau/Linux/scripts/Coccinelle/delete_NULL_assignment_in_static_struct-20231117.diff | wc -l
6567

Regards,
Markus

  reply	other threads:[~2023-11-21  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-05 14:39 [PATCH] spi: cadence-xspi: Drop useless assignment to NULL Uwe Kleine-König
2023-11-13 19:40 ` Mark Brown
     [not found] ` <233689d7-9409-406b-9383-49f10cd29336@web.de>
2023-11-20 22:18   ` Amit Dhingra
2023-11-21  7:34     ` Markus Elfring [this message]
2023-11-21  7:57       ` Uwe Kleine-König
2023-11-21  8:19         ` Markus Elfring
2023-11-21  8:32           ` Uwe Kleine-König
2023-11-21  8:51             ` Markus Elfring
2023-11-22 19:50             ` Amit Dhingra

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=53db2c8f-7b9b-47f7-89ba-d78584c12d7b@web.de \
    --to=markus.elfring@web.de \
    --cc=broonie@kernel.org \
    --cc=cocci@inria.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mechanicalamit@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).