Skip to contentSkip to conversation

serial.h v serial_core.h PORT_ defines?

DISCUSSION Dr. David Alan Gilbert 2 participants 2 messages Aug 27, 2010 – Aug 31, 2010 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

Hi,
I was playing with sparse and it flagged that in drivers/serial/8250.c
there is a duplicate initialiser in the uart_config[] array (from Linus's git):

       [PORT_NS16550A] = {
                .name           = "NS16550A",
                .fifo_size      = 16,
                .tx_loadsz      = 16,
                .fcr            = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
                .flags          = UART_CAP_FIFO | UART_NATSEMI,
        },

and

       [PORT_U6_16550A] = {
                .name           = "U6_16550A",
                .fifo_size      = 64,
                .tx_loadsz      = 64,
                .fcr            = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
                .flags          = UART_CAP_FIFO | UART_CAP_AFE,
        },

now PORT_NS16550A is defined as 14 in serial_core.h:

#define PORT_NS16550A 14

and PORT_U6_16550A is defined as 14 in serial.h:

235dae5d (Philippe Langlais 2010-07-29 17:13:57 +0200 80) #define PORT_U6_16550A 14

I guess that might subtly break NS16550A users?

My assumption is that Philippe's addition should actually be to the serial_core.h list which currently goes upto 18.

However, that leaves the question of why is there a set of nearly but not quite idential defines in serial.h and serial_core.h?

(please leave me on cc for replies)

Dave

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\ gro.gilbert @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#1 lore raw

Hi,
You are right.
I'll add my define in serial_core.h (#19), and withdraw U6_16550A definition in serial.h. I'll post a patch to fix it.
I have the same question about these double definitions.

Thanks

Philippe

Quoted 42 lines · Dr. David Alan Gilbert

Hi,
I was playing with sparse and it flagged that in drivers/serial/8250.c
there is a duplicate initialiser in the uart_config[] array (from Linus's git):

        [PORT_NS16550A] = {
                 .name           = "NS16550A",
                 .fifo_size      = 16,
                 .tx_loadsz      = 16,
                 .fcr            = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
                 .flags          = UART_CAP_FIFO | UART_NATSEMI,
         },

and

        [PORT_U6_16550A] = {
                 .name           = "U6_16550A",
                 .fifo_size      = 64,
                 .tx_loadsz      = 64,
                 .fcr            = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
                 .flags          = UART_CAP_FIFO | UART_CAP_AFE,
         },

now PORT_NS16550A is defined as 14 in serial_core.h:

#define PORT_NS16550A 14

and PORT_U6_16550A is defined as 14 in serial.h:

235dae5d (Philippe Langlais 2010-07-29 17:13:57 +0200 80) #define PORT_U6_16550A 14

I guess that might subtly break NS16550A users?

My assumption is that Philippe's addition should actually be to the serial_core.h list which currently goes upto 18.

However, that leaves the question of why is there a set of nearly but not quite idential defines in serial.h and serial_core.h?

(please leave me on cc for replies)

Dave