linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: bero@redhat.de
Cc: alan@lxorguk.ukuu.org.uk, torvalds@transmeta.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Re: MatroxFB support can't be compiled into kernel
Date: Fri, 26 Jan 2001 15:32:47 +0100	[thread overview]
Message-ID: <20010126153247.A24714@vana.vc.cvut.cz> (raw)

On 26 Jan 01 at 14:29, Bernhard Rosenkraenzer wrote:
> 
> Subject says it all - works as a module, but can't be compiled into the
> kernel because of duplicate definitions, caused by several files including
> matroxfb_base.h which in turn defines global_disp.
> 
> Patch attached.

Oops. I did not tried matroxfb without multihead for so long... But...
Should not (1) compiler optimize them out, as global_disp is used only
by matroxfb_base.c and (2) linker merge them together? I was under
impression that kernel uses common storage for uninitialized variables...
I'm sure that it worked sometime in the past...

Anyway, I preffer patch bellow, as global_disp is used only by 
matroxfb_base.c, and only if CONFIG_FB_MATROX_MULTIHEAD is not set... 

Linus, original complaint was against 2.4.0-ac11 - I do not know, whether
Alan uses some new linker scripts or what's going on. In any case, can you
apply this too? There is no reason why matrox's 'global_disp' should polute
global namespace.
                                                Best regards,
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    

diff -urN linux/drivers/video/matrox/matroxfb_base.c linux/drivers/video/matrox/matroxfb_base.c
--- linux/drivers/video/matrox/matroxfb_base.c	Fri Dec 29 23:07:23 2000
+++ linux/drivers/video/matrox/matroxfb_base.c	Fri Jan 26 15:23:46 2001
@@ -2005,6 +2005,7 @@
 	u_int32_t cmd;
 #ifndef CONFIG_FB_MATROX_MULTIHEAD
 	static int registered = 0;
+	static struct display global_disp;
 #endif
 	DBG("matroxfb_probe")
 
diff -urN linux/drivers/video/matrox/matroxfb_base.h linux/drivers/video/matrox/matroxfb_base.h
--- linux/drivers/video/matrox/matroxfb_base.h	Fri Dec 29 23:07:23 2000
+++ linux/drivers/video/matrox/matroxfb_base.h	Fri Jan 26 15:22:53 2001
@@ -589,7 +589,6 @@
 #else
 
 extern struct matrox_fb_info matroxfb_global_mxinfo;
-struct display global_disp;
 
 #define ACCESS_FBINFO(x) (matroxfb_global_mxinfo.x)
 #define ACCESS_FBINFO2(info, x) (matroxfb_global_mxinfo.x)


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

             reply	other threads:[~2001-01-26 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-26 14:32 Petr Vandrovec [this message]
2001-01-26 14:57 ` [PATCH] Re: MatroxFB support can't be compiled into kernel Jeff Garzik

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=20010126153247.A24714@vana.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bero@redhat.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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).