Skip to content

Commit

Permalink
macintosh/via-macii, macintosh/adb-iop: Clean up whitespace
Browse files Browse the repository at this point in the history
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Finn Thain authored and Michael Ellerman committed Oct 8, 2018
1 parent 351e5ad commit 47fd206
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 160 deletions.
48 changes: 28 additions & 20 deletions drivers/macintosh/adb-iop.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include <linux/init.h>
#include <linux/proc_fs.h>

#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/mac_iop.h>
#include <asm/mac_oss.h>
#include <asm/adb_iop.h>

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

/*#define DEBUG_ADB_IOP*/

Expand All @@ -38,9 +38,9 @@ static unsigned char *reply_ptr;
#endif

static enum adb_iop_state {
idle,
sending,
awaiting_reply
idle,
sending,
awaiting_reply
} adb_iop_state;

static void adb_iop_start(void);
Expand All @@ -66,7 +66,8 @@ static void adb_iop_end_req(struct adb_request *req, int state)
{
req->complete = 1;
current_req = req->next;
if (req->done) (*req->done)(req);
if (req->done)
(*req->done)(req);
adb_iop_state = state;
}

Expand Down Expand Up @@ -100,7 +101,7 @@ static void adb_iop_complete(struct iop_msg *msg)

static void adb_iop_listen(struct iop_msg *msg)
{
struct adb_iopmsg *amsg = (struct adb_iopmsg *) msg->message;
struct adb_iopmsg *amsg = (struct adb_iopmsg *)msg->message;
struct adb_request *req;
unsigned long flags;
#ifdef DEBUG_ADB_IOP
Expand All @@ -113,9 +114,9 @@ static void adb_iop_listen(struct iop_msg *msg)

#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);
(uint)amsg->count + 2, (uint)amsg->flags, (uint)amsg->cmd);
for (i = 0; i < amsg->count; i++)
printk(" %02X", (uint) amsg->data[i]);
printk(" %02X", (uint)amsg->data[i]);
printk("\n");
#endif

Expand Down Expand Up @@ -168,14 +169,15 @@ static void adb_iop_start(void)

/* get the packet to send */
req = current_req;
if (!req) return;
if (!req)
return;

local_irq_save(flags);

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

Expand All @@ -196,13 +198,14 @@ static void adb_iop_start(void)
/* Now send it. The IOP manager will call adb_iop_complete */
/* when the packet has been sent. */

iop_send_message(ADB_IOP, ADB_CHAN, req,
sizeof(amsg), (__u8 *) &amsg, adb_iop_complete);
iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *)&amsg,
adb_iop_complete);
}

int adb_iop_probe(void)
{
if (!iop_ism_present) return -ENODEV;
if (!iop_ism_present)
return -ENODEV;
return 0;
}

Expand All @@ -218,10 +221,12 @@ int adb_iop_send_request(struct adb_request *req, int sync)
int err;

err = adb_iop_write(req);
if (err) return err;
if (err)
return err;

if (sync) {
while (!req->complete) adb_iop_poll();
while (!req->complete)
adb_iop_poll();
}
return 0;
}
Expand Down Expand Up @@ -251,7 +256,9 @@ static int adb_iop_write(struct adb_request *req)
}

local_irq_restore(flags);
if (adb_iop_state == idle) adb_iop_start();

if (adb_iop_state == idle)
adb_iop_start();
return 0;
}

Expand All @@ -263,7 +270,8 @@ int adb_iop_autopoll(int devs)

void adb_iop_poll(void)
{
if (adb_iop_state == idle) adb_iop_start();
if (adb_iop_state == idle)
adb_iop_start();
iop_ism_irq_poll(ADB_IOP);
}

Expand Down
Loading

0 comments on commit 47fd206

Please sign in to comment.