Re: [U-Boot] [PATCH 65/72] serial: ns16550: Rename serial.c to serial_ns16550.c

2012-10-02 Thread Michal Simek

On 10/01/2012 06:52 PM, Tom Rini wrote:

On Sat, Sep 29, 2012 at 11:52:58PM +0200, Marek Vasut wrote:


This serial driver had wrong name of the source file for some time
now. The name of the driver was serial.c instead of any more logical
and fitting name. Thus, rename the driver source file to serial_ns16550.c
and be done with it.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Marek Vasut marek.va...@gmail.com
Cc: Tom Rini tr...@ti.com
Cc: Anatolij Gustschin ag...@denx.de
Cc: Stefan Roese s...@denx.de
Cc: Mike Frysinger vap...@gentoo.org
Cc: Michal Simek mon...@monstr.eu


After checking with Marek on IRC, this is a pure rename and he just
forgot -M -C when posting the series.  So while Michal's comments about
better formatting, etc, are true, it's beyond the scope of this just do
a rename patch.


No problem with that.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 65/72] serial: ns16550: Rename serial.c to serial_ns16550.c

2012-10-01 Thread Marek Vasut
Dear Michal Simek,

[...]
 
 Would it be better just use this structure?
 
 #ifdef CONFIG_SYS_NS16550_COM1
 [0] = (NS16550_t)CONFIG_SYS_NS16550_COM1,
 #endif
[...]

 
 You are using two coding styles in this file.
 One has function return value on one line and then function name
 and the second function return value on one line with function name.
 Will be good to unify it to look the same in the whole file.

Yes, wholeheartedly agree! But (!) I don't want to clean up this file in this 
patchset.

 Thanks,
 Michal

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 65/72] serial: ns16550: Rename serial.c to serial_ns16550.c

2012-10-01 Thread Tom Rini
On Sat, Sep 29, 2012 at 11:52:58PM +0200, Marek Vasut wrote:

 This serial driver had wrong name of the source file for some time
 now. The name of the driver was serial.c instead of any more logical
 and fitting name. Thus, rename the driver source file to serial_ns16550.c
 and be done with it.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Marek Vasut marek.va...@gmail.com
 Cc: Tom Rini tr...@ti.com
 Cc: Anatolij Gustschin ag...@denx.de
 Cc: Stefan Roese s...@denx.de
 Cc: Mike Frysinger vap...@gentoo.org
 Cc: Michal Simek mon...@monstr.eu

After checking with Marek on IRC, this is a pure rename and he just
forgot -M -C when posting the series.  So while Michal's comments about
better formatting, etc, are true, it's beyond the scope of this just do
a rename patch.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 65/72] serial: ns16550: Rename serial.c to serial_ns16550.c

2012-09-30 Thread Michal Simek

On 09/29/2012 11:52 PM, Marek Vasut wrote:

This serial driver had wrong name of the source file for some time
now. The name of the driver was serial.c instead of any more logical
and fitting name. Thus, rename the driver source file to serial_ns16550.c
and be done with it.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Marek Vasut marek.va...@gmail.com
Cc: Tom Rini tr...@ti.com
Cc: Anatolij Gustschin ag...@denx.de
Cc: Stefan Roese s...@denx.de
Cc: Mike Frysinger vap...@gentoo.org
Cc: Michal Simek mon...@monstr.eu
---
  drivers/serial/Makefile |2 +-
  drivers/serial/serial.c |  359 ---
  drivers/serial/serial_ns16550.c |  359 +++
  3 files changed, 360 insertions(+), 360 deletions(-)
  delete mode 100644 drivers/serial/serial.c
  create mode 100644 drivers/serial/serial_ns16550.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 65d0f23..d93e81b 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -37,7 +37,7 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
  COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
  COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
  COBJS-$(CONFIG_S5P) += serial_s5p.o
-COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
+COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
  COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
  COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
  COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
deleted file mode 100644
index 00ad97c..000
--- a/drivers/serial/serial.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. r...@flyingpig.com.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include common.h
-#include linux/compiler.h
-
-#include ns16550.h
-#ifdef CONFIG_NS87308
-#include ns87308.h
-#endif
-
-#if defined (CONFIG_SERIAL_MULTI)
-#include serial.h
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#if !defined(CONFIG_CONS_INDEX)
-#if defined (CONFIG_SERIAL_MULTI)
-/*   with CONFIG_SERIAL_MULTI we might have no console
- *  on these devices
- */
-#else
-#error No console index specified.
-#endif /* CONFIG_SERIAL_MULTI */
-#elif (CONFIG_CONS_INDEX  1) || (CONFIG_CONS_INDEX  4)
-#error Invalid console index value.
-#endif
-
-#if CONFIG_CONS_INDEX == 1  !defined(CONFIG_SYS_NS16550_COM1)
-#error Console port 1 defined but not configured.
-#elif CONFIG_CONS_INDEX == 2  !defined(CONFIG_SYS_NS16550_COM2)
-#error Console port 2 defined but not configured.
-#elif CONFIG_CONS_INDEX == 3  !defined(CONFIG_SYS_NS16550_COM3)
-#error Console port 3 defined but not configured.
-#elif CONFIG_CONS_INDEX == 4  !defined(CONFIG_SYS_NS16550_COM4)
-#error Console port 4 defined but not configured.
-#endif
-
-/* Note: The port number specified in the functions is 1 based.
- *  the array is 0 based.
- */
-static NS16550_t serial_ports[4] = {
-#ifdef CONFIG_SYS_NS16550_COM1
-   (NS16550_t)CONFIG_SYS_NS16550_COM1,
-#else
-   NULL,
-#endif
-#ifdef CONFIG_SYS_NS16550_COM2
-   (NS16550_t)CONFIG_SYS_NS16550_COM2,
-#else
-   NULL,
-#endif
-#ifdef CONFIG_SYS_NS16550_COM3
-   (NS16550_t)CONFIG_SYS_NS16550_COM3,
-#else
-   NULL,
-#endif
-#ifdef CONFIG_SYS_NS16550_COM4
-   (NS16550_t)CONFIG_SYS_NS16550_COM4
-#else
-   NULL
-#endif
-};
-
-#define PORT   serial_ports[port-1]
-
-#if defined(CONFIG_SERIAL_MULTI)
-
-/* Multi serial device functions */
-#define DECLARE_ESERIAL_FUNCTIONS(port) \
-int  eserial##port##_init (void) {\
-   int clock_divisor; \
-   clock_divisor = calc_divisor(serial_ports[port-1]); \
-   NS16550_init(serial_ports[port-1], clock_divisor); \
-   return(0);}\
-void eserial##port##_setbrg (void) {\
-   serial_setbrg_dev(port);}\
-int  eserial##port##_getc (void) {\
-   return serial_getc_dev(port);}\
-int  eserial##port##_tstc (void) {\
-   return serial_tstc_dev(port);}\
-void eserial##port##_putc (const char c) {\
-   serial_putc_dev(port, c);}\
-void eserial##port##_puts (const char *s) {\
-   serial_puts_dev(port, s);}
-
-/* Serial device descriptor */
-#define INIT_ESERIAL_STRUCTURE(port, __name) { \
- 

Re: [U-Boot] [PATCH 65/72] serial: ns16550: Rename serial.c to serial_ns16550.c

2012-09-30 Thread Marek Vasut
Dear Michal Simek,

[...]

 You are using two coding styles in this file.

Won't surprise me if there were even more.

 One has function return value on one line and then function name
 and the second function return value on one line with function name.
 Will be good to unify it to look the same in the whole file.

Yes, but definitelly not as a part of unintrusive conversion patch. This file 
has so much legacy and look so crappy it needs proper fixing. Patch is welcome 
%^)

 Thanks,
 Michal

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot