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 checkpatch.pl tool. Signed-off-by: Michael Beardsworth <m

From: Grant Likely <hidden>
Date: 2010-03-10 04:46:32
Also in: lkml

Hi Michael,

Thanks for the patch.  However, whitespace changes like this usually
aren't worth bothering with.  Yeah, sure, they are technically
violations to the coding style, but they aren't egregious and aren't a
serious impediment to readability.  In general I don't want to see
purely minor coding style cleanup patches unless they are part of a
larger effort to tighten up and fix bugs in a driver.  Otherwise it is
just churn for little or no return on effort.

A good place to go looking for really bad code that needs cleaning
effort is in the staging/ directory.

Cheers,
g.

On Tue, Mar 9, 2010 at 2:46 PM, Michael Beardsworth
[off-list ref] wrote:
From: Michael Beardsworth <redacted>

---
=A0drivers/macintosh/adb-iop.c | =A0 41 +++++++++++++++++++++++----------=
--------
quoted hunk
=A01 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index 4446966..e813589 100644
--- a/drivers/macintosh/adb-iop.c
+++ b/drivers/macintosh/adb-iop.c
@@ -19,13 +19,13 @@
=A0#include <linux/init.h>
=A0#include <linux/proc_fs.h>

-#include <asm/macintosh.h>
-#include <asm/macints.h>
+#include <asm/macintosh.h>
+#include <asm/macints.h>
=A0#include <asm/mac_iop.h>
=A0#include <asm/mac_oss.h>
=A0#include <asm/adb_iop.h>

-#include <linux/adb.h>
+#include <linux/adb.h>

=A0/*#define DEBUG_ADB_IOP*/
@@ -67,7 +67,8 @@ static void adb_iop_end_req(struct adb_request *req, in=
t state)
quoted hunk
=A0{
=A0 =A0 =A0 =A0req->complete =3D 1;
=A0 =A0 =A0 =A0current_req =3D req->next;
- =A0 =A0 =A0 if (req->done) (*req->done)(req);
+ =A0 =A0 =A0 if (req->done)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 (*req->done)(req);
=A0 =A0 =A0 =A0adb_iop_state =3D state;
=A0}
@@ -85,9 +86,8 @@ static void adb_iop_complete(struct iop_msg *msg)
=A0 =A0 =A0 =A0local_irq_save(flags);

=A0 =A0 =A0 =A0req =3D current_req;
- =A0 =A0 =A0 if ((adb_iop_state =3D=3D sending) && req && req->reply_exp=
ected) {
+ =A0 =A0 =A0 if ((adb_iop_state =3D=3D sending) && req && req->reply_exp=
ected)
quoted hunk
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0adb_iop_state =3D awaiting_reply;
- =A0 =A0 =A0 }

=A0 =A0 =A0 =A0local_irq_restore(flags);
=A0}
@@ -113,8 +113,8 @@ static void adb_iop_listen(struct iop_msg *msg)
=A0 =A0 =A0 =A0req =3D current_req;

=A0#ifdef DEBUG_ADB_IOP
- =A0 =A0 =A0 printk("adb_iop_listen %p: rcvd packet, %d bytes: %02X %02X=
", req,
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 (uint) amsg->count + 2, (uint) amsg->flags,=
 (uint) amsg->cmd);
