All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6] set up conswitchp when CONFIG_VT is set
@ 2004-01-22  0:20 Jun Sun
  2004-01-22  9:52 ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Jun Sun @ 2004-01-22  0:20 UTC (permalink / raw)
  To: linux-mips; +Cc: jsun

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]


conswitchp needs to be set whenever CONFIG_VT is selected.
Currently this job is done individually by each board in its setup
routine, often in a wrong way.

The right thing to do is to set the pointer in the common code
and remove almost two dozens of duplicated and often wrong settings.

The attached patch is for illustration only.  The removal of board settings
is not complete.

Comments?  Objections and cheers are equally welcome. :)

Jun

[-- Attachment #2: dummy_console.patch --]
[-- Type: text/plain, Size: 2110 bytes --]

diff -Nru linux/arch/mips/ddb5xxx/ddb5074/setup.c.orig linux/arch/mips/ddb5xxx/ddb5074/setup.c
--- linux/arch/mips/ddb5xxx/ddb5074/setup.c.orig	Mon Jan  5 10:33:34 2004
+++ linux/arch/mips/ddb5xxx/ddb5074/setup.c	Wed Jan 21 16:03:33 2004
@@ -10,7 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
 #include <linux/types.h>
-#include <linux/console.h>
 #include <linux/sched.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
@@ -113,10 +112,6 @@
 	ddb_set_pmr(DDB_PCIINIT0, DDB_PCICMD_IO, 0, 0x10);
 	ddb_set_pmr(DDB_PCIINIT1, DDB_PCICMD_MEM, DDB_PCI_MEM_BASE , 0x10);
 
-#ifdef CONFIG_FB
-	conswitchp = &dummy_con;
-#endif
-
 	/* Reboot on panic */
 	panic_timeout = 180;
 }
diff -Nru linux/arch/mips/ddb5xxx/ddb5476/setup.c.orig linux/arch/mips/ddb5xxx/ddb5476/setup.c
--- linux/arch/mips/ddb5xxx/ddb5476/setup.c.orig	Mon Jan  5 10:33:34 2004
+++ linux/arch/mips/ddb5xxx/ddb5476/setup.c	Wed Jan 21 16:03:50 2004
@@ -10,7 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
 #include <linux/types.h>
-#include <linux/console.h>
 #include <linux/sched.h>
 #include <linux/pci.h>
 
@@ -166,10 +165,6 @@
 	/* [jsun] we need to set BAR0 so that SDRAM 0 appears at 0x0 in PCI */
 	/* *(long*)0xbfa00218 = 0x8; */
 
-#ifdef CONFIG_FB
-	conswitchp = &dummy_con;
-#endif
-
 	/* board initialization stuff */
 	ddb5476_board_init();
 }
diff -Nru linux/arch/mips/kernel/setup.c.orig linux/arch/mips/kernel/setup.c
--- linux/arch/mips/kernel/setup.c.orig	Tue Nov 18 10:01:24 2003
+++ linux/arch/mips/kernel/setup.c	Wed Jan 21 16:00:47 2004
@@ -32,6 +32,7 @@
 #include <linux/kdev_t.h>
 #include <linux/root_dev.h>
 #include <linux/highmem.h>
+#include <linux/console.h>
 
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
@@ -471,6 +472,15 @@
 	set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
 #endif
 
+#ifdef CONFIG_VT
+#if defined(CONFIG_VGA_CONSOLE)
+        conswitchp = &vga_con;
+#elif defined(CONFIG_DUMMY_CONSOLE)
+        conswitchp = &dummy_con;
+#endif
+#endif
+
+	/* call board setup routine */
 	do_earlyinitcalls();
 
 	strlcpy(command_line, arcs_cmdline, sizeof(command_line));

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

* Re: [PATCH 2.6] set up conswitchp when CONFIG_VT is set
  2004-01-22  0:20 [PATCH 2.6] set up conswitchp when CONFIG_VT is set Jun Sun
@ 2004-01-22  9:52 ` Geert Uytterhoeven
  2004-01-22 12:28   ` Ralf Baechle
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2004-01-22  9:52 UTC (permalink / raw)
  To: Jun Sun; +Cc: Linux/MIPS Development

On Wed, 21 Jan 2004, Jun Sun wrote:
> conswitchp needs to be set whenever CONFIG_VT is selected.
> Currently this job is done individually by each board in its setup
> routine, often in a wrong way.
>
> The right thing to do is to set the pointer in the common code
> and remove almost two dozens of duplicated and often wrong settings.
>
> The attached patch is for illustration only.  The removal of board settings
> is not complete.
>
> Comments?  Objections and cheers are equally welcome. :)

| --- linux/arch/mips/kernel/setup.c.orig	Tue Nov 18 10:01:24 2003
| +++ linux/arch/mips/kernel/setup.c	Wed Jan 21 16:00:47 2004
| @@ -471,6 +472,15 @@
|  	set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
|  #endif
|
| +#ifdef CONFIG_VT
| +#if defined(CONFIG_VGA_CONSOLE)
| +        conswitchp = &vga_con;
| +#elif defined(CONFIG_DUMMY_CONSOLE)
| +        conswitchp = &dummy_con;
| +#endif
| +#endif

Isn't the #ifdef CONFIG_VT superfluous?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH 2.6] set up conswitchp when CONFIG_VT is set
  2004-01-22  9:52 ` Geert Uytterhoeven
@ 2004-01-22 12:28   ` Ralf Baechle
  2004-01-22 12:32     ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2004-01-22 12:28 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Jun Sun, Linux/MIPS Development

On Thu, Jan 22, 2004 at 10:52:59AM +0100, Geert Uytterhoeven wrote:

> | +#ifdef CONFIG_VT
> | +#if defined(CONFIG_VGA_CONSOLE)
> | +        conswitchp = &vga_con;
> | +#elif defined(CONFIG_DUMMY_CONSOLE)
> | +        conswitchp = &dummy_con;
> | +#endif
> | +#endif
> 
> Isn't the #ifdef CONFIG_VT superfluous?

No; if CONFIG_VT is undefined conswitchp is undefined also; DUMMY_CONSOLE
however is still selectable if CONFIG_VT is off so there could be
unsatisfied references to consitchp.

  ralf

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

* Re: [PATCH 2.6] set up conswitchp when CONFIG_VT is set
  2004-01-22 12:28   ` Ralf Baechle
@ 2004-01-22 12:32     ` Geert Uytterhoeven
  2004-01-22 22:18       ` Ralf Baechle
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2004-01-22 12:32 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Jun Sun, Linux/MIPS Development

On Thu, 22 Jan 2004, Ralf Baechle wrote:
> On Thu, Jan 22, 2004 at 10:52:59AM +0100, Geert Uytterhoeven wrote:
> > | +#ifdef CONFIG_VT
> > | +#if defined(CONFIG_VGA_CONSOLE)
> > | +        conswitchp = &vga_con;
> > | +#elif defined(CONFIG_DUMMY_CONSOLE)
> > | +        conswitchp = &dummy_con;
> > | +#endif
> > | +#endif
> >
> > Isn't the #ifdef CONFIG_VT superfluous?
>
> No; if CONFIG_VT is undefined conswitchp is undefined also; DUMMY_CONSOLE
> however is still selectable if CONFIG_VT is off so there could be
> unsatisfied references to consitchp.

DUMMY_CONSOLE can be set in drivers/video/console/Kconfig only.
drivers/video/console/Kconfig is included by drivers/video/Kconfig only, and
its inclusion depends on VT.
Hence the #ifdef CONFIG_VT is superfluous, unless the above isn't true for the
MIPS tree (I checked plain 2.6.1).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH 2.6] set up conswitchp when CONFIG_VT is set
  2004-01-22 12:32     ` Geert Uytterhoeven
@ 2004-01-22 22:18       ` Ralf Baechle
  2004-01-22 22:44           ` Jun Sun
  0 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2004-01-22 22:18 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Jun Sun, Linux/MIPS Development

On Thu, Jan 22, 2004 at 01:32:58PM +0100, Geert Uytterhoeven wrote:

> DUMMY_CONSOLE can be set in drivers/video/console/Kconfig only.
> drivers/video/console/Kconfig is included by drivers/video/Kconfig only, and
> its inclusion depends on VT.
> Hence the #ifdef CONFIG_VT is superfluous, unless the above isn't true for the
> MIPS tree (I checked plain 2.6.1).

A few systems used to hardwire CONFIG_DUMMY_CONSOLE in their Config.in /
Kconfig.  Seem that has been fixed, good.

  Ralf

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

* Re: [PATCH 2.6] set up conswitchp when CONFIG_VT is set
@ 2004-01-22 22:44           ` Jun Sun
  0 siblings, 0 replies; 7+ messages in thread
From: Jun Sun @ 2004-01-22 22:44 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Geert Uytterhoeven, Linux/MIPS Development, jsun

On Thu, Jan 22, 2004 at 11:18:20PM +0100, Ralf Baechle wrote:
> On Thu, Jan 22, 2004 at 01:32:58PM +0100, Geert Uytterhoeven wrote:
> 
> > DUMMY_CONSOLE can be set in drivers/video/console/Kconfig only.
> > drivers/video/console/Kconfig is included by drivers/video/Kconfig only, and
> > its inclusion depends on VT.
> > Hence the #ifdef CONFIG_VT is superfluous, unless the above isn't true for the
> > MIPS tree (I checked plain 2.6.1).
> 
> A few systems used to hardwire CONFIG_DUMMY_CONSOLE in their Config.in /
> Kconfig.  Seem that has been fixed, good.
> 

You are both right.  

In the end conswitchp needs to be set if and only if CONFIG_VT is set.  
From this regard, I think it is OK to leave this config there even if 
not all that useful given current code.

OK, I admit.  I already checked it in that way :0  If anyone is seriously
mad, I can take it out.  It does not really matter.  What really
matters is we repealed another unnecessary tax on board part.

Jun

PS. the tax repealling thing is really learned from our governer Arnold
Schwarzenegger ....

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

* Re: [PATCH 2.6] set up conswitchp when CONFIG_VT is set
@ 2004-01-22 22:44           ` Jun Sun
  0 siblings, 0 replies; 7+ messages in thread
From: Jun Sun @ 2004-01-22 22:44 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Geert Uytterhoeven, Linux/MIPS Development, jsun

On Thu, Jan 22, 2004 at 11:18:20PM +0100, Ralf Baechle wrote:
> On Thu, Jan 22, 2004 at 01:32:58PM +0100, Geert Uytterhoeven wrote:
> 
> > DUMMY_CONSOLE can be set in drivers/video/console/Kconfig only.
> > drivers/video/console/Kconfig is included by drivers/video/Kconfig only, and
> > its inclusion depends on VT.
> > Hence the #ifdef CONFIG_VT is superfluous, unless the above isn't true for the
> > MIPS tree (I checked plain 2.6.1).
> 
> A few systems used to hardwire CONFIG_DUMMY_CONSOLE in their Config.in /
> Kconfig.  Seem that has been fixed, good.
> 

You are both right.  

In the end conswitchp needs to be set if and only if CONFIG_VT is set.  

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

end of thread, other threads:[~2004-01-22 22:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-22  0:20 [PATCH 2.6] set up conswitchp when CONFIG_VT is set Jun Sun
2004-01-22  9:52 ` Geert Uytterhoeven
2004-01-22 12:28   ` Ralf Baechle
2004-01-22 12:32     ` Geert Uytterhoeven
2004-01-22 22:18       ` Ralf Baechle
2004-01-22 22:44         ` Jun Sun
2004-01-22 22:44           ` Jun Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.