lkml.org 
[lkml]   [2006]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fb: modedb uses wrong default_mode
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>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-16 00:45    [from the cache]
©2003-2011 Jasper Spaans