Skip to contentSkip to conversation

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

PATCH Grant Likely 1 participant 1 message Mar 10, 2010

lore
Share & tools
lore
#0 lore raw

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.

Quoted 4 lines · Michael Beardsworth

From: Michael Beardsworth <[email protected]>

---
=A0drivers/macintosh/adb-iop.c | =A0 41 +++++++++++++++++++++++----------=

--------

drivers/macintosh/adb-iop.c static void adb_iop_end_req(struct adb_request *req, in=

Quoted 24 lines

=A01 files changed, 23 insertions(+), 18 deletions(-)

drivers/macintosh/adb-iop.c +0 -0
index 4446966..e813589 100644
@@ -19,13 +19,13 @@

=A0#include <linux/init.h>
=A0#include <linux/proc_fs.h>

drivers/macintosh/adb-iop.c +2 -2
-#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>

drivers/macintosh/adb-iop.c +1 -1
-#include <linux/adb.h>
+#include <linux/adb.h>

=A0/*#define DEBUG_ADB_IOP*/

drivers/macintosh/adb-iop.c +0 -0
@@ -67,7 +67,8 @@ static void adb_iop_end_req(struct adb_request *req, in=

t state)

Quoted 10 lines
drivers/macintosh/adb-iop.c +2 -1
 =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}
 

drivers/macintosh/adb-iop.c static void adb_iop_complete(struct iop_msg *msg) · line 88

Quoted 4 lines
drivers/macintosh/adb-iop.c +0 -1
@@ -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) {

drivers/macintosh/adb-iop.c static void adb_iop_complete(struct iop_msg *msg) · line 89

Quoted 1 line
drivers/macintosh/adb-iop.c +1 -0
+ =A0 =A0 =A0 if ((adb_iop_state =3D=3D sending) && req && req->reply_exp=

ected)

Quoted 10 lines
drivers/macintosh/adb-iop.c +0 -1
 =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,

Quoted 1 line

- =A0 =A0 =A0 =A0 =A0 =A0 =A0 (uint) amsg->count + 2, (uint) amsg->flags,=

(uint) amsg->cmd);

Quoted 1 line

+ =A0 =A0 =A0 printk(KERN_WARNING "adb_iop_listen %p: rcvd packet, %d byt=

es: %02X %02X",

Quoted 1 line

+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 req, (uint) amsg->count + 2, (uint) amsg->f=

lags, (uint) amsg->cmd);

Quoted 5 lines

=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");

drivers/macintosh/adb-iop.c +0 -0
@@ -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;

Quoted 5 lines

=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)=

;

Quoted 3 lines

- =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*/

Quoted 1 line

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* =A0 =A0 =A0 to arrive before the timeou=

t? If so we need to */

Quoted 8 lines
drivers/macintosh/adb-iop.c +0 -0
@@ -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;

Quoted 4 lines

=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);

Quoted 1 line

+ =A0 =A0 =A0 printk(KERN_WARNING "adb_iop_start %p: sending packet, %d b=

ytes:", req, req->nbytes);

Quoted 7 lines

=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");

drivers/macintosh/adb-iop.c +0 -0
@@ -203,13 +203,14 @@ static void adb_iop_start(void)
 
 =A0int adb_iop_probe(void)
 =A0{

drivers/macintosh/adb-iop.c static void adb_iop_start(void) · line 213

Quoted 10 lines
drivers/macintosh/adb-iop.c +3 -2
- =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");

drivers/macintosh/adb-iop.c int adb_iop_send_request(struct adb_request *req, i=

Quoted 4 lines
drivers/macintosh/adb-iop.c +0 -0
 =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 37 lines
drivers/macintosh/adb-iop.c +8 -5
 =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

Quoted 2 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" i=

n

Quoted 4 lines

the body of a message to [email protected]
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.