2009-09-11 19:30:08

by Anirban Sinha

[permalink] [raw]
Subject: [PATCH] cleanup legacy console_print function

Hi Linus:

>>Looks ok to me, but I'm not going to apply it in late -rc, since it
>>doesn't really fix any bug. Feel free to re-send after 2.6.31 is out,
>or
>>try to get it into one of the trees to be merged later.
>>
>
>Thanks Linus. I will resend the patch once 2.6.31 is out of the door.

Here's the patch again:


Subject: cleanup legacy console_print function

console_print() is an old legacy interface mostly unused in the entire
kernel tree. It's best to clean up its existing use and let developers
usew their own implementation of it as they feel fit.


Signed-off-by: Anirban Sinha <[email protected]>
---
arch/ia64/kernel/head.S | 1 +
arch/ia64/kernel/head.h | 1 +
arch/ia64/kernel/process.c | 7 +++++++
drivers/char/serial167.c | 5 ++---
include/linux/dtlk.h | 6 +++---
include/linux/tty.h | 4 ----
kernel/printk.c | 6 ------
7 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 23f846d..e6c5c3d 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -34,6 +34,7 @@
#include <asm/mca_asm.h>
#include <linux/init.h>
#include <linux/linkage.h>
+#include "head.h"

#ifdef CONFIG_HOTPLUG_CPU
#define SAL_PSR_BITS_TO_SET \
diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
new file mode 100644
index 0000000..2e2ac68
--- /dev/null
+++ b/arch/ia64/kernel/head.h
@@ -0,0 +1 @@
+extern void console_print(const char *s);
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 5d7c0e5..c2bb591 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -161,6 +161,13 @@ show_regs (struct pt_regs *regs)
show_stack(NULL, NULL);
}

+/* local support for deprecated console_print */
+void
+console_print(const char *s)
+{
+ printk(KERN_EMERG "%s", s);
+}
+
void
do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long
in_syscall)
{
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 51e7a46..5942a9d 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -171,7 +171,6 @@ static int startup(struct cyclades_port *);
static void cy_throttle(struct tty_struct *);
static void cy_unthrottle(struct tty_struct *);
static void config_setup(struct cyclades_port *);
-extern void console_print(const char *);
#ifdef CYCLOM_SHOW_STATUS
static void show_status(int);
#endif
@@ -245,7 +244,7 @@ void SP(char *data)
{
unsigned long flags;
local_irq_save(flags);
- console_print(data);
+ printk(KERN_EMERG "%s", data);
local_irq_restore(flags);
}

@@ -255,7 +254,7 @@ void CP(char data)
unsigned long flags;
local_irq_save(flags);
scrn[0] = data;
- console_print(scrn);
+ printk(KERN_EMERG "%c", scrn);
local_irq_restore(flags);
} /* CP */

diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h
index 2896d90..4f93c45 100644
--- a/include/linux/dtlk.h
+++ b/include/linux/dtlk.h
@@ -4,15 +4,15 @@
{ \
if(dtlk_trace) \
{ \
- console_print(text); \
- console_print("\n"); \
+ printk(KERN_EMERG "%s", text); \
+ printk(KERN_EMERG "\n"); \
} \
}

#define TRACE_CHR(chr) \
{ \
if(dtlk_trace) \
- console_print(chr); \
+ printk(KERN_EMERG "%c", chr); \
} \

#endif
diff --git a/include/linux/tty.h b/include/linux/tty.h
index e8c6c91..ba191e3 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -517,10 +517,6 @@ extern void serial_console_init(void);

extern int pcxe_open(struct tty_struct *tty, struct file *filp);

-/* printk.c */
-
-extern void console_print(const char *);
-
/* vt.c */

extern int vt_ioctl(struct tty_struct *tty, struct file *file,
diff --git a/kernel/printk.c b/kernel/printk.c
index b4d97b5..32e15ce 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1060,12 +1060,6 @@ void __sched console_conditional_schedule(void)
}
EXPORT_SYMBOL(console_conditional_schedule);

-void console_print(const char *s)
-{
- printk(KERN_EMERG "%s", s);
-}
-EXPORT_SYMBOL(console_print);
-
void console_unblank(void)
{
struct console *c;


2009-09-14 14:51:19

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] cleanup legacy console_print function



On Fri, 11 Sep 2009, Anirban Sinha wrote:
>
> - console_print(text); \
> - console_print("\n"); \
> + printk(KERN_EMERG "%s", text); \
> + printk(KERN_EMERG "\n"); \

