* [PATCH v2 1/5] console: move for_each_console to linux/console.h
@ 2010-11-04 15:20 Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 2/5] parisc: cleanup console handling Jiri Slaby
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jiri Slaby @ 2010-11-04 15:20 UTC (permalink / raw)
To: Andrew Morton; +Cc: werner, alan, gregkh, linux-kernel, jirislaby
Move it out of printk.c so that we can use it all over the code. There
are some potential users which will be converted to that macro in next
patches.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
include/linux/console.h | 6 ++++++
kernel/printk.c | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/console.h b/include/linux/console.h
index 95cf6f0..875cfb1 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -126,6 +126,12 @@ struct console {
struct console *next;
};
+/*
+ * for_each_console() allows you to iterate on each console
+ */
+#define for_each_console(con) \
+ for (con = console_drivers; con != NULL; con = con->next)
+
extern int console_set_on_cmdline;
extern int add_preferred_console(char *name, int idx, char *options);
diff --git a/kernel/printk.c b/kernel/printk.c
index b2ebaee..bf0420a 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -43,12 +43,6 @@
#include <asm/uaccess.h>
/*
- * for_each_console() allows you to iterate on each console
- */
-#define for_each_console(con) \
- for (con = console_drivers; con != NULL; con = con->next)
-
-/*
* Architectures can override it:
*/
void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...)
--
1.7.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/5] parisc: cleanup console handling
2010-11-04 15:20 [PATCH v2 1/5] console: move for_each_console to linux/console.h Jiri Slaby
@ 2010-11-04 15:20 ` Jiri Slaby
2010-11-04 17:26 ` Kyle McMartin
2010-11-04 15:20 ` [PATCH v2 3/5] VIDEO: xen-fb, switch to for_each_console Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 4/5] TTY: include termios.h in tty_driver.h Jiri Slaby
2 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2010-11-04 15:20 UTC (permalink / raw)
To: Andrew Morton
Cc: werner, alan, gregkh, linux-kernel, jirislaby, Kyle McMartin,
Helge Deller, James E.J. Bottomley, linux-parisc
* use newly added for_each_console for iterating consoles
* add proper console locking
* do not initialize tmp twice
* no need to declare console_drivers, it's already done in console.h
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: linux-parisc@vger.kernel.org
---
arch/parisc/kernel/pdc_cons.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 66d1f17..11bdd68 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -92,8 +92,6 @@ static int pdc_console_setup(struct console *co, char *options)
static struct timer_list pdc_console_timer;
-extern struct console * console_drivers;
-
static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
{
@@ -169,11 +167,13 @@ static int __init pdc_console_tty_driver_init(void)
* It is unregistered if the pdc console was not selected as the
* primary console. */
- struct console *tmp = console_drivers;
+ struct console *tmp;
- for (tmp = console_drivers; tmp; tmp = tmp->next)
+ acquire_console_sem();
+ for_each_console(tmp)
if (tmp == &pdc_cons)
break;
+ release_console_sem();
if (!tmp) {
printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name);
--
1.7.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/5] VIDEO: xen-fb, switch to for_each_console
2010-11-04 15:20 [PATCH v2 1/5] console: move for_each_console to linux/console.h Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 2/5] parisc: cleanup console handling Jiri Slaby
@ 2010-11-04 15:20 ` Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 4/5] TTY: include termios.h in tty_driver.h Jiri Slaby
2 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2010-11-04 15:20 UTC (permalink / raw)
To: Andrew Morton
Cc: werner, alan, gregkh, linux-kernel, jirislaby,
Jeremy Fitzhardinge, Chris Wright, virtualization, xen-devel,
linux-fbdev
Use newly added for_each_console for iterating consoles.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: virtualization@lists.osdl.org
Cc: xen-devel@lists.xensource.com
Cc: linux-fbdev@vger.kernel.org
---
drivers/video/xen-fbfront.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 428d273..4abb0b9 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -492,7 +492,7 @@ xenfb_make_preferred_console(void)
return;
acquire_console_sem();
- for (c = console_drivers; c; c = c->next) {
+ for_each_console(c) {
if (!strcmp(c->name, "tty") && c->index == 0)
break;
}
--
1.7.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 4/5] TTY: include termios.h in tty_driver.h
2010-11-04 15:20 [PATCH v2 1/5] console: move for_each_console to linux/console.h Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 2/5] parisc: cleanup console handling Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 3/5] VIDEO: xen-fb, switch to for_each_console Jiri Slaby
@ 2010-11-04 15:20 ` Jiri Slaby
2 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2010-11-04 15:20 UTC (permalink / raw)
To: Andrew Morton; +Cc: werner, alan, gregkh, linux-kernel, jirislaby
We reference termios and termiox in tty_driver.h, but we do not include
linux/termios.h where these are defined. Add the #include properly.
Otherwise when we include tty_driver.h, we get compile errors.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Greg KH <gregkh@suse.de>
---
include/linux/tty_driver.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index db2d227..09678ed 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -235,6 +235,7 @@
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/cdev.h>
+#include <linux/termios.h>
struct tty_struct;
struct tty_driver;
--
1.7.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/5] parisc: cleanup console handling
2010-11-04 15:20 ` [PATCH v2 2/5] parisc: cleanup console handling Jiri Slaby
@ 2010-11-04 17:26 ` Kyle McMartin
2010-11-04 22:02 ` Jiri Slaby
0 siblings, 1 reply; 6+ messages in thread
From: Kyle McMartin @ 2010-11-04 17:26 UTC (permalink / raw)
To: Jiri Slaby
Cc: Andrew Morton, werner, alan, gregkh, linux-kernel, jirislaby,
Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc
On Thu, Nov 04, 2010 at 04:20:21PM +0100, Jiri Slaby wrote:
> * use newly added for_each_console for iterating consoles
> * add proper console locking
> * do not initialize tmp twice
> * no need to declare console_drivers, it's already done in console.h
>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Kyle McMartin <kyle@mcmartin.ca>
> Cc: Helge Deller <deller@gmx.de>
> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
> Cc: linux-parisc@vger.kernel.org
This looks fine...
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
I assume that since it depends on 1/5 you'd prefer to merge it with the
rest?
--Kyle
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/5] parisc: cleanup console handling
2010-11-04 17:26 ` Kyle McMartin
@ 2010-11-04 22:02 ` Jiri Slaby
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2010-11-04 22:02 UTC (permalink / raw)
To: Kyle McMartin
Cc: Jiri Slaby, Andrew Morton, werner, alan, gregkh, linux-kernel,
Helge Deller, James E.J. Bottomley, linux-parisc
On 11/04/2010 06:26 PM, Kyle McMartin wrote:
> On Thu, Nov 04, 2010 at 04:20:21PM +0100, Jiri Slaby wrote:
>> * use newly added for_each_console for iterating consoles
>> * add proper console locking
>> * do not initialize tmp twice
>> * no need to declare console_drivers, it's already done in console.h
>>
>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
>> Cc: Kyle McMartin <kyle@mcmartin.ca>
>> Cc: Helge Deller <deller@gmx.de>
>> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
>> Cc: linux-parisc@vger.kernel.org
>
> This looks fine...
> Acked-by: Kyle McMartin <kyle@mcmartin.ca>
>
> I assume that since it depends on 1/5 you'd prefer to merge it with the
> rest?
Yeah, I would like to, with ACKs from relevant people.
thanks,
--
js
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-11-04 22:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04 15:20 [PATCH v2 1/5] console: move for_each_console to linux/console.h Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 2/5] parisc: cleanup console handling Jiri Slaby
2010-11-04 17:26 ` Kyle McMartin
2010-11-04 22:02 ` Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 3/5] VIDEO: xen-fb, switch to for_each_console Jiri Slaby
2010-11-04 15:20 ` [PATCH v2 4/5] TTY: include termios.h in tty_driver.h Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox