From: Dave Jones <davej@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Beregalov <a.beregalov@gmail.com>,
linux-kernel@vger.kernel.org, mathieu.desnoyers@polymtl.ca
Subject: Re: [PATCH] cpufreq: fix UP build
Date: Wed, 8 Jul 2009 14:17:18 -0400 [thread overview]
Message-ID: <20090708181718.GC13944@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.01.0907081103560.3352@localhost.localdomain>
On Wed, Jul 08, 2009 at 11:08:12AM -0700, Linus Torvalds wrote:
> (not new to your diff - it's pre-existing crap):
>
> > #ifdef CONFIG_SMP
> > struct cpufreq_policy *managed_policy;
> > + struct sys_device *cpu_sys_dev;
> > #endif
>
> and instead those variables should be declared inside the blocks where
> they are used, not at the top.
>
> The rule should always be: make the scope of a variable as small as
> possible. Don't declare it at the top and try to "save" a declaration when
> it can be used inside multiple blocks as multiple different variables.
>
> Also, that whole function could damn well be split into smaller pieces,
> which would make it much more readable than that horrible 250+ line piece
> of crap monster-function with #ifdef's inside the code.
Yes, cpufreq_add_dev is a monster. Its complexity keeps biting us in new ways.
> Please, somebody?
It's something to look at for .32, agreed.
Dave
next prev parent reply other threads:[~2009-07-08 18:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-08 17:57 [PATCH] cpufreq: fix UP build Alexander Beregalov
2009-07-08 18:08 ` Linus Torvalds
2009-07-08 18:17 ` Dave Jones [this message]
2009-07-08 20:17 ` Dave Jones
2009-07-08 18:15 ` Dave Jones
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=20090708181718.GC13944@redhat.com \
--to=davej@redhat.com \
--cc=a.beregalov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=torvalds@linux-foundation.org \
/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