lkml.org 
[lkml]   [2014]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v2] x86: allocate cpumask during check irq vectors

* H. Peter Anvin <hpa@zytor.com> wrote:

> I strongly disagree with putting variables in file scope when
> function scope will do, [...]

Yes, you are right that single-use file scope statics 'could' be moved
function local and are syntactically superior because in that case
other functions cannot make use of it.

But I also have very good (and unfixable and thus stronger) reasons to
object to statics inside local variables: more than once I personally
missed 'hidden statics' during review, in one case it even slipped
into a commit, so it's not a practice I want to encourage in any shape
or form (even if the 'rule' is to have a big fat comment, people will
just see the function local static and emulate it without the
comment), for code I maintain.

It's not about you, it's about me and other reviewers: I've seen
statics slipping past other reviewers as well. So it's the lesser of
two evils. Can you accept that reasoning?

Thanks,

Ingo


\
 
 \ /
  Last update: 2014-01-27 08:41    [W:0.044 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site