Just clean it up to be

printk(KERN_EMERG "%s\n", text);

instead while at it.

> #define TRACE_CHR(chr) \
> { \
> if(dtlk_trace) \
> - console_print(chr); \
> + printk(KERN_EMERG "%c", chr); \

That can't be right. The translation is to use "%s", not "%c".

Linus

2009-09-14 17:18:37

by Anirban Sinha

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function


>On Fri, 11 Sep 2009, Anirban Sinha wrote:
>>
>> - console_print(text); \
>> - console_print("\n"); \
>> + printk(KERN_EMERG "%s", text); \
>> + printk(KERN_EMERG "\n"); \
>
>Just clean it up to be
>
> printk(KERN_EMERG "%s\n", text);
>
>instead while at it.
>
>> #define TRACE_CHR(chr) \
>> { \
>> if(dtlk_trace) \
>> - console_print(chr); \
>> + printk(KERN_EMERG "%c", chr); \
>
>That can't be right. The translation is to use "%s", not "%c".

Better still, for both the above cases, I will simply remove those macro
definitions. They are enclosed within {#if0 #endif}, so no code could
possibly be using it. If anyone has any strong reasons for keeping it
still, please raise your voice now.

Cheers,

Ani

2009-09-14 18:28:45

by Anirban Sinha

[permalink] [raw]
Subject: Re: [PATCH] cleanup legacy console_print function

Here you go!


>From e096c1774450f8348a7af3b7e47800710a490212 Mon Sep 17 00:00:00 2001
From: Anirban Sinha <[email protected]>
Date: Mon, 14 Sep 2009 11:13:37 -0700
Subject: cleanup console_print()

console_print() is an old legacy interface mostly unused in the entire
kernel tree. It's best to clean up its existing use and let developers
use their own implementation of it as they feel fit.


Signed-off-by: Anirban Sinha <[email protected]>
---
arch/ia64/kernel/head.S | 1 +
arch/ia64/kernel/head.h | 1 +
arch/ia64/kernel/process.c | 7 +++++++
drivers/char/serial167.c | 5 ++---
include/linux/dtlk.h | 19 -------------------
include/linux/tty.h | 4 ----
kernel/printk.c | 6 ------
7 files changed, 11 insertions(+), 32 deletions(-)
create mode 100644 arch/ia64/kernel/head.h

diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 23f846d..e6c5c3d 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -34,6 +34,7 @@
#include <asm/mca_asm.h>
#include <linux/init.h>
#include <linux/linkage.h>
+#include "head.h"

#ifdef CONFIG_HOTPLUG_CPU
#define SAL_PSR_BITS_TO_SET \
diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
new file mode 100644
index 0000000..2e2ac68
--- /dev/null
+++ b/arch/ia64/kernel/head.h
@@ -0,0 +1 @@
+extern void console_print(const char *s);
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 89969e9..b34bef7 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -161,6 +161,13 @@ show_regs (struct pt_regs *regs)
show_stack(NULL, NULL);
}

+/* local support for deprecated console_print */
+void
+console_print(const char *s)
+{
+ printk(KERN_EMERG "%s", s);
+}
+
void
do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long
in_syscall)
{
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 51e7a46..5942a9d 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -171,7 +171,6 @@ static int startup(struct cyclades_port *);
static void cy_throttle(struct tty_struct *);
static void cy_unthrottle(struct tty_struct *);
static void config_setup(struct cyclades_port *);
-extern void console_print(const char *);
#ifdef CYCLOM_SHOW_STATUS
static void show_status(int);
#endif
@@ -245,7 +244,7 @@ void SP(char *data)
{
unsigned long flags;
local_irq_save(flags);
- console_print(data);
+ printk(KERN_EMERG "%s", data);
local_irq_restore(flags);
}

@@ -255,7 +254,7 @@ void CP(char data)
unsigned long flags;
local_irq_save(flags);
scrn[0] = data;
- console_print(scrn);
+ printk(KERN_EMERG "%c", scrn);
local_irq_restore(flags);
} /* CP */

diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h
index 2896d90..22a7b9a 100644
--- a/include/linux/dtlk.h
+++ b/include/linux/dtlk.h
@@ -1,22 +1,3 @@
-#if 0
-
-#define TRACE_TXT(text) \
- { \
- if(dtlk_trace) \
- { \
- console_print(text); \
- console_print("\n"); \
- } \
- }
-
-#define TRACE_CHR(chr) \
- { \
- if(dtlk_trace) \
- console_print(chr); \
- } \
-
-#endif
-
#define DTLK_MINOR 0
#define DTLK_IO_EXTENT 0x02

diff --git a/include/linux/tty.h b/include/linux/tty.h
index 0d3974f..a916a31 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -519,10 +519,6 @@ extern void serial_console_init(void);

extern int pcxe_open(struct tty_struct *tty, struct file *filp);

-/* printk.c */
-
-extern void console_print(const char *);
-
/* vt.c */

extern int vt_ioctl(struct tty_struct *tty, struct file *file,
diff --git a/kernel/printk.c b/kernel/printk.c
index e10d193..602033a 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1075,12 +1075,6 @@ void __sched console_conditional_schedule(void)
}
EXPORT_SYMBOL(console_conditional_schedule);

-void console_print(const char *s)
-{
- printk(KERN_EMERG "%s", s);
-}
-EXPORT_SYMBOL(console_print);
-
void console_unblank(void)
{
struct console *c;
--
1.6.4

2009-09-15 15:54:54

by Anirban Sinha

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function

>
>Here you go!
>

Thanks Linus for committing the patch.

Ani

2009-09-15 17:27:15

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] cleanup legacy console_print function

On Monday 14 September 2009 12:28:21 pm Anirban Sinha wrote:
> From e096c1774450f8348a7af3b7e47800710a490212 Mon Sep 17 00:00:00 2001
> From: Anirban Sinha <[email protected]>
> Date: Mon, 14 Sep 2009 11:13:37 -0700
> Subject: cleanup console_print()
>
> console_print() is an old legacy interface mostly unused in the entire
> kernel tree. It's best to clean up its existing use and let developers
> use their own implementation of it as they feel fit.

This broke the ia64 build, please fix:

arch/ia64/kernel/head.h: Assembler messages:
arch/ia64/kernel/head.h:1: Error: Unknown opcode `extern void console_print(const char*s)'
make[1]: *** [arch/ia64/kernel/head.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Bjorn


> ---
> arch/ia64/kernel/head.S | 1 +
> arch/ia64/kernel/head.h | 1 +
> arch/ia64/kernel/process.c | 7 +++++++
> drivers/char/serial167.c | 5 ++---
> include/linux/dtlk.h | 19 -------------------
> include/linux/tty.h | 4 ----
> kernel/printk.c | 6 ------
> 7 files changed, 11 insertions(+), 32 deletions(-)
> create mode 100644 arch/ia64/kernel/head.h
>
> diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
> index 23f846d..e6c5c3d 100644
> --- a/arch/ia64/kernel/head.S
> +++ b/arch/ia64/kernel/head.S
> @@ -34,6 +34,7 @@
> #include <asm/mca_asm.h>
> #include <linux/init.h>
> #include <linux/linkage.h>
> +#include "head.h"
>
> #ifdef CONFIG_HOTPLUG_CPU
> #define SAL_PSR_BITS_TO_SET \
> diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
> new file mode 100644
> index 0000000..2e2ac68
> --- /dev/null
> +++ b/arch/ia64/kernel/head.h
> @@ -0,0 +1 @@
> +extern void console_print(const char *s);
> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
> index 89969e9..b34bef7 100644
> --- a/arch/ia64/kernel/process.c
> +++ b/arch/ia64/kernel/process.c
> @@ -161,6 +161,13 @@ show_regs (struct pt_regs *regs)
> show_stack(NULL, NULL);
> }
>
> +/* local support for deprecated console_print */
> +void
> +console_print(const char *s)
> +{
> + printk(KERN_EMERG "%s", s);
> +}
> +
> void
> do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long
> in_syscall)
> {
> diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
> index 51e7a46..5942a9d 100644
> --- a/drivers/char/serial167.c
> +++ b/drivers/char/serial167.c
> @@ -171,7 +171,6 @@ static int startup(struct cyclades_port *);
> static void cy_throttle(struct tty_struct *);
> static void cy_unthrottle(struct tty_struct *);
> static void config_setup(struct cyclades_port *);
> -extern void console_print(const char *);
> #ifdef CYCLOM_SHOW_STATUS
> static void show_status(int);
> #endif
> @@ -245,7 +244,7 @@ void SP(char *data)
> {
> unsigned long flags;
> local_irq_save(flags);
> - console_print(data);
> + printk(KERN_EMERG "%s", data);
> local_irq_restore(flags);
> }
>
> @@ -255,7 +254,7 @@ void CP(char data)
> unsigned long flags;
> local_irq_save(flags);
> scrn[0] = data;
> - console_print(scrn);
> + printk(KERN_EMERG "%c", scrn);
> local_irq_restore(flags);
> } /* CP */
>
> diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h
> index 2896d90..22a7b9a 100644
> --- a/include/linux/dtlk.h
> +++ b/include/linux/dtlk.h
> @@ -1,22 +1,3 @@
> -#if 0
> -
> -#define TRACE_TXT(text) \
> - { \
> - if(dtlk_trace) \
> - { \
> - console_print(text); \
> - console_print("\n"); \
> - } \
> - }
> -
> -#define TRACE_CHR(chr) \
> - { \
> - if(dtlk_trace) \
> - console_print(chr); \
> - } \
> -
> -#endif
> -
> #define DTLK_MINOR 0
> #define DTLK_IO_EXTENT 0x02
>
> diff --git a/include/linux/tty.h b/include/linux/tty.h
> index 0d3974f..a916a31 100644
> --- a/include/linux/tty.h
> +++ b/include/linux/tty.h
> @@ -519,10 +519,6 @@ extern void serial_console_init(void);
>
> extern int pcxe_open(struct tty_struct *tty, struct file *filp);
>
> -/* printk.c */
> -
> -extern void console_print(const char *);
> -
> /* vt.c */
>
> extern int vt_ioctl(struct tty_struct *tty, struct file *file,
> diff --git a/kernel/printk.c b/kernel/printk.c
> index e10d193..602033a 100644
> --- a/kernel/printk.c
> +++ b/kernel/printk.c
> @@ -1075,12 +1075,6 @@ void __sched console_conditional_schedule(void)
> }
> EXPORT_SYMBOL(console_conditional_schedule);
>
> -void console_print(const char *s)
> -{
> - printk(KERN_EMERG "%s", s);
> -}
> -EXPORT_SYMBOL(console_print);
> -
> void console_unblank(void)
> {
> struct console *c;

2009-09-15 17:55:56

by Anirban Sinha

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function

Oops! Sorry for breaking the build. I do not have a intel 64 machine to
try my change. However, I believe this will help:

diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
index 2e2ac68..e762125 100644
--- a/arch/ia64/kernel/head.h
+++ b/arch/ia64/kernel/head.h
@@ -1 +1,3 @@
+#ifndef __ASSEMBLY__
extern void console_print(const char *s);
+#endif


Can you please try this patch and test if this fixed it. If it does, I
will go ahead, commit the change locally and post the final patch.

Ani


>-----Original Message-----
>From: Bjorn Helgaas [mailto:[email protected]]
>Sent: Tuesday, September 15, 2009 10:27 AM
>To: Anirban Sinha
>Cc: Linus Torvalds; [email protected]; Randy Dunlap; linux-
>[email protected]; Luck, Tony
>Subject: Re: [PATCH] cleanup legacy console_print function
>
>On Monday 14 September 2009 12:28:21 pm Anirban Sinha wrote:
>> From e096c1774450f8348a7af3b7e47800710a490212 Mon Sep 17 00:00:00
2001
>> From: Anirban Sinha <[email protected]>
>> Date: Mon, 14 Sep 2009 11:13:37 -0700
>> Subject: cleanup console_print()
>>
>> console_print() is an old legacy interface mostly unused in the
entire
>> kernel tree. It's best to clean up its existing use and let
developers
>> use their own implementation of it as they feel fit.
>
>This broke the ia64 build, please fix:
>
>arch/ia64/kernel/head.h: Assembler messages:
>arch/ia64/kernel/head.h:1: Error: Unknown opcode `extern void
>console_print(const char*s)'
>make[1]: *** [arch/ia64/kernel/head.o] Error 1
>make[1]: *** Waiting for unfinished jobs....
>
>Bjorn
>
>
>> ---
>> arch/ia64/kernel/head.S | 1 +
>> arch/ia64/kernel/head.h | 1 +
>> arch/ia64/kernel/process.c | 7 +++++++
>> drivers/char/serial167.c | 5 ++---
>> include/linux/dtlk.h | 19 -------------------
>> include/linux/tty.h | 4 ----
>> kernel/printk.c | 6 ------
>> 7 files changed, 11 insertions(+), 32 deletions(-)
>> create mode 100644 arch/ia64/kernel/head.h
>>
>> diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
>> index 23f846d..e6c5c3d 100644
>> --- a/arch/ia64/kernel/head.S
>> +++ b/arch/ia64/kernel/head.S
>> @@ -34,6 +34,7 @@
>> #include <asm/mca_asm.h>
>> #include <linux/init.h>
>> #include <linux/linkage.h>
>> +#include "head.h"
>>
>> #ifdef CONFIG_HOTPLUG_CPU
>> #define SAL_PSR_BITS_TO_SET \
>> diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
>> new file mode 100644
>> index 0000000..2e2ac68
>> --- /dev/null
>> +++ b/arch/ia64/kernel/head.h
>> @@ -0,0 +1 @@
>> +extern void console_print(const char *s);
>> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
>> index 89969e9..b34bef7 100644
>> --- a/arch/ia64/kernel/process.c
>> +++ b/arch/ia64/kernel/process.c
>> @@ -161,6 +161,13 @@ show_regs (struct pt_regs *regs)
>> show_stack(NULL, NULL);
>> }
>>
>> +/* local support for deprecated console_print */
>> +void
>> +console_print(const char *s)
>> +{
>> + printk(KERN_EMERG "%s", s);
>> +}
>> +
>> void
>> do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long
>> in_syscall)
>> {
>> diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
>> index 51e7a46..5942a9d 100644
>> --- a/drivers/char/serial167.c
>> +++ b/drivers/char/serial167.c
>> @@ -171,7 +171,6 @@ static int startup(struct cyclades_port *);
>> static void cy_throttle(struct tty_struct *);
>> static void cy_unthrottle(struct tty_struct *);
>> static void config_setup(struct cyclades_port *);
>> -extern void console_print(const char *);
>> #ifdef CYCLOM_SHOW_STATUS
>> static void show_status(int);
>> #endif
>> @@ -245,7 +244,7 @@ void SP(char *data)
>> {
>> unsigned long flags;
>> local_irq_save(flags);
>> - console_print(data);
>> + printk(KERN_EMERG "%s", data);
>> local_irq_restore(flags);
>> }
>>
>> @@ -255,7 +254,7 @@ void CP(char data)
>> unsigned long flags;
>> local_irq_save(flags);
>> scrn[0] = data;
>> - console_print(scrn);
>> + printk(KERN_EMERG "%c", scrn);
>> local_irq_restore(flags);
>> } /* CP */
>>
>> diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h
>> index 2896d90..22a7b9a 100644
>> --- a/include/linux/dtlk.h
>> +++ b/include/linux/dtlk.h
>> @@ -1,22 +1,3 @@
>> -#if 0
>> -
>> -#define TRACE_TXT(text) \
>> - { \
>> - if(dtlk_trace) \
>> - { \
>> - console_print(text); \
>> - console_print("\n"); \
>> - } \
>> - }
>> -
>> -#define TRACE_CHR(chr) \
>> - { \
>> - if(dtlk_trace) \
>> - console_print(chr); \
>> - } \
>> -
>> -#endif
>> -
>> #define DTLK_MINOR 0
>> #define DTLK_IO_EXTENT 0x02
>>
>> diff --git a/include/linux/tty.h b/include/linux/tty.h
>> index 0d3974f..a916a31 100644
>> --- a/include/linux/tty.h
>> +++ b/include/linux/tty.h
>> @@ -519,10 +519,6 @@ extern void serial_console_init(void);
>>
>> extern int pcxe_open(struct tty_struct *tty, struct file *filp);
>>
>> -/* printk.c */
>> -
>> -extern void console_print(const char *);
>> -
>> /* vt.c */
>>
>> extern int vt_ioctl(struct tty_struct *tty, struct file *file,
>> diff --git a/kernel/printk.c b/kernel/printk.c
>> index e10d193..602033a 100644
>> --- a/kernel/printk.c
>> +++ b/kernel/printk.c
>> @@ -1075,12 +1075,6 @@ void __sched
console_conditional_schedule(void)
>> }
>> EXPORT_SYMBOL(console_conditional_schedule);
>>
>> -void console_print(const char *s)
>> -{
>> - printk(KERN_EMERG "%s", s);
>> -}
>> -EXPORT_SYMBOL(console_print);
>> -
>> void console_unblank(void)
>> {
>> struct console *c;
>

2009-09-15 18:00:33

by Luck, Tony

[permalink] [raw]
Subject: Re: [PATCH] cleanup legacy console_print function

> --- a/arch/ia64/kernel/head.h
> +++ b/arch/ia64/kernel/head.h
> @@ -1 +1,3 @@
> +#ifndef __ASSEMBLY__
> ?extern void console_print(const char *s);
> +#endif

Umm. Your new file "head.h" is only included by head.S ... perhaps it would be
better to delete head.h entirely and drop the #include from head.S?

-Tony

2009-09-15 18:10:03

by Anirban Sinha

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function


>Umm. Your new file "head.h" is only included by head.S ... perhaps it
>would be
>better to delete head.h entirely and drop the #include from head.S?
>

Will it resolve the function symbol though? I dunno.

I can drop the head.h completely and add:

#ifndef __ASSEMBLY__
extern void console_print(const char *s);
#endif

to head.S if that is a better option.

Ani

2009-09-15 18:11:05

by Luck, Tony

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function

> Will it resolve the function symbol though? I dunno.
>
> I can drop the head.h completely and add:
>
> #ifndef __ASSEMBLY__
> extern void console_print(const char *s);
> #endif
>
> to head.S if that is a better option.

head.S is in assembler (hence the ".S" suffix). So adding
code wrapped inside #ifndef __ASSEMBLY__ to it would be a
no-op.

On ia64 (and I think most other assemblers) it is not
necessary to provide any kind of "extern" declaration
before using external symbols.

-Tony

2009-09-15 18:25:29

by Anirban Sinha

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function

>On ia64 (and I think most other assemblers) it is not
>necessary to provide any kind of "extern" declaration
>before using external symbols.


Ok, here goes:

From: Anirban Sinha <[email protected]>
Date: Tue, 15 Sep 2009 11:19:29 -0700
Subject: Fix ia64 build breakage.

On ia64 it is not necessary to provide any kind of "extern" declaration
before using external symbols.


Signed-off-by: Anirban Sinha <[email protected]>
---
arch/ia64/kernel/head.S | 1 -
arch/ia64/kernel/head.h | 1 -
arch/ia64/kernel/process.c | 2 +-
3 files changed, 1 insertions(+), 3 deletions(-)
delete mode 100644 arch/ia64/kernel/head.h

diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index e6c5c3d..23f846d 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -34,7 +34,6 @@
#include <asm/mca_asm.h>
#include <linux/init.h>
#include <linux/linkage.h>
-#include "head.h"

#ifdef CONFIG_HOTPLUG_CPU
#define SAL_PSR_BITS_TO_SET \
diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
deleted file mode 100644
index 2e2ac68..0000000
--- a/arch/ia64/kernel/head.h
+++ /dev/null
@@ -1 +0,0 @@
-extern void console_print(const char *s);
--
1.6.4

2009-09-15 18:39:26

by Luck, Tony

[permalink] [raw]
Subject: Re: [PATCH] cleanup legacy console_print function

On Tue, Sep 15, 2009 at 11:25 AM, Anirban Sinha
<[email protected]> wrote:
> ?arch/ia64/kernel/head.S ? ?| ? ?1 -
> ?arch/ia64/kernel/head.h ? ?| ? ?1 -
> ?arch/ia64/kernel/process.c | ? ?2 +-
> ?3 files changed, 1 insertions(+), 3 deletions(-)

The diffstat doesn't match the patch (doesn't include a change to
process.c) ... but the patch itself is OK.

Acked-by: Tony Luck <[email protected]>

2009-09-15 19:09:07

by Anirban Sinha

[permalink] [raw]
Subject: RE: [PATCH] cleanup legacy console_print function

>
>The diffstat doesn't match the patch (doesn't include a change to
>process.c) ... but the patch itself is OK.
>
>Acked-by: Tony Luck <[email protected]>

Yeah, my bad. I had a local change in that file which I also committed.
Anyway, here it is again:


Subject: Fix ia64 build breakage.

On ia64 it is not necessary to provide any kind of "extern" declaration
before using external symbols.

Signed-off-by: Anirban Sinha <[email protected]>
Acked-by: Tony Luck <[email protected]>
---
arch/ia64/kernel/head.S | 1 -
arch/ia64/kernel/head.h | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
delete mode 100644 arch/ia64/kernel/head.h

diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index e6c5c3d..23f846d 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -34,7 +34,6 @@
#include <asm/mca_asm.h>
#include <linux/init.h>
#include <linux/linkage.h>
-#include "head.h"

#ifdef CONFIG_HOTPLUG_CPU
#define SAL_PSR_BITS_TO_SET \
diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
deleted file mode 100644
index 2e2ac68..0000000
--- a/arch/ia64/kernel/head.h
+++ /dev/null
@@ -1 +0,0 @@
-extern void console_print(const char *s);
--
1.6.4