lkml.org 
[lkml]   [2020]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmc: atmel-mci: Reduce scope for the variable “slot” in atmci_request_end()
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

\
 
 \ /
  Last update: 2020-12-14 08:09    [W:0.085 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site