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

From: Dan Carpenter
Date: Mon Dec 14 2020 - 02:09:37 EST


On Fri, Dec 11, 2020 at 10:08:54AM +0100, Markus Elfring wrote:
> > This makes it hard to review any patches or follow discussion...
>
> You shared also special software development opinions about extra variable
> initialisations occasionally, didn't you?

I generally put everything at the top of the function... I don't have
a well developed philosophy for when variables should be declared with
a smaller scope.

int ret; <-- this should always be function scope

Probably the other people are right that making scopes shorter is more
important when the function is very long.

regards,
dan carpenter