Re: [PATCH] Macintosh: fix brace and trailing statement coding style issues in adb-iop.c This is a patch to the adb-iop.c file that cleans up brace and trailing statement warnings found by the checkpa

2010-03-21 Thread fthain


 On Tue, Mar 09, 2010 at 01:46:20PM -0800, Michael Beardsworth wrote:

 ...
   
   #ifdef DEBUG_ADB_IOP
  -   printk(adb_iop_listen %p: rcvd packet, %d bytes: %02X %02X, req,
  -   (uint) amsg-count + 2, (uint) amsg-flags, (uint) amsg-cmd);
  +   printk(KERN_WARNING adb_iop_listen %p: rcvd packet, %d bytes: %02X 
  %02X,
  +   req, (uint) amsg-count + 2, (uint) amsg-flags, (uint) 
  amsg-cmd);
  for (i = 0; i  amsg-count; i++)
  printk( %02X, (uint) amsg-data[i]);
  printk(\n);

 ...
   #ifdef DEBUG_ADB_IOP
  -   printk(adb_iop_start %p: sending packet, %d bytes:, req, req-nbytes);
  +   printk(KERN_WARNING adb_iop_start %p: sending packet, %d bytes:, req, 
  req-nbytes);
  for (i = 0 ; i  req-nbytes ; i++)
  printk( %02X, (uint) req-data[i]);
  printk(\n);

KERN_DEBUG is used for debugging messages, not KERN_WARNING.

Finn
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


madness, was Re: [PATCH 2/2] Macintosh: fix coding style issues in adb.c This is a patch to the adb.c file that cleans up many warnings found by the checkpatch.pl tool

2010-03-09 Thread fthain

On Tue, 9 Mar 2010, Michael Beardsworth wrote:

 - /* If a probe is in progress or we are sleeping, wait for it to 
 complete */
 + /* If a probe is in progress or we are sleeping, wait until complete */

If you must fix what aint broke, please try not to damage it. I'm sorry 
if your VT52 is limited to 80 cols, but IMNSHO this sort of effort is 
misguided.

Maybe I could point out again (I do this periodically) that checkpatch.pl 
is great but code that fails it is NOT always wrong.

Check patch is a good idea but check existing code is a waste of 
everyone's time.

Finn
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


ping, was Re: [PATCH 1/2] pmac-zilog: add platform driver, version 3

2010-01-30 Thread fthain

Hi Geert,

As I understand it, this patch needs Ben's ack before it (and the others) 
can be merged into linux-next (?)

Finn

On Thu, 14 Jan 2010, Geert Uytterhoeven wrote:

 Thanks, applied.
 
 Gr{oetje,eeting}s,
 
   Geert
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/2] pmac-zilog: add platform driver, version 2

2010-01-10 Thread fthain

Add platform driver support to the pmac-zilog driver, for m68k macs.
Place the powermac-specific code inside #ifdef CONFIG_PPC_PMAC.

This patch should be applied after [PATCH 3/13] pmac-zilog: cleanup.

Signed-off-by: Finn Thain fth...@telegraphics.com.au

---

Version 2 of this patch adopts Geert's suggestions: make better use of
dev_{dbg,err,info} macros, change platform_driver_register() to
platform_driver_probe(), and use __init and __exit attributes.

 arch/m68k/configs/mac_defconfig   |5 +
 arch/m68k/configs/multi_defconfig |5 +
 drivers/serial/Kconfig|   12 +-
 drivers/serial/pmac_zilog.c   |  158 +-
 drivers/serial/pmac_zilog.h   |   14 +++
 5 files changed, 168 insertions(+), 26 deletions(-)

Index: linux-2.6.31/drivers/serial/Kconfig
===
--- linux-2.6.31.orig/drivers/serial/Kconfig2010-01-10 13:13:55.0 
+1100
+++ linux-2.6.31/drivers/serial/Kconfig 2010-01-10 13:14:18.0 +1100
@@ -1079,12 +1079,12 @@ config SERIAL_68360
default y
 
 config SERIAL_PMACZILOG
-   tristate PowerMac z85c30 ESCC support
-   depends on PPC_OF  PPC_PMAC
+   tristate Mac or PowerMac z85c30 ESCC support
+   depends on (M68K  MAC) || (PPC_OF  PPC_PMAC)
select SERIAL_CORE
help
  This driver supports the Zilog z85C30 serial ports found on
- PowerMac machines.
+ (Power)Mac machines.
  Say Y or M if you want to be able to these serial ports.
 
 config SERIAL_PMACZILOG_TTYS
@@ -1109,16 +1109,16 @@ config SERIAL_PMACZILOG_TTYS
  unable to use the 8250 module for PCMCIA or other 16C550-style
  UARTs.
 
- Say N unless you need the z85c30 ports on your powermac
+ Say N unless you need the z85c30 ports on your (Power)Mac
  to appear as /dev/ttySn.
 
 config SERIAL_PMACZILOG_CONSOLE
-   bool Console on PowerMac z85c30 serial port
+   bool Console on Mac or PowerMac z85c30 serial port
depends on SERIAL_PMACZILOG=y
select SERIAL_CORE_CONSOLE
help
  If you would like to be able to use the z85c30 serial port
- on your PowerMac as the console, you can do so by answering
+ on your (Power)Mac as the console, you can do so by answering
  Y to this option.
 
 config SERIAL_LH7A40X
Index: linux-2.6.31/arch/m68k/configs/mac_defconfig
===
--- linux-2.6.31.orig/arch/m68k/configs/mac_defconfig   2010-01-10 
13:13:55.0 +1100
+++ linux-2.6.31/arch/m68k/configs/mac_defconfig2010-01-10 
13:13:57.0 +1100
@@ -701,6 +701,11 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_TTYS=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
Index: linux-2.6.31/arch/m68k/configs/multi_defconfig
===
--- linux-2.6.31.orig/arch/m68k/configs/multi_defconfig 2010-01-10 
13:13:55.0 +1100
+++ linux-2.6.31/arch/m68k/configs/multi_defconfig  2010-01-10 
13:13:57.0 +1100
@@ -822,6 +822,11 @@ CONFIG_A2232=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_TTYS=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
Index: linux-2.6.31/drivers/serial/pmac_zilog.c
===
--- linux-2.6.31.orig/drivers/serial/pmac_zilog.c   2010-01-10 
13:13:55.0 +1100
+++ linux-2.6.31/drivers/serial/pmac_zilog.c2010-01-10 13:13:57.0 
+1100
@@ -63,11 +63,18 @@
 #include asm/sections.h
 #include asm/io.h
 #include asm/irq.h
+
+#ifdef CONFIG_PPC_PMAC
 #include asm/prom.h
 #include asm/machdep.h
 #include asm/pmac_feature.h
 #include asm/dbdma.h
 #include asm/macio.h
+#else
+#include linux/platform_device.h
+#include asm/macints.h
+#define machine_is_compatible(x) (0)
+#endif
 
 #if defined (CONFIG_SERIAL_PMACZILOG_CONSOLE)  defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -83,11 +90,9 @@
 
 static char version[] __initdata = pmac_zilog: 0.6 (Benjamin Herrenschmidt 
b...@kernel.crashing.org);
 MODULE_AUTHOR(Benjamin Herrenschmidt b...@kernel.crashing.org);
-MODULE_DESCRIPTION(Driver for the PowerMac serial ports.);
+MODULE_DESCRIPTION(Driver for the Mac and PowerMac serial ports.);
 MODULE_LICENSE(GPL);
 
-#define PWRDBG(fmt, arg...)printk(KERN_DEBUG fmt , ## arg)
-
 #ifdef CONFIG_SERIAL_PMACZILOG_TTYS
 #define PMACZILOG_MAJORTTY_MAJOR
 #define PMACZILOG_MINOR64
@@ -341,7 +346,7 @@ static struct tty_struct *pmz_receive_ch

Re: [PATCH 1/2] pmac-zilog: add platform driver

2010-01-08 Thread fthain


On Fri, 8 Jan 2010, Geert Uytterhoeven wrote:

 On Sat, Jan 2, 2010 at 17:39, Finn Thain fth...@telegraphics.com.au 
 wrote:
  On Sat, 2 Jan 2010, Geert Uytterhoeven wrote:
  On Tue, Nov 17, 2009 at 10:04, Finn Thain 
  fth...@telegraphics.com.au wrote: BTW, there are a few other minor 
  checkpatch issues with some of the other patches in the series, too.
 
  I ran checkpatch on all those patches before I submitted them. I 
  ignored some of the complaints about whitespace where I felt that 
  checkpatch got it wrong (space character following tab character, 
  IIRC).
 
  checkpatch found lots of mistakes that I did fix, but it can't 
  determine the most human readable style in all cases, especially where 
  consistency with the surrounding code is actually more conducive to 
  readability than strict but sporadic conformance to simple rules would 
  be.
 
 It seems your editor adds spaces to lines that are continuations of the 
 previous statement.

I put in spaces after tabs for hard wrapped lines so that code always 
renders properly regardless of the tab settings that might to be applied 
by any editor, browser, word processor, mailer, tty discipline, publisher, 
etc. that might stand between the human reader and the code.

Documentation/CodingStyle says that those indented lines should be 
substantially to the right, but checkpatch doesn't conform and nor does 
most kernel code. Some code does follow my preference, which is more 
readable, and also happens to follow the example of the lisp code found in 
the same style guide.

But if you prefer no spaces after tabs, I can do that instead. I'm not 
fussed.

 I fixes them up and applied all your patches to linux-m68k.git.

Thanks. I'll resend the patch to address your comments earlier in the 
thread.

Finn

 The other warnings were indeed false positives or complains about
 keeping consistency
 with the surrounding code.
 
 Gr{oetje,eeting}s,
 
   Geert
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev