mmc: atmel-mci: Reduce scope for the variable “slot” in atmci_request_end()

Alexandre Belloni alexandre.belloni at bootlin.com
Sat Dec 12 08:17:27 EST 2020


On 12/12/2020 01:16:39-0800, Joe Perches wrote:
> On Fri, 2020-12-11 at 09:03 +0100, Alexandre Belloni wrote:
> > On 11/12/2020 07:34:41+0100, Markus Elfring wrote:
> > > > > How do you think about a patch like “staging: speakup: remove redundant initialization
> > > > > of pointer p_key” for comparison?
> > > > > https://lore.kernel.org/patchwork/patch/1199128/
> > > > > https://lore.kernel.org/driverdev-devel/20200223153954.420731-1-colin.king@canonical.com/
> > > > > 
> > > > > Would you tolerate to omit the initialisation for the variable “slot”?
> > > > 
> > > > If you were able to provide one good technical reason.
> > > 
> > > I find that the positions of variable definitions (and similar assignments) influence
> > > the generation of executable code.
> > > 
> > And you are wrong, it doesn't.
> 
> I rarely reply or read any Markus' emails as everything
> from Markus goes into a 'don't read' folder but I was cc'd
> directly on one from someone else recently so I think I
> should reply to this one too.
> 
> In this case Alexandre it seems true, but in the generic case
> it may be false.  It may depend on stack size and location.
> 
> For instance, with large structs declared either at the top
> of a function or in separate branches within the function:
> 

I think you realize your example is way more complicated than
initializing basic type variable to 0 or NULL which has probably been
optimized forever.

This patch is just unnecessary churn that was generated without giving
any thought. It was easy to check whether the patch actually improved
anything. It doesn't and makes readability worse.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-arm-kernel mailing list