From patchwork Sat Sep 29 21:51:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 188066 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 09A082C00F5 for ; Sun, 30 Sep 2012 07:54:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E64328217; Sat, 29 Sep 2012 23:54:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q7UAQj56wEm1; Sat, 29 Sep 2012 23:54:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1194328236; Sat, 29 Sep 2012 23:53:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3E20281F4 for ; Sat, 29 Sep 2012 23:53:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pp0huijZZWir for ; Sat, 29 Sep 2012 23:53:16 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTPS id 770E8281DC for ; Sat, 29 Sep 2012 23:53:14 +0200 (CEST) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XTk5h1s0Jz3hhdt; Sat, 29 Sep 2012 23:53:12 +0200 (CEST) X-Auth-Info: bGvjbaKemGTMDpTf1hXbIiN4S71HYsZmFV+oCRSd2lw= Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3XTk5g6LcPzbbj2; Sat, 29 Sep 2012 23:53:11 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 29 Sep 2012 23:51:56 +0200 Message-Id: <1348955586-7109-4-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348955586-7109-1-git-send-email-marex@denx.de> References: <1348878687-14194-1-git-send-email-marex@denx.de> <1348955586-7109-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Stefan Roese , C Nauman , Tom Rini Subject: [U-Boot] [PATCH 03/72] serial: Properly spell out the structure member names of serial_driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Properly spell out the whole structure member names when an initialized varible is instantiated from the struct serial_driver. In case the structure definition for struct serial_driver undergoes reordering, there will be no impact on variables defined based on this structure. Signed-off-by: Marek Vasut Cc: Marek Vasut Cc: Tom Rini Cc: Anatolij Gustschin Cc: Stefan Roese Cc: Mike Frysinger Cc: C Nauman Cc: Minkyu Kang Cc: Michal Simek --- arch/powerpc/cpu/mpc512x/serial.c | 18 +++++++++--------- arch/powerpc/cpu/mpc5xxx/serial.c | 32 ++++++++++++++++---------------- arch/powerpc/cpu/mpc8xx/serial.c | 32 ++++++++++++++++---------------- board/logicpd/zoom2/zoom2_serial.h | 16 ++++++++-------- drivers/serial/serial.c | 19 ++++++++++--------- drivers/serial/serial_pxa.c | 16 ++++++++-------- drivers/serial/serial_s3c24x0.c | 18 +++++++++--------- drivers/serial/serial_s5p.c | 19 ++++++++++--------- drivers/serial/serial_xuartlite.c | 19 ++++++++++--------- 9 files changed, 96 insertions(+), 93 deletions(-) diff --git a/arch/powerpc/cpu/mpc512x/serial.c b/arch/powerpc/cpu/mpc512x/serial.c index 7c53346..f4f52ad 100644 --- a/arch/powerpc/cpu/mpc512x/serial.c +++ b/arch/powerpc/cpu/mpc512x/serial.c @@ -319,15 +319,15 @@ int serial_getcts_dev(unsigned int idx) serial_puts_dev(port, s); \ } -#define INIT_PSC_SERIAL_STRUCTURE(port, name) { \ - name, \ - serial##port##_init, \ - serial##port##_uninit, \ - serial##port##_setbrg, \ - serial##port##_getc, \ - serial##port##_tstc, \ - serial##port##_putc, \ - serial##port##_puts, \ +#define INIT_PSC_SERIAL_STRUCTURE(port, __name) { \ + .name = __name, \ + .start = serial##port##_init, \ + .stop = serial##port##_uninit, \ + .setbrg = serial##port##_setbrg, \ + .getc = serial##port##_getc, \ + .tstc = serial##port##_tstc, \ + .putc = serial##port##_putc, \ + .puts = serial##port##_puts, \ } #if defined(CONFIG_SYS_PSC1) diff --git a/arch/powerpc/cpu/mpc5xxx/serial.c b/arch/powerpc/cpu/mpc5xxx/serial.c index aa09f67..9bebff8 100644 --- a/arch/powerpc/cpu/mpc5xxx/serial.c +++ b/arch/powerpc/cpu/mpc5xxx/serial.c @@ -338,14 +338,14 @@ int serial1_tstc(void) struct serial_device serial0_device = { - "serial0", - serial0_init, - NULL, - serial0_setbrg, - serial0_getc, - serial0_tstc, - serial0_putc, - serial0_puts, + .name = "serial0", + .start = serial0_init, + .stop = NULL, + .setbrg = serial0_setbrg, + .getc = serial0_getc, + .tstc = serial0_tstc, + .putc = serial0_putc, + .puts = serial0_puts, }; __weak struct serial_device *default_serial_console(void) @@ -355,14 +355,14 @@ __weak struct serial_device *default_serial_console(void) struct serial_device serial1_device = { - "serial1", - serial1_init, - NULL, - serial1_setbrg, - serial1_getc, - serial1_tstc, - serial1_putc, - serial1_puts, + .name = "serial1", + .start = serial1_init, + .stop = NULL, + .setbrg = serial1_setbrg, + .getc = serial1_getc, + .tstc = serial1_tstc, + .putc = serial1_putc, + .puts = serial1_puts, }; #endif /* CONFIG_SERIAL_MULTI */ diff --git a/arch/powerpc/cpu/mpc8xx/serial.c b/arch/powerpc/cpu/mpc8xx/serial.c index 9239b24..dc9b323 100644 --- a/arch/powerpc/cpu/mpc8xx/serial.c +++ b/arch/powerpc/cpu/mpc8xx/serial.c @@ -390,14 +390,14 @@ smc_tstc(void) struct serial_device serial_smc_device = { - "serial_smc", - smc_init, - NULL, - smc_setbrg, - smc_getc, - smc_tstc, - smc_putc, - smc_puts, + .name = "serial_smc", + .start = smc_init, + .stop = NULL, + .setbrg = smc_setbrg, + .getc = smc_getc, + .tstc = smc_tstc, + .putc = smc_putc, + .puts = smc_puts, }; #endif /* CONFIG_8xx_CONS_SMC1 || CONFIG_8xx_CONS_SMC2 */ @@ -660,14 +660,14 @@ scc_tstc(void) struct serial_device serial_scc_device = { - "serial_scc", - scc_init, - NULL, - scc_setbrg, - scc_getc, - scc_tstc, - scc_putc, - scc_puts, + .name = "serial_scc", + .start = scc_init, + .stop = NULL, + .setbrg = scc_setbrg, + .getc = scc_getc, + .tstc = scc_tstc, + .putc = scc_putc, + .puts = scc_puts, }; #endif /* CONFIG_8xx_CONS_SCCx */ diff --git a/board/logicpd/zoom2/zoom2_serial.h b/board/logicpd/zoom2/zoom2_serial.h index 4e30587..61306be 100644 --- a/board/logicpd/zoom2/zoom2_serial.h +++ b/board/logicpd/zoom2/zoom2_serial.h @@ -61,14 +61,14 @@ int quad_tstc_##n(void) \ } \ struct serial_device zoom2_serial_device##n = \ { \ - N(n), \ - quad_init_##n, \ - NULL, \ - quad_setbrg_##n, \ - quad_getc_##n, \ - quad_tstc_##n, \ - quad_putc_##n, \ - quad_puts_##n, \ + .name = N(n), \ + .start = quad_init_##n, \ + .stop = NULL, \ + .setbrg = quad_setbrg_##n, \ + .getc = quad_getc_##n, \ + .tstc = quad_tstc_##n, \ + .putc = quad_putc_##n, \ + .puts = quad_puts_##n, \ }; #endif /* ZOOM2_SERIAL_H */ diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index b10bab7..9d92dee 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -106,15 +106,16 @@ static NS16550_t serial_ports[4] = { serial_puts_dev(port, s);} /* Serial device descriptor */ -#define INIT_ESERIAL_STRUCTURE(port, name) {\ - name,\ - eserial##port##_init,\ - NULL,\ - eserial##port##_setbrg,\ - eserial##port##_getc,\ - eserial##port##_tstc,\ - eserial##port##_putc,\ - eserial##port##_puts, } +#define INIT_ESERIAL_STRUCTURE(port, __name) { \ + .name = __name, \ + .start = eserial##port##_init, \ + .stop = NULL, \ + .setbrg = eserial##port##_setbrg, \ + .getc = eserial##port##_getc, \ + .tstc = eserial##port##_tstc, \ + .putc = eserial##port##_putc, \ + .puts = eserial##port##_puts, \ +} #endif /* CONFIG_SERIAL_MULTI */ diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c index a9976d7..97e3f36 100644 --- a/drivers/serial/serial_pxa.c +++ b/drivers/serial/serial_pxa.c @@ -269,14 +269,14 @@ void pxa_puts_dev(unsigned int uart_index, const char *s) #define pxa_uart_desc(uart) \ struct serial_device serial_##uart##_device = \ { \ - "serial_"#uart, \ - uart##_init, \ - NULL, \ - uart##_setbrg, \ - uart##_getc, \ - uart##_tstc, \ - uart##_putc, \ - uart##_puts, \ + .name = "serial_"#uart, \ + .start = uart##_init, \ + .stop = NULL, \ + .setbrg = uart##_setbrg, \ + .getc = uart##_getc, \ + .tstc = uart##_tstc, \ + .putc = uart##_putc, \ + .puts = uart##_puts, \ }; #define pxa_uart_multi(uart, UART) \ diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c index 12bcdd3..fa6aac0 100644 --- a/drivers/serial/serial_s3c24x0.c +++ b/drivers/serial/serial_s3c24x0.c @@ -69,15 +69,15 @@ DECLARE_GLOBAL_DATA_PTR; serial_puts_dev(port, s); \ } -#define INIT_S3C_SERIAL_STRUCTURE(port, name) { \ - name, \ - s3serial##port##_init, \ - NULL,\ - s3serial##port##_setbrg, \ - s3serial##port##_getc, \ - s3serial##port##_tstc, \ - s3serial##port##_putc, \ - s3serial##port##_puts, \ +#define INIT_S3C_SERIAL_STRUCTURE(port, __name) { \ + .name = __name, \ + .start = s3serial##port##_init, \ + .stop = NULL, \ + .setbrg = s3serial##port##_setbrg, \ + .getc = s3serial##port##_getc, \ + .tstc = s3serial##port##_tstc, \ + .putc = s3serial##port##_putc, \ + .puts = s3serial##port##_puts, \ } #endif /* CONFIG_SERIAL_MULTI */ diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index 6819bb0..43cbc4f 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -183,15 +183,16 @@ int s5p_serial##port##_tstc(void) { return serial_tstc_dev(port); } \ void s5p_serial##port##_putc(const char c) { serial_putc_dev(c, port); } \ void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); } -#define INIT_S5P_SERIAL_STRUCTURE(port, name) { \ - name, \ - s5p_serial##port##_init, \ - NULL, \ - s5p_serial##port##_setbrg, \ - s5p_serial##port##_getc, \ - s5p_serial##port##_tstc, \ - s5p_serial##port##_putc, \ - s5p_serial##port##_puts, } +#define INIT_S5P_SERIAL_STRUCTURE(port, __name) { \ + .name = __name, \ + .start = s5p_serial##port##_init, \ + .stop = NULL, \ + .setbrg = s5p_serial##port##_setbrg, \ + .getc = s5p_serial##port##_getc, \ + .tstc = s5p_serial##port##_tstc, \ + .putc = s5p_serial##port##_putc, \ + .puts = s5p_serial##port##_puts, \ +} DECLARE_S5P_SERIAL_FUNCTIONS(0); struct serial_device s5p_serial0_device = diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 2bdb68b..b3bb066 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -144,15 +144,16 @@ int serial_tstc(void) { uartlite_serial_puts(s, port); } /* Serial device descriptor */ -#define INIT_ESERIAL_STRUCTURE(port, name) {\ - name,\ - userial##port##_init,\ - NULL,\ - userial##port##_setbrg,\ - userial##port##_getc,\ - userial##port##_tstc,\ - userial##port##_putc,\ - userial##port##_puts, } +#define INIT_ESERIAL_STRUCTURE(port, __name) { \ + .name = __name, \ + .start = userial##port##_init, \ + .stop = NULL, \ + .setbrg = userial##port##_setbrg, \ + .getc = userial##port##_getc, \ + .tstc = userial##port##_tstc, \ + .putc = userial##port##_putc, \ + .puts = userial##port##_puts, \ +} DECLARE_ESERIAL_FUNCTIONS(0); struct serial_device uartlite_serial0_device =