+ =A0 =A0 =A0 printk(KERN_WARNING "adb_iop_listen %p: rcvd packet, %d byt=
es: %02X %02X",
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 req, (uint) amsg->count + 2, (uint) amsg->f=
lags, (uint) amsg->cmd);
quoted hunk
=A0 =A0 =A0 =A0for (i =3D 0; i < amsg->count; i++)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(" %02X", (uint) amsg->data[i]);
=A0 =A0 =A0 =A0printk("\n");
@@ -130,9 +130,8 @@ static void adb_iop_listen(struct iop_msg *msg)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0msg->reply[0] =3D ADB_IOP_TIMEOUT | ADB_IO=
P_AUTOPOLL;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0msg->reply[1] =3D 0;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0msg->reply[2] =3D 0;
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (req && (adb_iop_state !=3D idle)) {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (req && (adb_iop_state !=3D idle))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0adb_iop_end_req(req, idle)=
;
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
=A0 =A0 =A0 =A0} else {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* TODO: is it possible for more than one =
chunk of data =A0*/
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* =A0 =A0 =A0 to arrive before the timeou=
t? If so we need to */
quoted hunk
@@ -169,12 +168,13 @@ static void adb_iop_start(void)
=A0 =A0 =A0 =A0/* get the packet to send */
=A0 =A0 =A0 =A0req =3D current_req;
- =A0 =A0 =A0 if (!req) return;
+ =A0 =A0 =A0 if (!req)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return;

=A0 =A0 =A0 =A0local_irq_save(flags);

=A0#ifdef DEBUG_ADB_IOP
- =A0 =A0 =A0 printk("adb_iop_start %p: sending packet, %d bytes:", req, =
req->nbytes);
+ =A0 =A0 =A0 printk(KERN_WARNING "adb_iop_start %p: sending packet, %d b=
ytes:", req, req->nbytes);
quoted hunk
=A0 =A0 =A0 =A0for (i =3D 0 ; i < req->nbytes ; i++)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(" %02X", (uint) req->data[i]);
=A0 =A0 =A0 =A0printk("\n");
@@ -203,13 +203,14 @@ static void adb_iop_start(void)
=A0int adb_iop_probe(void)
=A0{
- =A0 =A0 =A0 if (!iop_ism_present) return -ENODEV;
+ =A0 =A0 =A0 if (!iop_ism_present)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
=A0 =A0 =A0 =A0return 0;
=A0}

=A0int adb_iop_init(void)
=A0{
- =A0 =A0 =A0 printk("adb: IOP ISM driver v0.4 for Unified ADB.\n");
+ =A0 =A0 =A0 printk(KERN_MESSAGE "adb: IOP ISM driver v0.4 for Unified A=
DB.\n");
quoted hunk
=A0 =A0 =A0 =A0iop_listen(ADB_IOP, ADB_CHAN, adb_iop_listen, "ADB");
=A0 =A0 =A0 =A0return 0;
=A0}
@@ -219,10 +220,12 @@ int adb_iop_send_request(struct adb_request *req, i=
nt sync)
quoted hunk
=A0 =A0 =A0 =A0int err;

=A0 =A0 =A0 =A0err =3D adb_iop_write(req);
- =A0 =A0 =A0 if (err) return err;
+ =A0 =A0 =A0 if (err)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return err;

=A0 =A0 =A0 =A0if (sync) {
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 while (!req->complete) adb_iop_poll();
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 while (!req->complete)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 adb_iop_poll();
=A0 =A0 =A0 =A0}
=A0 =A0 =A0 =A0return 0;
=A0}
@@ -252,7 +255,8 @@ static int adb_iop_write(struct adb_request *req)
=A0 =A0 =A0 =A0}

=A0 =A0 =A0 =A0local_irq_restore(flags);
- =A0 =A0 =A0 if (adb_iop_state =3D=3D idle) adb_iop_start();
+ =A0 =A0 =A0 if (adb_iop_state =3D=3D idle)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 adb_iop_start();
=A0 =A0 =A0 =A0return 0;
=A0}
@@ -264,7 +268,8 @@ int adb_iop_autopoll(int devs)
=A0void adb_iop_poll(void)
=A0{
- =A0 =A0 =A0 if (adb_iop_state =3D=3D idle) adb_iop_start();
+ =A0 =A0 =A0 if (adb_iop_state =3D=3D idle)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 adb_iop_start();
=A0 =A0 =A0 =A0iop_ism_irq(0, (void *) ADB_IOP);
=A0}

--
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
Please read the FAQ at =A0http://www.tux.org/lkml/


--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help