Skip to contentSkip to conversation

x86: earlyprintk cleanup

PATCH In review Alexander Kuleshov 2 participants 6 messages Jan 19, 2015 – Jan 20, 2015 x86

lore
Share & tools
lore
#0 lore raw

cover x86: earlyprintk cleanup

The following two patches remove unused macro definitions from early_serial_console and early_printk x86 code.

Alexander Kuleshov (2):
x86/early_serial_console: remove unused definitions x86/early_printk: remove unused definitions

 arch/x86/boot/early_serial_console.c | 5 -----
 arch/x86/kernel/early_printk.c       | 3 ---
 2 files changed, 8 deletions(-)
Signature · 1 line
2.3.0.rc0.44.ga94655d.dirty
#1 lore raw

PATCH 1/2 x86/early_serial_console: remove unused definitions

TXR, RXR, IIR, LSR and MSR are not used anywhere

---
 arch/x86/boot/early_serial_console.c | 5 -----
 1 file changed, 5 deletions(-)
arch/x86/boot/early_serial_console.c +0 -5
index 5df2869..9176135 100644
@@ -6,15 +6,10 @@
 
 #define DLAB		0x80
 
-#define TXR             0       /*  Transmit register (WRITE) */
-#define RXR             0       /*  Receive register  (READ)  */
 #define IER             1       /*  Interrupt Enable          */
-#define IIR             2       /*  Interrupt ID              */
 #define FCR             2       /*  FIFO control              */
 #define LCR             3       /*  Line control              */
 #define MCR             4       /*  Modem control             */
-#define LSR             5       /*  Line Status               */
-#define MSR             6       /*  Modem Status              */
 #define DLL             0       /*  Divisor Latch Low         */
 #define DLH             1       /*  Divisor latch High        */
 
Signature · 1 line
2.3.0.rc0.44.ga94655d.dirty
#2 lore raw

PATCH 2/2 x86/early_printk: remove unused definitions

In reply to Alexander Kuleshov

RXR, IIR and MSR are not used

---
 arch/x86/kernel/early_printk.c | 3 ---
 1 file changed, 3 deletions(-)
arch/x86/kernel/early_printk.c +0 -3
index 01d1c18..e8f317f 100644
@@ -83,14 +83,11 @@ static int early_serial_base = 0x3f8;  /* ttyS0 */
 #define DLAB		0x80
 
 #define TXR             0       /*  Transmit register (WRITE) */
-#define RXR             0       /*  Receive register  (READ)  */
 #define IER             1       /*  Interrupt Enable          */
-#define IIR             2       /*  Interrupt ID              */
 #define FCR             2       /*  FIFO control              */
 #define LCR             3       /*  Line control              */
 #define MCR             4       /*  Modem control             */
 #define LSR             5       /*  Line Status               */
-#define MSR             6       /*  Modem Status              */
 #define DLL             0       /*  Divisor Latch Low         */
 #define DLH             1       /*  Divisor latch High        */
 
Signature · 1 line
2.3.0.rc0.44.ga94655d.dirty
#3 lore raw
In reply to Alexander Kuleshov
Quoted 2 lines · Alexander Kuleshov

The following two patches remove unused macro definitions from early_serial_console and early_printk x86 code.

Sigh. These mechanical 'follow the output of some code analyzer' changes are really horrible.

Why not doing the obvious: Move the duplicated defines into a common header file and be done with it?

And if you look deeper, then you'll notice that those defines are used in two other files as well.

What's worse is that the whole set of defines is readily available in include/uapi/linux/serial_reg.h already (just with different symbols).

So what's the point of these removal patches?

Thanks,

tglx

#4 lore raw

Hello Thomas,

2015-01-20 16:29 GMT+06:00 Thomas Gleixner <[email protected]>:

Quoted 11 lines · Alexander Kuleshov
Quoted 3 lines

The following two patches remove unused macro definitions from early_serial_console and early_printk x86 code.

Sigh. These mechanical 'follow the output of some code analyzer' changes are really horrible.

Why not doing the obvious: Move the duplicated defines into a common header file and be done with it?

Quoted 8 lines

And if you look deeper, then you'll notice that those defines are used in two other files as well.

What's worse is that the whole set of defines is readily available in include/uapi/linux/serial_reg.h already (just with different symbols).

So what's the point of these removal patches?

To get rid of unused code. Will it be better to move general serial definitions to the arch/x86/include/asm/serial.h? Or it is wrong place...

Thank you.

#5 lore raw
Quoted 18 lines · Alexander Kuleshov

2015-01-20 16:29 GMT+06:00 Thomas Gleixner <[email protected]>:

Quoted 17 lines · Alexander Kuleshov
Quoted 3 lines

The following two patches remove unused macro definitions from early_serial_console and early_printk x86 code.

Sigh. These mechanical 'follow the output of some code analyzer' changes are really horrible.

Why not doing the obvious: Move the duplicated defines into a common header file and be done with it?

And if you look deeper, then you'll notice that those defines are used in two other files as well.

What's worse is that the whole set of defines is readily available in include/uapi/linux/serial_reg.h already (just with different symbols).

Quoted 6 lines
Quoted 2 lines

So what's the point of these removal patches?

To get rid of unused code. Will it be better to move general serial definitions to the arch/x86/include/asm/serial.h? Or it is wrong place...

Care to read what I wrote before?