The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* mdacon.c minor cleanups
@ 2002-03-23 15:42 Boris Bezlaj
  2002-03-24  5:38 ` Keith Owens
  2002-03-24 18:42 ` Dave Jones
  0 siblings, 2 replies; 10+ messages in thread
From: Boris Bezlaj @ 2002-03-23 15:42 UTC (permalink / raw)
  To: kernel-janitor-discuss; +Cc: linux-kernel

Hi

Im resending mdacon.c patch if anyone is interested including it..

Its just a small cleanup(a part of kernel-janitor TODO).
Added module description, module_init/exit(), printk() parameters,...
Tested on 2.4.x, but not on 2.5(patches/compiles fine..)

Flames/improvements welcome..

Boris B.


--- drivers/video/mdacon.c.orig	Fri Sep 14 01:04:43 2001
+++ drivers/video/mdacon.c	Thu Feb 14 18:07:20 2002
@@ -78,7 +78,7 @@
 static int	mda_first_vc = 13;
 static int	mda_last_vc  = 16;
 
-static struct vc_data	*mda_display_fg = NULL;
+static struct vc_data	*mda_display_fg;
 
 MODULE_PARM(mda_first_vc, "1-255i");
 MODULE_PARM(mda_last_vc,  "1-255i");
@@ -338,7 +338,7 @@
 	mda_type_name = "MDA";
 
 	if (! mda_detect()) {
-		printk("mdacon: MDA card not detected.\n");
+		printk(KERN_WARNING __FILE__ ": MDA card not detected.\n");
 		return NULL;
 	}
 
@@ -349,7 +349,7 @@
 	/* cursor looks ugly during boot-up, so turn it off */
 	mda_set_cursor(mda_vram_len - 1);
 
-	printk("mdacon: %s with %ldK of memory detected.\n",
+	printk(KERN_INFO __FILE__ ": %s with %ldK of memory detected.\n",
 		mda_type_name, mda_vram_len/1024);
 
 	return "MDA-2";
@@ -605,28 +605,23 @@
 	con_invert_region:	mdacon_invert_region,
 };
 
-void __init mda_console_init(void)
+int __init mda_console_init(void)
 {
 	if (mda_first_vc > mda_last_vc)
-		return;
+		return -EINVAL;
 
 	take_over_console(&mda_con, mda_first_vc-1, mda_last_vc-1, 0);
-}
-
-#ifdef MODULE
-
-MODULE_LICENSE("GPL");
-
-int init_module(void)
-{
-	mda_console_init();
-
 	return 0;
 }
 
-void cleanup_module(void)
+void __exit mda_console_exit(void)
 {
 	give_up_console(&mda_con);
 }
 
+#ifdef MODULE
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("MDA console driver. Default console allocation: vc/13 - vc/16");
+module_init(mda_console_init);
+module_exit(mda_console_exit);
 #endif

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-23 15:42 mdacon.c minor cleanups Boris Bezlaj
@ 2002-03-24  5:38 ` Keith Owens
  2002-03-24 18:42 ` Dave Jones
  1 sibling, 0 replies; 10+ messages in thread
From: Keith Owens @ 2002-03-24  5:38 UTC (permalink / raw)
  To: Boris Bezlaj; +Cc: kernel-janitor-discuss, linux-kernel

On Sat, 23 Mar 2002 16:42:20 +0100, 
Boris Bezlaj <boris@kista.gajba.net> wrote:
>+#ifdef MODULE
>+MODULE_LICENSE("GPL");
>+MODULE_DESCRIPTION("MDA console driver. Default console allocation: vc/13 - vc/16");
>+module_init(mda_console_init);
>+module_exit(mda_console_exit);
> #endif

Do not wrap #ifdef MODULE around those lines.  All the module_* macros
behave correctly when the code is built in, module_init even changes
its behaviour for built in code.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-23 15:42 mdacon.c minor cleanups Boris Bezlaj
  2002-03-24  5:38 ` Keith Owens
@ 2002-03-24 18:42 ` Dave Jones
  2002-03-24 18:59   ` Daniel Jacobowitz
  2002-03-25  7:53   ` Zwane Mwaikambo
  1 sibling, 2 replies; 10+ messages in thread
From: Dave Jones @ 2002-03-24 18:42 UTC (permalink / raw)
  To: Boris Bezlaj; +Cc: kernel-janitor-discuss, linux-kernel

On Sat, Mar 23, 2002 at 04:42:20PM +0100, Boris Bezlaj wrote:

 >  	if (! mda_detect()) {
 > -		printk("mdacon: MDA card not detected.\n");
 > +		printk(KERN_WARNING __FILE__ ": MDA card not detected.\n");
 >  		return NULL;

Does __FILE__ suffer the same 'deprecated' warning that newer gcc 3's
spit out for __FUNCTION__  ? If so, it'd be better to do this properly
than to add more bits that will just create another janitor item for
someone else later..

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-24 18:42 ` Dave Jones
@ 2002-03-24 18:59   ` Daniel Jacobowitz
  2002-03-25  7:53   ` Zwane Mwaikambo
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2002-03-24 18:59 UTC (permalink / raw)
  To: Dave Jones, Boris Bezlaj, kernel-janitor-discuss, linux-kernel

On Sun, Mar 24, 2002 at 07:42:54PM +0100, Dave Jones wrote:
> On Sat, Mar 23, 2002 at 04:42:20PM +0100, Boris Bezlaj wrote:
> 
>  >  	if (! mda_detect()) {
>  > -		printk("mdacon: MDA card not detected.\n");
>  > +		printk(KERN_WARNING __FILE__ ": MDA card not detected.\n");
>  >  		return NULL;
> 
> Does __FILE__ suffer the same 'deprecated' warning that newer gcc 3's
> spit out for __FUNCTION__  ? If so, it'd be better to do this properly
> than to add more bits that will just create another janitor item for
> someone else later..

No, it shouldn't.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-24 18:42 ` Dave Jones
  2002-03-24 18:59   ` Daniel Jacobowitz
@ 2002-03-25  7:53   ` Zwane Mwaikambo
  2002-03-25 15:50     ` Boris
  2002-03-27  9:17     ` Matan
  1 sibling, 2 replies; 10+ messages in thread
From: Zwane Mwaikambo @ 2002-03-25  7:53 UTC (permalink / raw)
  To: Dave Jones; +Cc: Boris Bezlaj, kernel-janitor-discuss, linux-kernel

The mdacon probe code doesn't seem to work well, if i have it compiled in 
it *always* detects an MDA card, even if there isn't one actually in the 
box. I can provide the dmesg if anyone's interested.

	Zwane



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-25  7:53   ` Zwane Mwaikambo
@ 2002-03-25 15:50     ` Boris
  2002-03-25 16:05       ` Zwane Mwaikambo
  2002-03-27  9:17     ` Matan
  1 sibling, 1 reply; 10+ messages in thread
From: Boris @ 2002-03-25 15:50 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: kernel-janitor-discuss, linux-kernel

On Mon, Mar 25, 2002 at 09:53:24AM +0200, Zwane Mwaikambo wrote:
> The mdacon probe code doesn't seem to work well, if i have it compiled in 
> it *always* detects an MDA card, even if there isn't one actually in the 
> box. I can provide the dmesg if anyone's interested.
> 
> 	Zwane
> 

I will look into it, however i must admit i never tried to load the driver without the mda card in the box.

Can you tell me, what type of "card" is found?
Kernel version?

	Boris

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-25 15:50     ` Boris
@ 2002-03-25 16:05       ` Zwane Mwaikambo
  0 siblings, 0 replies; 10+ messages in thread
From: Zwane Mwaikambo @ 2002-03-25 16:05 UTC (permalink / raw)
  To: Boris; +Cc: kernel-janitor-discuss, linux-kernel

On Mon, 25 Mar 2002, Boris wrote:

> I will look into it, however i must admit i never tried to load the driver without the mda card in the box.
> 
> Can you tell me, what type of "card" is found?
> Kernel version?

Its a hercules monochrome with 64k iirc

	Zwane

-- 
rants	: http://function.linuxpower.ca
		


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-25  7:53   ` Zwane Mwaikambo
  2002-03-25 15:50     ` Boris
@ 2002-03-27  9:17     ` Matan
  2002-03-27  9:35       ` Zwane Mwaikambo
  2002-03-27 17:56       ` Boris
  1 sibling, 2 replies; 10+ messages in thread
From: Matan @ 2002-03-27  9:17 UTC (permalink / raw)
  To: Zwane Mwaikambo
  Cc: Dave Jones, Boris Bezlaj, kernel-janitor-discuss, linux-kernel

On Mon, 25 Mar 2002, Zwane Mwaikambo wrote:

> The mdacon probe code doesn't seem to work well, if i have it compiled in
> it *always* detects an MDA card, even if there isn't one actually in the
> box. I can provide the dmesg if anyone's interested.

The mdacon.c in 2.4.18 does not actually test for an MDA card, it only
test for ram where the MDA vram is. The problem is that almost any vga
card maps ram to that address.
There is a test, but it is somewhat wrong (it changes registers, but
does not save and restore the original values) and is commented out. If
you fix this and uncomment the test, it works in some cases (this was
discussed under the subject "MDA video detection request" on July 2000).


-- 
Matan Ziv-Av.                         matan@svgalib.org






^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-27  9:17     ` Matan
@ 2002-03-27  9:35       ` Zwane Mwaikambo
  2002-03-27 17:56       ` Boris
  1 sibling, 0 replies; 10+ messages in thread
From: Zwane Mwaikambo @ 2002-03-27  9:35 UTC (permalink / raw)
  To: Matan; +Cc: Dave Jones, Boris Bezlaj, kernel-janitor-discuss, linux-kernel

On Wed, 27 Mar 2002, Matan wrote:

> The mdacon.c in 2.4.18 does not actually test for an MDA card, it only
> test for ram where the MDA vram is. The problem is that almost any vga
> card maps ram to that address.
> There is a test, but it is somewhat wrong (it changes registers, but
> does not save and restore the original values) and is commented out. If
> you fix this and uncomment the test, it works in some cases (this was
> discussed under the subject "MDA video detection request" on July 2000).

Aah, thanks for clearing that up.

	Zwane

-- 
http://function.linuxpower.ca
		


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: mdacon.c minor cleanups
  2002-03-27  9:17     ` Matan
  2002-03-27  9:35       ` Zwane Mwaikambo
@ 2002-03-27 17:56       ` Boris
  1 sibling, 0 replies; 10+ messages in thread
From: Boris @ 2002-03-27 17:56 UTC (permalink / raw)
  To: Matan; +Cc: kernel-janitor-discuss, linux-kernel, Zwane Mwaikambo

On Wed, Mar 27, 2002 at 11:17:39AM +0200, Matan wrote:
> 
> The mdacon.c in 2.4.18 does not actually test for an MDA card, it only
> test for ram where the MDA vram is. The problem is that almost any vga
> card maps ram to that address.
> There is a test, but it is somewhat wrong (it changes registers, but
> does not save and restore the original values) and is commented out. If
> you fix this and uncomment the test, it works in some cases (this was
> discussed under the subject "MDA video detection request" on July 2000).
> 
I am trying to add proper mda detection to the driver..
Current detection code is strange indeed.

Where are those messages archived somewhere ? I could find little info on mda cards so far..

	Boris

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-03-27 17:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-23 15:42 mdacon.c minor cleanups Boris Bezlaj
2002-03-24  5:38 ` Keith Owens
2002-03-24 18:42 ` Dave Jones
2002-03-24 18:59   ` Daniel Jacobowitz
2002-03-25  7:53   ` Zwane Mwaikambo
2002-03-25 15:50     ` Boris
2002-03-25 16:05       ` Zwane Mwaikambo
2002-03-27  9:17     ` Matan
2002-03-27  9:35       ` Zwane Mwaikambo
2002-03-27 17:56       ` Boris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox