Messages in this thread Patch in this message | | | Date | Sat, 21 Aug 1999 16:22:37 +0200 | From | David Odin <> | Subject | patch for matroxfb [was: Re: cannot compile kernel 2.3.15-pre1] |
| |
On Sat, Aug 21, 1999 at 01:59:42PM +0200, David Odin wrote: > On Sat, Aug 21, 1999 at 11:35:11AM +0200, Junichi Saito wrote: > > > > > Hi, > > > > > >I've just tried to apply the .15-pre1 patch, in order to solve my > > >'free free IRQ' problem, but it fails to compile with the matrox frame buffer > > >compiled in the core kernel (not in a module) > > >gcc 2.7.2.3 complains: > > >matroxfb.c: In function `initMatrox2': > > >matroxfb.c:5878: section attribute cannot be specified for local variables > > > > > >this is the faulty line: > > > static struct fb_videomode defaultmode __initdata = { > > > /* 640x480 @ 60Hz, 31.5 kHz */ > > > NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, > > > 0, FB_VMODE_NONINTERLACED > > > }; > > > > > > It sounds like this declaration should be put outside the initMatrox2() > > >function, right? > > > > > > DindinX > > > > When you apply pre-patch-2.3.15-1, you should answer 'Yes' to a reversed > > diff, which is fb-related, that's what I read on the list. Did you do that > > ? > > > The 'reversed diff' was related to the modedb.c file, not the matroxfb.c > one. And anyway, the problem remains the same with .15-pre2... > > > 2.3.15-1 was built with matroxfb compiled in. No errors whatsoever. The > > compiler was gcc 2.95.1. > > > Well, may be that with gcc 2.95.1, the section attribute can be specified > for local variables, but gcc 2.7.2.3 doesn't permit that. > > So my question remains: what is the right way to fix this? Should we > put this declaration in the global scope or should we just drop the > __initdata section attribute? > > DindinX > OK. I've tried to put this declaration in the global scope, and this made gcc 2.7.2.3 happy. I've reboot with this, and everything looks alright.
Here's the patch I've applied (against 2.3.15-pre2):
--- matroxfb.c.orig Sat Aug 21 16:17:06 1999 +++ matroxfb.c Sat Aug 21 16:17:34 1999 @@ -5631,7 +5631,17 @@ 0, NULL, NULL}}; +#ifndef MODULE + /* mode database is marked __init ... */ + /* it cannot be static const struct due to __initdata + marker */ + static struct fb_videomode defaultmode __initdata = { + /* 640x480 @ 60Hz, 31.5 kHz */ + NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, + 0, FB_VMODE_NONINTERLACED + }; +#endif static int __init initMatrox2(WPMINFO struct display* d, struct board* b){ unsigned long ctrlptr_phys = 0; unsigned long video_base_phys = 0; @@ -5871,19 +5881,10 @@ ACCESS_FBINFO(video.len_usable) &= PAGE_MASK; #ifndef MODULE - /* mode database is marked __init ... */ - { - /* it cannot be static const struct due to __initdata - marker */ - static struct fb_videomode defaultmode __initdata = { - /* 640x480 @ 60Hz, 31.5 kHz */ - NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, - 0, FB_VMODE_NONINTERLACED - }; fb_find_mode(&vesafb_defined, &ACCESS_FBINFO(fbcon), videomode[0]?videomode:NULL, NULL, 0, &defaultmode, vesafb_defined.bits_per_pixel); - } + #endif /* mode modifiers */ -- David.Odin@bigfoot.com
I think your opinions are reasonable, except for the one about my mental instability. -- Psychology Professor, Farifield University
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |