From: "Jordan Crouse" <jordan.crouse@amd.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-fbdev-devel@lists.sourceforge.net,
Tero Roponen <teanropo@jyu.fi>,
linux-kernel@vger.kernel.org
Subject: Re: fb: modedb uses wrong default_mode
Date: Wed, 15 Nov 2006 16:44:56 -0700 [thread overview]
Message-ID: <20061115234456.GB3674@cosmic.amd.com> (raw)
In-Reply-To: <20061115152952.0e92c50d.akpm@osdl.org>
On 15/11/06 15:29 -0800, Andrew Morton wrote:
> On Wed, 15 Nov 2006 19:43:16 +0200 (EET)
> Tero Roponen <teanropo@jyu.fi> wrote:
>
> >
> > It seems that default_mode is always overwritten in
> > fb_find_mode() if caller gives its own modedb; this
> > patch should fix it.
> Sigh.
>
> 2.6.19-rc5 has:
>
> if (!default_mode)
> default_mode = &modedb[DEFAULT_MODEDB_INDEX];
>
> and Jordan changed it to
>
> if (!default_mode && db != modedb)
> default_mode = &db[0];
> else
> default_mode = &modedb[DEFAULT_MODEDB_INDEX];
> and you want to change it to
>
> if (!default_mode && db != modedb)
> default_mode = &db[0];
> else if (!default_mode)
> default_mode = &modedb[DEFAULT_MODEDB_INDEX];
>
> which is actually a complicated way of doing
>
> if (!default_mode)
> default_mode = &db[DEFAULT_MODEDB_INDEX];
Unless DEFAULT_MODEDB_INDEX for some reason gets set to non-zero, then
it could be dangerous. If we agree that the default entry should aways be
at 0, then nuke the define and hard code the zero. That way, nobody will be
tempted to change it.
Jordan
--
Jordan Crouse
Senior Linux Engineer
Advanced Micro Devices, Inc.
<www.amd.com/embeddedprocessors>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
next prev parent reply other threads:[~2006-11-15 23:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0611151933070.12799@jalava.cc.jyu.fi>
2006-11-15 23:29 ` [PATCH -mm] fb: modedb uses wrong default_mode Andrew Morton
2006-11-15 23:44 ` Jordan Crouse [this message]
2006-11-17 20:08 ` [Linux-fbdev-devel] " James Simmons
2006-11-17 20:40 ` Andrew Morton
2006-11-18 10:39 ` [Linux-fbdev-devel] " Tero Roponen
2006-11-20 16:48 ` James Simmons
2006-11-20 20:05 ` Andrew Morton
2006-11-20 20:37 ` James Simmons
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=20061115234456.GB3674@cosmic.amd.com \
--to=jordan.crouse@amd.com \
--cc=akpm@osdl.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=teanropo@jyu.fi \
/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;
as well as URLs for NNTP newsgroup(s).