Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751482AbdGQQiH (ORCPT ); Mon, 17 Jul 2017 12:38:07 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:36822 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbdGQQhe (ORCPT ); Mon, 17 Jul 2017 12:37:34 -0400 From: Carlos Palminha To: , CC: , , , Carlos Palminha Subject: [PATCH 2/5] parport: cleanup prohibited space after functions name Date: Mon, 17 Jul 2017 17:36:59 +0100 Message-ID: <20170717163702.17427-3-palminha@synopsys.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170717163702.17427-1-palminha@synopsys.com> References: <20170717163702.17427-1-palminha@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.25.64] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 72833 Lines: 2191 based on checkpatch, remove prohibited space between function name and open parenthesis '('. Signed-off-by: Carlos Palminha --- drivers/parport/ieee1284.c | 212 ++++++++++++------------ drivers/parport/ieee1284_ops.c | 338 +++++++++++++++++++-------------------- drivers/parport/parport_atari.c | 4 +- drivers/parport/parport_gsc.c | 62 +++---- drivers/parport/parport_mfc3.c | 2 +- drivers/parport/parport_serial.c | 52 +++--- drivers/parport/parport_sunbpp.c | 6 +- drivers/parport/probe.c | 42 ++--- drivers/parport/procfs.c | 22 +-- 9 files changed, 370 insertions(+), 370 deletions(-) diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index b40ee76d519d..27673b838e74 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c @@ -32,22 +32,22 @@ #endif #ifdef DEBUG -#define DPRINTK(stuff...) printk (stuff) +#define DPRINTK(stuff...) printk(stuff) #else #define DPRINTK(stuff...) #endif /* Make parport_wait_peripheral wake up. * It will be useful to call this from an interrupt handler. */ -static void parport_ieee1284_wakeup (struct parport *port) +static void parport_ieee1284_wakeup(struct parport *port) { - up (&port->physport->ieee1284.irq); + up(&port->physport->ieee1284.irq); } static struct parport *port_from_cookie[PARPORT_MAX]; -static void timeout_waiting_on_port (unsigned long cookie) +static void timeout_waiting_on_port(unsigned long cookie) { - parport_ieee1284_wakeup (port_from_cookie[cookie % PARPORT_MAX]); + parport_ieee1284_wakeup(port_from_cookie[cookie % PARPORT_MAX]); } /** @@ -66,7 +66,7 @@ static void timeout_waiting_on_port (unsigned long cookie) * what it's doing as soon as it can. */ -int parport_wait_event (struct parport *port, signed long timeout) +int parport_wait_event(struct parport *port, signed long timeout) { int ret; struct timer_list timer; @@ -82,8 +82,8 @@ int parport_wait_event (struct parport *port, signed long timeout) port_from_cookie[port->number % PARPORT_MAX] = port; timer.data = port->number; - add_timer (&timer); - ret = down_interruptible (&port->physport->ieee1284.irq); + add_timer(&timer); + ret = down_interruptible(&port->physport->ieee1284.irq); if (!del_timer_sync(&timer) && !ret) /* Timed out. */ ret = 1; @@ -127,15 +127,15 @@ int parport_poll_peripheral(struct parport *port, int i; unsigned char status; for (i = 0; i < count; i++) { - status = parport_read_status (port); + status = parport_read_status(port); if ((status & mask) == result) return 0; - if (signal_pending (current)) + if (signal_pending(current)) return -EINTR; if (need_resched()) break; if (i >= 2) - udelay (5); + udelay(5); } return 1; @@ -187,7 +187,7 @@ int parport_wait_peripheral(struct parport *port, * How about making a note (in the device structure) of how long * it takes, so we know for next time? */ - ret = parport_poll_peripheral (port, mask, result, usec); + ret = parport_poll_peripheral(port, mask, result, usec); if (ret != 1) return ret; @@ -198,16 +198,16 @@ int parport_wait_peripheral(struct parport *port, /* 40ms of slow polling. */ deadline = jiffies + msecs_to_jiffies(40); - while (time_before (jiffies, deadline)) { - if (signal_pending (current)) + while (time_before(jiffies, deadline)) { + if (signal_pending(current)) return -EINTR; /* Wait for 10ms (or until an interrupt occurs if * the handler is set) */ - if ((ret = parport_wait_event (port, msecs_to_jiffies(10))) < 0) + if ((ret = parport_wait_event(port, msecs_to_jiffies(10))) < 0) return ret; - status = parport_read_status (port); + status = parport_read_status(port); if ((status & mask) == result) return 0; @@ -224,7 +224,7 @@ int parport_wait_peripheral(struct parport *port, #ifdef CONFIG_PARPORT_1284 /* Terminate a negotiated mode. */ -static void parport_ieee1284_terminate (struct parport *port) +static void parport_ieee1284_terminate(struct parport *port) { int r; port = port->physport; @@ -237,11 +237,11 @@ static void parport_ieee1284_terminate (struct parport *port) /* Terminate from EPP mode. */ /* Event 68: Set nInit low */ - parport_frob_control (port, PARPORT_CONTROL_INIT, 0); - udelay (50); + parport_frob_control(port, PARPORT_CONTROL_INIT, 0); + udelay(50); /* Event 69: Set nInit high, nSelectIn low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, PARPORT_CONTROL_SELECT @@ -254,22 +254,22 @@ static void parport_ieee1284_terminate (struct parport *port) /* In ECP we can only terminate from fwd idle phase. */ if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) { /* Event 47: Set nInit high */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_INIT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_INIT | PARPORT_CONTROL_AUTOFD); /* Event 49: PError goes high */ - r = parport_wait_peripheral (port, + r = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 49\n", + DPRINTK(KERN_INFO "%s: Timeout at event 49\n", port->name); - parport_data_forward (port); - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", + parport_data_forward(port); + DPRINTK(KERN_DEBUG "%s: ECP direction: forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; } @@ -280,38 +280,38 @@ static void parport_ieee1284_terminate (struct parport *port) /* Terminate from all other modes. */ /* Event 22: Set nSelectIn low, nAutoFd high */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_SELECT); /* Event 24: nAck goes low */ - r = parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0); + r = parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 24\n", + DPRINTK(KERN_INFO "%s: Timeout at event 24\n", port->name); /* Event 25: Set nAutoFd low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 27: nAck goes high */ - r = parport_wait_peripheral (port, + r = parport_wait_peripheral(port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 27\n", + DPRINTK(KERN_INFO "%s: Timeout at event 27\n", port->name); /* Event 29: Set nAutoFd high */ - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); } port->ieee1284.mode = IEEE1284_MODE_COMPAT; port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; - DPRINTK (KERN_DEBUG "%s: In compatibility (forward idle) mode\n", + DPRINTK(KERN_DEBUG "%s: In compatibility (forward idle) mode\n", port->name); } #endif /* IEEE1284 support */ @@ -331,12 +331,12 @@ static void parport_ieee1284_terminate (struct parport *port) * has rejected the negotiation. */ -int parport_negotiate (struct parport *port, int mode) +int parport_negotiate(struct parport *port, int mode) { #ifndef CONFIG_PARPORT_1284 if (mode == IEEE1284_MODE_COMPAT) return 0; - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + printk(KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); return -1; #else int m = mode & ~IEEE1284_ADDR; @@ -357,7 +357,7 @@ int parport_negotiate (struct parport *port, int mode) /* Go to compatibility forward idle mode */ if (port->ieee1284.mode != IEEE1284_MODE_COMPAT) - parport_ieee1284_terminate (port); + parport_ieee1284_terminate(port); if (mode == IEEE1284_MODE_COMPAT) /* Compatibility mode: no negotiation. */ @@ -381,7 +381,7 @@ int parport_negotiate (struct parport *port, int mode) port->ieee1284.phase = IEEE1284_PH_NEGOTIATION; /* Start off with nStrobe and nAutoFd high, and nSelectIn low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_SELECT, @@ -389,18 +389,18 @@ int parport_negotiate (struct parport *port, int mode) udelay(1); /* Event 0: Set data */ - parport_data_forward (port); - parport_write_data (port, m); - udelay (400); /* Shouldn't need to wait this long. */ + parport_data_forward(port); + parport_write_data(port, m); + udelay(400); /* Shouldn't need to wait this long. */ /* Event 1: Set nSelectIn high, nAutoFd low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 2: PError, Select, nFault go high, nAck goes low */ - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ERROR | PARPORT_STATUS_SELECT | PARPORT_STATUS_PAPEROUT @@ -409,102 +409,102 @@ int parport_negotiate (struct parport *port, int mode) | PARPORT_STATUS_SELECT | PARPORT_STATUS_PAPEROUT)) { /* Timeout */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_SELECT); - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: Peripheral not IEEE1284 compliant (0x%02X)\n", - port->name, parport_read_status (port)); + port->name, parport_read_status(port)); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; return -1; /* Not IEEE1284 compliant */ } /* Event 3: Set nStrobe low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); /* Event 4: Set nStrobe and nAutoFd high */ - udelay (5); - parport_frob_control (port, + udelay(5); + parport_frob_control(port, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD, 0); /* Event 6: nAck goes high */ - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* This shouldn't really happen with a compliant device. */ - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: Mode 0x%02x not supported? (0x%02x)\n", - port->name, mode, port->ops->read_status (port)); - parport_ieee1284_terminate (port); + port->name, mode, port->ops->read_status(port)); + parport_ieee1284_terminate(port); return 1; } - xflag = parport_read_status (port) & PARPORT_STATUS_SELECT; + xflag = parport_read_status(port) & PARPORT_STATUS_SELECT; /* xflag should be high for all modes other than nibble (0). */ if (mode && !xflag) { /* Mode not supported. */ - DPRINTK (KERN_DEBUG "%s: Mode 0x%02x rejected by peripheral\n", + DPRINTK(KERN_DEBUG "%s: Mode 0x%02x rejected by peripheral\n", port->name, mode); - parport_ieee1284_terminate (port); + parport_ieee1284_terminate(port); return 1; } /* More to do if we've requested extensibility link. */ if (mode & IEEE1284_EXT_LINK) { m = mode & 0x7f; - udelay (1); - parport_write_data (port, m); - udelay (1); + udelay(1); + parport_write_data(port, m); + udelay(1); /* Event 51: Set nStrobe low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); /* Event 52: nAck goes low */ - if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) { + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0)) { /* This peripheral is _very_ slow. */ - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: Event 52 didn't happen\n", port->name); - parport_ieee1284_terminate (port); + parport_ieee1284_terminate(port); return 1; } /* Event 53: Set nStrobe high */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); /* Event 55: nAck goes high */ - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* This shouldn't really happen with a compliant * device. */ - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: Mode 0x%02x not supported? (0x%02x)\n", port->name, mode, - port->ops->read_status (port)); - parport_ieee1284_terminate (port); + port->ops->read_status(port)); + parport_ieee1284_terminate(port); return 1; } /* Event 54: Peripheral sets XFlag to reflect support */ - xflag = parport_read_status (port) & PARPORT_STATUS_SELECT; + xflag = parport_read_status(port) & PARPORT_STATUS_SELECT; /* xflag should be high. */ if (!xflag) { /* Extended mode not supported. */ - DPRINTK (KERN_DEBUG "%s: Extended mode 0x%02x not " + DPRINTK(KERN_DEBUG "%s: Extended mode 0x%02x not " "supported\n", port->name, mode); - parport_ieee1284_terminate (port); + parport_ieee1284_terminate(port); return 1; } @@ -512,7 +512,7 @@ int parport_negotiate (struct parport *port, int mode) } /* Mode is supported */ - DPRINTK (KERN_DEBUG "%s: In mode 0x%02x\n", port->name, mode); + DPRINTK(KERN_DEBUG "%s: In mode 0x%02x\n", port->name, mode); port->ieee1284.mode = mode; /* But ECP is special */ @@ -520,21 +520,21 @@ int parport_negotiate (struct parport *port, int mode) port->ieee1284.phase = IEEE1284_PH_ECP_SETUP; /* Event 30: Set nAutoFd low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 31: PError goes high. */ - r = parport_wait_peripheral (port, + r = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (r) { - DPRINTK (KERN_INFO "%s: Timeout at event 31\n", + DPRINTK(KERN_INFO "%s: Timeout at event 31\n", port->name); } port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", + DPRINTK(KERN_DEBUG "%s: ECP direction: forward\n", port->name); } else { switch (mode) { @@ -558,31 +558,31 @@ int parport_negotiate (struct parport *port, int mode) * Returns zero if data was available. */ #ifdef CONFIG_PARPORT_1284 -static int parport_ieee1284_ack_data_avail (struct parport *port) +static int parport_ieee1284_ack_data_avail(struct parport *port) { - if (parport_read_status (port) & PARPORT_STATUS_ERROR) + if (parport_read_status(port) & PARPORT_STATUS_ERROR) /* Event 18 didn't happen. */ return -1; /* Event 20: nAutoFd goes high. */ - port->ops->frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + port->ops->frob_control(port, PARPORT_CONTROL_AUTOFD, 0); port->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL; return 0; } #endif /* IEEE1284 support */ /* Handle an interrupt. */ -void parport_ieee1284_interrupt (void *handle) +void parport_ieee1284_interrupt(void *handle) { struct parport *port = handle; - parport_ieee1284_wakeup (port); + parport_ieee1284_wakeup(port); #ifdef CONFIG_PARPORT_1284 if (port->ieee1284.phase == IEEE1284_PH_REV_IDLE) { /* An interrupt in this phase means that data * is now available. */ - DPRINTK (KERN_DEBUG "%s: Data available\n", port->name); - parport_ieee1284_ack_data_avail (port); + DPRINTK(KERN_DEBUG "%s: Data available\n", port->name); + parport_ieee1284_ack_data_avail(port); } #endif /* IEEE1284 support */ } @@ -605,10 +605,10 @@ void parport_ieee1284_interrupt (void *handle) * or positive), or else an error code. */ -ssize_t parport_write (struct parport *port, const void *buffer, size_t len) +ssize_t parport_write(struct parport *port, const void *buffer, size_t len) { #ifndef CONFIG_PARPORT_1284 - return port->ops->compat_write_data (port, buffer, len, 0); + return port->ops->compat_write_data(port, buffer, len, 0); #else ssize_t retval; int mode = port->ieee1284.mode; @@ -622,15 +622,15 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) switch (mode) { case IEEE1284_MODE_NIBBLE: case IEEE1284_MODE_BYTE: - parport_negotiate (port, IEEE1284_MODE_COMPAT); + parport_negotiate(port, IEEE1284_MODE_COMPAT); case IEEE1284_MODE_COMPAT: - DPRINTK (KERN_DEBUG "%s: Using compatibility mode\n", + DPRINTK(KERN_DEBUG "%s: Using compatibility mode\n", port->name); fn = port->ops->compat_write_data; break; case IEEE1284_MODE_EPP: - DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using EPP mode\n", port->name); if (addr) { fn = port->ops->epp_write_addr; } else { @@ -638,7 +638,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) } break; case IEEE1284_MODE_EPPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n", + DPRINTK(KERN_DEBUG "%s: Using software-emulated EPP mode\n", port->name); if (addr) { fn = parport_ieee1284_epp_write_addr; @@ -648,7 +648,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) break; case IEEE1284_MODE_ECP: case IEEE1284_MODE_ECPRLE: - DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using ECP mode\n", port->name); if (addr) { fn = port->ops->ecp_write_addr; } else { @@ -657,7 +657,7 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) break; case IEEE1284_MODE_ECPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n", + DPRINTK(KERN_DEBUG "%s: Using software-emulated ECP mode\n", port->name); /* The caller has specified that it must be emulated, * even if we have ECP hardware! */ @@ -669,13 +669,13 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) break; default: - DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, + DPRINTK(KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, port->ieee1284.mode); return -ENOSYS; } retval = (*fn) (port, buffer, len, 0); - DPRINTK (KERN_DEBUG "%s: wrote %d/%d bytes\n", port->name, retval, len); + DPRINTK(KERN_DEBUG "%s: wrote %d/%d bytes\n", port->name, retval, len); return retval; #endif /* IEEE1284 support */ } @@ -698,10 +698,10 @@ ssize_t parport_write (struct parport *port, const void *buffer, size_t len) * or positive), or else an error code. */ -ssize_t parport_read (struct parport *port, void *buffer, size_t len) +ssize_t parport_read(struct parport *port, void *buffer, size_t len) { #ifndef CONFIG_PARPORT_1284 - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + printk(KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); return -ENODEV; #else int mode = port->physport->ieee1284.mode; @@ -720,28 +720,28 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) * end up needlessly calling negotiate(BYTE) repeately.. (fb) */ if ((port->physport->modes & PARPORT_MODE_TRISTATE) && - !parport_negotiate (port, IEEE1284_MODE_BYTE)) { + !parport_negotiate(port, IEEE1284_MODE_BYTE)) { /* got into BYTE mode OK */ - DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using byte mode\n", port->name); fn = port->ops->byte_read_data; break; } - if (parport_negotiate (port, IEEE1284_MODE_NIBBLE)) { + if (parport_negotiate(port, IEEE1284_MODE_NIBBLE)) { return -EIO; } /* fall through to NIBBLE */ case IEEE1284_MODE_NIBBLE: - DPRINTK (KERN_DEBUG "%s: Using nibble mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using nibble mode\n", port->name); fn = port->ops->nibble_read_data; break; case IEEE1284_MODE_BYTE: - DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using byte mode\n", port->name); fn = port->ops->byte_read_data; break; case IEEE1284_MODE_EPP: - DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using EPP mode\n", port->name); if (addr) { fn = port->ops->epp_read_addr; } else { @@ -749,7 +749,7 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) } break; case IEEE1284_MODE_EPPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n", + DPRINTK(KERN_DEBUG "%s: Using software-emulated EPP mode\n", port->name); if (addr) { fn = parport_ieee1284_epp_read_addr; @@ -759,18 +759,18 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) break; case IEEE1284_MODE_ECP: case IEEE1284_MODE_ECPRLE: - DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name); + DPRINTK(KERN_DEBUG "%s: Using ECP mode\n", port->name); fn = port->ops->ecp_read_data; break; case IEEE1284_MODE_ECPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n", + DPRINTK(KERN_DEBUG "%s: Using software-emulated ECP mode\n", port->name); fn = parport_ieee1284_ecp_read_data; break; default: - DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, + DPRINTK(KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, port->physport->ieee1284.mode); return -ENOSYS; } @@ -795,14 +795,14 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) * up. */ -long parport_set_timeout (struct pardevice *dev, long inactivity) +long parport_set_timeout(struct pardevice *dev, long inactivity) { long int old = dev->timeout; dev->timeout = inactivity; if (dev->port->physport->cad == dev) - parport_ieee1284_wakeup (dev->port); + parport_ieee1284_wakeup(dev->port); return old; } diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c index bfc9cde9a21d..b431ab6349fe 100644 --- a/drivers/parport/ieee1284_ops.c +++ b/drivers/parport/ieee1284_ops.c @@ -27,7 +27,7 @@ #endif #ifdef DEBUG -#define DPRINTK(stuff...) printk (stuff) +#define DPRINTK(stuff...) printk(stuff) #else #define DPRINTK(stuff...) #endif @@ -37,7 +37,7 @@ * ***/ /* Compatibility mode. */ -size_t parport_ieee1284_write_compat (struct parport *port, +size_t parport_ieee1284_write_compat(struct parport *port, const void *buffer, size_t len, int flags) { @@ -50,13 +50,13 @@ size_t parport_ieee1284_write_compat (struct parport *port, | PARPORT_CONTROL_INIT); if (port->irq != PARPORT_IRQ_NONE) { - parport_enable_irq (port); + parport_enable_irq(port); no_irq = 0; } port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA; - parport_write_control (port, ctl); - parport_data_forward (port); + parport_write_control(port, ctl); + parport_data_forward(port); while (count < len) { unsigned long expire = jiffies + dev->timeout; long wait = msecs_to_jiffies(10); @@ -68,12 +68,12 @@ size_t parport_ieee1284_write_compat (struct parport *port, /* Wait until the peripheral's ready */ do { /* Is the peripheral ready yet? */ - if (!parport_wait_peripheral (port, mask, val)) + if (!parport_wait_peripheral(port, mask, val)) /* Skip the loop */ goto ready; /* Is the peripheral upset? */ - if ((parport_read_status (port) & + if ((parport_read_status(port) & (PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR)) @@ -87,7 +87,7 @@ size_t parport_ieee1284_write_compat (struct parport *port, goto stop; /* Have we run out of time? */ - if (!time_before (jiffies, expire)) + if (!time_before(jiffies, expire)) break; /* Yield the port for a while. If this is the @@ -95,49 +95,49 @@ size_t parport_ieee1284_write_compat (struct parport *port, the port. This way, we find out if we have our interrupt handler called. */ if (count && no_irq) { - parport_release (dev); + parport_release(dev); schedule_timeout_interruptible(wait); - parport_claim_or_block (dev); + parport_claim_or_block(dev); } else /* We must have the device claimed here */ - parport_wait_event (port, wait); + parport_wait_event(port, wait); /* Is there a signal pending? */ - if (signal_pending (current)) + if (signal_pending(current)) break; /* Wait longer next time. */ wait *= 2; - } while (time_before (jiffies, expire)); + } while (time_before(jiffies, expire)); - if (signal_pending (current)) + if (signal_pending(current)) break; - DPRINTK (KERN_DEBUG "%s: Timed out\n", port->name); + DPRINTK(KERN_DEBUG "%s: Timed out\n", port->name); break; ready: /* Write the character to the data lines. */ byte = *addr++; - parport_write_data (port, byte); - udelay (1); + parport_write_data(port, byte); + udelay(1); /* Pulse strobe. */ - parport_write_control (port, ctl | PARPORT_CONTROL_STROBE); - udelay (1); /* strobe */ + parport_write_control(port, ctl | PARPORT_CONTROL_STROBE); + udelay(1); /* strobe */ - parport_write_control (port, ctl); - udelay (1); /* hold */ + parport_write_control(port, ctl); + udelay(1); /* hold */ /* Assume the peripheral received it. */ count++; /* Let another process run if it needs to. */ - if (time_before (jiffies, expire)) - if (!parport_yield_blocking (dev) + if (time_before(jiffies, expire)) + if (!parport_yield_blocking(dev) && need_resched()) - schedule (); + schedule(); } stop: port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE; @@ -146,7 +146,7 @@ size_t parport_ieee1284_write_compat (struct parport *port, } /* Nibble mode. */ -size_t parport_ieee1284_read_nibble (struct parport *port, +size_t parport_ieee1284_read_nibble(struct parport *port, void *buffer, size_t len, int flags) { @@ -168,39 +168,39 @@ size_t parport_ieee1284_read_nibble (struct parport *port, } /* Event 7: Set nAutoFd low. */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 9: nAck goes low. */ port->ieee1284.phase = IEEE1284_PH_REV_DATA; - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0)) { /* Timeout -- no more data? */ - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: Nibble timeout at event 9 (%d bytes)\n", port->name, i/2); - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); break; } /* Read a nibble. */ - nibble = parport_read_status (port) >> 3; + nibble = parport_read_status(port) >> 3; nibble &= ~8; if ((nibble & 0x10) == 0) nibble |= 8; nibble &= 0xf; /* Event 10: Set nAutoFd high. */ - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); /* Event 11: nAck goes high. */ - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* Timeout -- no more data? */ - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: Nibble timeout at event 11\n", port->name); break; @@ -216,14 +216,14 @@ size_t parport_ieee1284_read_nibble (struct parport *port, if (i == len) { /* Read the last nibble without checking data avail. */ - if (parport_read_status (port) & PARPORT_STATUS_ERROR) { + if (parport_read_status(port) & PARPORT_STATUS_ERROR) { end_of_data: - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: No more nibble data (%d bytes)\n", port->name, i/2); /* Go to reverse idle phase. */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE; @@ -237,7 +237,7 @@ size_t parport_ieee1284_read_nibble (struct parport *port, } /* Byte mode. */ -size_t parport_ieee1284_read_byte (struct parport *port, +size_t parport_ieee1284_read_byte(struct parport *port, void *buffer, size_t len, int flags) { @@ -251,67 +251,67 @@ size_t parport_ieee1284_read_byte (struct parport *port, unsigned char byte; /* Data available? */ - if (parport_read_status (port) & PARPORT_STATUS_ERROR) { + if (parport_read_status(port) & PARPORT_STATUS_ERROR) { goto end_of_data; } /* Event 14: Place data bus in high impedance state. */ - parport_data_reverse (port); + parport_data_reverse(port); /* Event 7: Set nAutoFd low. */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 9: nAck goes low. */ port->physport->ieee1284.phase = IEEE1284_PH_REV_DATA; - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0)) { /* Timeout -- no more data? */ - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); - DPRINTK (KERN_DEBUG "%s: Byte timeout at event 9\n", + DPRINTK(KERN_DEBUG "%s: Byte timeout at event 9\n", port->name); break; } - byte = parport_read_data (port); + byte = parport_read_data(port); *buf++ = byte; /* Event 10: Set nAutoFd high */ - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); /* Event 11: nAck goes high. */ - if (parport_wait_peripheral (port, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* Timeout -- no more data? */ - DPRINTK (KERN_DEBUG "%s: Byte timeout at event 11\n", + DPRINTK(KERN_DEBUG "%s: Byte timeout at event 11\n", port->name); break; } /* Event 16: Set nStrobe low. */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); - udelay (5); + udelay(5); /* Event 17: Set nStrobe high. */ - parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); } if (count == len) { /* Read the last byte without checking data avail. */ - if (parport_read_status (port) & PARPORT_STATUS_ERROR) { + if (parport_read_status(port) & PARPORT_STATUS_ERROR) { end_of_data: - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: No more byte data (%zd bytes)\n", port->name, count); /* Go to reverse idle phase. */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE; @@ -331,32 +331,32 @@ size_t parport_ieee1284_read_byte (struct parport *port, #ifdef CONFIG_PARPORT_1284 static inline -int ecp_forward_to_reverse (struct parport *port) +int ecp_forward_to_reverse(struct parport *port) { int retval; /* Event 38: Set nAutoFd low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); - parport_data_reverse (port); - udelay (5); + parport_data_reverse(port); + udelay(5); /* Event 39: Set nInit low to initiate bus reversal */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_INIT, 0); /* Event 40: PError goes low */ - retval = parport_wait_peripheral (port, + retval = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, 0); if (!retval) { - DPRINTK (KERN_DEBUG "%s: ECP direction: reverse\n", + DPRINTK(KERN_DEBUG "%s: ECP direction: reverse\n", port->name); port->ieee1284.phase = IEEE1284_PH_REV_IDLE; } else { - DPRINTK (KERN_DEBUG "%s: ECP direction: failed to reverse\n", + DPRINTK(KERN_DEBUG "%s: ECP direction: failed to reverse\n", port->name); port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; } @@ -365,29 +365,29 @@ int ecp_forward_to_reverse (struct parport *port) } static inline -int ecp_reverse_to_forward (struct parport *port) +int ecp_reverse_to_forward(struct parport *port) { int retval; /* Event 47: Set nInit high */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_INIT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_INIT | PARPORT_CONTROL_AUTOFD); /* Event 49: PError goes high */ - retval = parport_wait_peripheral (port, + retval = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (!retval) { - parport_data_forward (port); - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", + parport_data_forward(port); + DPRINTK(KERN_DEBUG "%s: ECP direction: forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; } else { - DPRINTK (KERN_DEBUG + DPRINTK(KERN_DEBUG "%s: ECP direction: failed to switch forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; @@ -400,7 +400,7 @@ int ecp_reverse_to_forward (struct parport *port) #endif /* IEEE1284 support */ /* ECP mode, forward channel, data. */ -size_t parport_ieee1284_ecp_write_data (struct parport *port, +size_t parport_ieee1284_ecp_write_data(struct parport *port, const void *buffer, size_t len, int flags) { @@ -414,13 +414,13 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port, port = port->physport; if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) - if (ecp_reverse_to_forward (port)) + if (ecp_reverse_to_forward(port)) return 0; port->ieee1284.phase = IEEE1284_PH_FWD_DATA; /* HostAck high (data, not command) */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT, @@ -431,17 +431,17 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port, byte = *buf; try_again: - parport_write_data (port, byte); - parport_frob_control (port, PARPORT_CONTROL_STROBE, + parport_write_data(port, byte); + parport_frob_control(port, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); - udelay (5); + udelay(5); for (retry = 0; retry < 100; retry++) { - if (!parport_wait_peripheral (port, + if (!parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0)) goto success; - if (signal_pending (current)) { - parport_frob_control (port, + if (signal_pending(current)) { + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); break; @@ -449,33 +449,33 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port, } /* Time for Host Transfer Recovery (page 41 of IEEE1284) */ - DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); + DPRINTK(KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); - parport_frob_control (port, PARPORT_CONTROL_INIT, + parport_frob_control(port, PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); - udelay (50); - if (parport_read_status (port) & PARPORT_STATUS_PAPEROUT) { + udelay(50); + if (parport_read_status(port) & PARPORT_STATUS_PAPEROUT) { /* It's buggered. */ - parport_frob_control (port, PARPORT_CONTROL_INIT, 0); + parport_frob_control(port, PARPORT_CONTROL_INIT, 0); break; } - parport_frob_control (port, PARPORT_CONTROL_INIT, 0); - udelay (50); - if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT)) + parport_frob_control(port, PARPORT_CONTROL_INIT, 0); + udelay(50); + if (!(parport_read_status(port) & PARPORT_STATUS_PAPEROUT)) break; - DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n", + DPRINTK(KERN_DEBUG "%s: Host transfer recovered\n", port->name); - if (time_after_eq (jiffies, expire)) + if (time_after_eq(jiffies, expire)) break; goto try_again; success: - parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); - udelay (5); - if (parport_wait_peripheral (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); + udelay(5); + if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, PARPORT_STATUS_BUSY)) /* Peripheral hasn't accepted the data. */ @@ -489,7 +489,7 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port, } /* ECP mode, reverse channel, data. */ -size_t parport_ieee1284_ecp_read_data (struct parport *port, +size_t parport_ieee1284_ecp_read_data(struct parport *port, void *buffer, size_t len, int flags) { #ifndef CONFIG_PARPORT_1284 @@ -505,16 +505,16 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, port = port->physport; if (port->ieee1284.phase != IEEE1284_PH_REV_IDLE) - if (ecp_forward_to_reverse (port)) + if (ecp_forward_to_reverse(port)) return 0; port->ieee1284.phase = IEEE1284_PH_REV_DATA; /* Set HostAck low to start accepting data. */ - ctl = parport_read_control (port); + ctl = parport_read_control(port); ctl &= ~(PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT | PARPORT_CONTROL_AUTOFD); - parport_write_control (port, + parport_write_control(port, ctl | PARPORT_CONTROL_AUTOFD); while (count < len) { unsigned long expire = jiffies + dev->timeout; @@ -523,7 +523,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, /* Event 43: Peripheral sets nAck low. It can take as long as it wants. */ - while (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) { + while (parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0)) { /* The peripheral hasn't given us data in 35ms. If we have data to give back to the caller, do it now. */ @@ -532,21 +532,21 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, /* If we've used up all the time we were allowed, give up altogether. */ - if (!time_before (jiffies, expire)) + if (!time_before(jiffies, expire)) goto out; /* Yield the port for a while. */ if (count && dev->port->irq != PARPORT_IRQ_NONE) { - parport_release (dev); + parport_release(dev); schedule_timeout_interruptible(msecs_to_jiffies(40)); - parport_claim_or_block (dev); + parport_claim_or_block(dev); } else /* We must have the device claimed here. */ - parport_wait_event (port, msecs_to_jiffies(40)); + parport_wait_event(port, msecs_to_jiffies(40)); /* Is there a signal pending? */ - if (signal_pending (current)) + if (signal_pending(current)) goto out; } @@ -556,23 +556,23 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, this can't be as well. */ command = 0; else - command = (parport_read_status (port) & + command = (parport_read_status(port) & PARPORT_STATUS_BUSY) ? 1 : 0; /* Read the data. */ - byte = parport_read_data (port); + byte = parport_read_data(port); /* If this is a channel command, rather than an RLE command or a normal data byte, don't accept it. */ if (command) { if (byte & 0x80) { - DPRINTK (KERN_DEBUG "%s: stopping short at " + DPRINTK(KERN_DEBUG "%s: stopping short at " "channel command (%02x)\n", port->name, byte); goto out; } else if (port->ieee1284.mode != IEEE1284_MODE_ECPRLE) - DPRINTK (KERN_DEBUG "%s: device illegally " + DPRINTK(KERN_DEBUG "%s: device illegally " "using RLE; accepting anyway\n", port->name); @@ -580,7 +580,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, /* Are we allowed to read that many bytes? */ if (rle_count > (len - count)) { - DPRINTK (KERN_DEBUG "%s: leaving %d RLE bytes " + DPRINTK(KERN_DEBUG "%s: leaving %d RLE bytes " "for next time\n", port->name, rle_count); break; @@ -590,17 +590,17 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, } /* Event 44: Set HostAck high, acknowledging handshake. */ - parport_write_control (port, ctl); + parport_write_control(port, ctl); /* Event 45: The peripheral has 35ms to set nAck high. */ - if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, + if (parport_wait_peripheral(port, PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* It's gone wrong. Return what data we have to the caller. */ - DPRINTK (KERN_DEBUG "ECP read timed out at 45\n"); + DPRINTK(KERN_DEBUG "ECP read timed out at 45\n"); if (command) - printk (KERN_WARNING + printk(KERN_WARNING "%s: command ignored (%02x)\n", port->name, byte); @@ -608,7 +608,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, } /* Event 46: Set HostAck low and accept the data. */ - parport_write_control (port, + parport_write_control(port, ctl | PARPORT_CONTROL_AUTOFD); /* If we just read a run-length count, fetch the data. */ @@ -618,10 +618,10 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, /* If this is the byte after a run-length count, decompress. */ if (rle) { rle = 0; - memset (buf, byte, rle_count); + memset(buf, byte, rle_count); buf += rle_count; count += rle_count; - DPRINTK (KERN_DEBUG "%s: decompressed to %d bytes\n", + DPRINTK(KERN_DEBUG "%s: decompressed to %d bytes\n", port->name, rle_count); } else { /* Normal data byte. */ @@ -637,7 +637,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, } /* ECP mode, forward channel, commands. */ -size_t parport_ieee1284_ecp_write_addr (struct parport *port, +size_t parport_ieee1284_ecp_write_addr(struct parport *port, const void *buffer, size_t len, int flags) { @@ -651,13 +651,13 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port, port = port->physport; if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) - if (ecp_reverse_to_forward (port)) + if (ecp_reverse_to_forward(port)) return 0; port->ieee1284.phase = IEEE1284_PH_FWD_DATA; /* HostAck low (command, not data) */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT, @@ -669,17 +669,17 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port, byte = *buf; try_again: - parport_write_data (port, byte); - parport_frob_control (port, PARPORT_CONTROL_STROBE, + parport_write_data(port, byte); + parport_frob_control(port, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); - udelay (5); + udelay(5); for (retry = 0; retry < 100; retry++) { - if (!parport_wait_peripheral (port, + if (!parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0)) goto success; - if (signal_pending (current)) { - parport_frob_control (port, + if (signal_pending(current)) { + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); break; @@ -687,33 +687,33 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port, } /* Time for Host Transfer Recovery (page 41 of IEEE1284) */ - DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); + DPRINTK(KERN_DEBUG "%s: ECP transfer stalled!\n", port->name); - parport_frob_control (port, PARPORT_CONTROL_INIT, + parport_frob_control(port, PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); - udelay (50); - if (parport_read_status (port) & PARPORT_STATUS_PAPEROUT) { + udelay(50); + if (parport_read_status(port) & PARPORT_STATUS_PAPEROUT) { /* It's buggered. */ - parport_frob_control (port, PARPORT_CONTROL_INIT, 0); + parport_frob_control(port, PARPORT_CONTROL_INIT, 0); break; } - parport_frob_control (port, PARPORT_CONTROL_INIT, 0); - udelay (50); - if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT)) + parport_frob_control(port, PARPORT_CONTROL_INIT, 0); + udelay(50); + if (!(parport_read_status(port) & PARPORT_STATUS_PAPEROUT)) break; - DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n", + DPRINTK(KERN_DEBUG "%s: Host transfer recovered\n", port->name); - if (time_after_eq (jiffies, expire)) + if (time_after_eq(jiffies, expire)) break; goto try_again; success: - parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); - udelay (5); - if (parport_wait_peripheral (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); + udelay(5); + if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, PARPORT_STATUS_BUSY)) /* Peripheral hasn't accepted the data. */ @@ -731,7 +731,7 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port, * ***/ /* EPP mode, forward channel, data. */ -size_t parport_ieee1284_epp_write_data (struct parport *port, +size_t parport_ieee1284_epp_write_data(struct parport *port, const void *buffer, size_t len, int flags) { @@ -739,29 +739,29 @@ size_t parport_ieee1284_epp_write_data (struct parport *port, size_t ret = 0; /* set EPP idle state (just to make sure) with strobe low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT); - port->ops->data_forward (port); + port->ops->data_forward(port); for (; len > 0; len--, bp++) { /* Event 62: Write data and set autofd low */ - parport_write_data (port, *bp); - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, + parport_write_data(port, *bp); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 58: wait for busy (nWait) to go high */ - if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, 0, 10)) + if (parport_poll_peripheral(port, PARPORT_STATUS_BUSY, 0, 10)) break; /* Event 63: set nAutoFd (nDStrb) high */ - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); /* Event 60: wait for busy (nWait) to go low */ - if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, + if (parport_poll_peripheral(port, PARPORT_STATUS_BUSY, PARPORT_STATUS_BUSY, 5)) break; @@ -769,13 +769,13 @@ size_t parport_ieee1284_epp_write_data (struct parport *port, } /* Event 61: set strobe (nWrite) high */ - parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); return ret; } /* EPP mode, reverse channel, data. */ -size_t parport_ieee1284_epp_read_data (struct parport *port, +size_t parport_ieee1284_epp_read_data(struct parport *port, void *buffer, size_t len, int flags) { @@ -783,43 +783,43 @@ size_t parport_ieee1284_epp_read_data (struct parport *port, unsigned ret = 0; /* set EPP idle state (just to make sure) with strobe high */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); - port->ops->data_reverse (port); + port->ops->data_reverse(port); for (; len > 0; len--, bp++) { /* Event 67: set nAutoFd (nDStrb) low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD); /* Event 58: wait for Busy to go high */ - if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0)) { + if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0)) { break; } - *bp = parport_read_data (port); + *bp = parport_read_data(port); /* Event 63: set nAutoFd (nDStrb) high */ - parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); + parport_frob_control(port, PARPORT_CONTROL_AUTOFD, 0); /* Event 60: wait for Busy to go low */ - if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, + if (parport_poll_peripheral(port, PARPORT_STATUS_BUSY, PARPORT_STATUS_BUSY, 5)) { break; } ret++; } - port->ops->data_forward (port); + port->ops->data_forward(port); return ret; } /* EPP mode, forward channel, addresses. */ -size_t parport_ieee1284_epp_write_addr (struct parport *port, +size_t parport_ieee1284_epp_write_addr(struct parport *port, const void *buffer, size_t len, int flags) { @@ -827,29 +827,29 @@ size_t parport_ieee1284_epp_write_addr (struct parport *port, size_t ret = 0; /* set EPP idle state (just to make sure) with strobe low */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT); - port->ops->data_forward (port); + port->ops->data_forward(port); for (; len > 0; len--, bp++) { /* Event 56: Write data and set nAStrb low. */ - parport_write_data (port, *bp); - parport_frob_control (port, PARPORT_CONTROL_SELECT, + parport_write_data(port, *bp); + parport_frob_control(port, PARPORT_CONTROL_SELECT, PARPORT_CONTROL_SELECT); /* Event 58: wait for busy (nWait) to go high */ - if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, 0, 10)) + if (parport_poll_peripheral(port, PARPORT_STATUS_BUSY, 0, 10)) break; /* Event 59: set nAStrb high */ - parport_frob_control (port, PARPORT_CONTROL_SELECT, 0); + parport_frob_control(port, PARPORT_CONTROL_SELECT, 0); /* Event 60: wait for busy (nWait) to go low */ - if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, + if (parport_poll_peripheral(port, PARPORT_STATUS_BUSY, PARPORT_STATUS_BUSY, 5)) break; @@ -857,13 +857,13 @@ size_t parport_ieee1284_epp_write_addr (struct parport *port, } /* Event 61: set strobe (nWrite) high */ - parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); + parport_frob_control(port, PARPORT_CONTROL_STROBE, 0); return ret; } /* EPP mode, reverse channel, addresses. */ -size_t parport_ieee1284_epp_read_addr (struct parport *port, +size_t parport_ieee1284_epp_read_addr(struct parport *port, void *buffer, size_t len, int flags) { @@ -871,37 +871,37 @@ size_t parport_ieee1284_epp_read_addr (struct parport *port, unsigned ret = 0; /* Set EPP idle state (just to make sure) with strobe high */ - parport_frob_control (port, + parport_frob_control(port, PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); - port->ops->data_reverse (port); + port->ops->data_reverse(port); for (; len > 0; len--, bp++) { /* Event 64: set nSelectIn (nAStrb) low */ - parport_frob_control (port, PARPORT_CONTROL_SELECT, + parport_frob_control(port, PARPORT_CONTROL_SELECT, PARPORT_CONTROL_SELECT); /* Event 58: wait for Busy to go high */ - if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0)) { + if (parport_wait_peripheral(port, PARPORT_STATUS_BUSY, 0)) { break; } - *bp = parport_read_data (port); + *bp = parport_read_data(port); /* Event 59: set nSelectIn (nAStrb) high */ - parport_frob_control (port, PARPORT_CONTROL_SELECT, + parport_frob_control(port, PARPORT_CONTROL_SELECT, 0); /* Event 60: wait for Busy to go low */ - if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, + if (parport_poll_peripheral(port, PARPORT_STATUS_BUSY, PARPORT_STATUS_BUSY, 5)) break; ret++; } - port->ops->data_forward (port); + port->ops->data_forward(port); return ret; } diff --git a/drivers/parport/parport_atari.c b/drivers/parport/parport_atari.c index a81cd2a2747f..b8da1b5f550c 100644 --- a/drivers/parport/parport_atari.c +++ b/drivers/parport/parport_atari.c @@ -194,13 +194,13 @@ static int __init parport_atari_init(void) return -ENODEV; if (request_irq(IRQ_MFP_BUSY, parport_irq_handler, 0, p->name, p)) { - parport_put_port (p); + parport_put_port(p); return -ENODEV; } this_port = p; printk(KERN_INFO "%s: Atari built-in port using irq\n", p->name); - parport_announce_port (p); + parport_announce_port(p); return 0; } diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index fc1c4192121b..626df53d6d9d 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -65,8 +65,8 @@ static int clear_epp_timeout(struct parport *pb) /* To clear timeout some chips require double read */ parport_gsc_read_status(pb); r = parport_gsc_read_status(pb); - parport_writeb (r | 0x01, STATUS (pb)); /* Some reset by writing 1 */ - parport_writeb (r & 0xfe, STATUS (pb)); /* Others by writing 0 */ + parport_writeb(r | 0x01, STATUS(pb)); /* Some reset by writing 1 */ + parport_writeb(r & 0xfe, STATUS(pb)); /* Others by writing 0 */ r = parport_gsc_read_status(pb); return !(r & 0x01); @@ -87,12 +87,12 @@ void parport_gsc_init_state(struct pardevice *dev, struct parport_state *s) void parport_gsc_save_state(struct parport *p, struct parport_state *s) { - s->u.pc.ctr = parport_readb (CONTROL (p)); + s->u.pc.ctr = parport_readb(CONTROL(p)); } void parport_gsc_restore_state(struct parport *p, struct parport_state *s) { - parport_writeb (s->u.pc.ctr, CONTROL (p)); + parport_writeb(s->u.pc.ctr, CONTROL(p)); } struct parport_operations parport_gsc_ops = @@ -151,19 +151,19 @@ static int parport_SPP_supported(struct parport *pb) /* Do a simple read-write test to make sure the port exists. */ w = 0xc; - parport_writeb (w, CONTROL (pb)); + parport_writeb(w, CONTROL(pb)); /* Is there a control register that we can read from? Some * ports don't allow reads, so read_control just returns a * software copy. Some ports _do_ allow reads, so bypass the * software copy here. In addition, some bits aren't * writable. */ - r = parport_readb (CONTROL (pb)); + r = parport_readb(CONTROL(pb)); if ((r & 0xf) == w) { w = 0xe; - parport_writeb (w, CONTROL (pb)); - r = parport_readb (CONTROL (pb)); - parport_writeb (0xc, CONTROL (pb)); + parport_writeb(w, CONTROL(pb)); + r = parport_readb(CONTROL(pb)); + parport_writeb(0xc, CONTROL(pb)); if ((r & 0xf) == w) return PARPORT_MODE_PCSPP; } @@ -171,12 +171,12 @@ static int parport_SPP_supported(struct parport *pb) /* Try the data register. The data lines aren't tri-stated at * this stage, so we expect back what we wrote. */ w = 0xaa; - parport_gsc_write_data (pb, w); - r = parport_gsc_read_data (pb); + parport_gsc_write_data(pb, w); + r = parport_gsc_read_data(pb); if (r == w) { w = 0x55; - parport_gsc_write_data (pb, w); - r = parport_gsc_read_data (pb); + parport_gsc_write_data(pb, w); + r = parport_gsc_read_data(pb); if (r == w) return PARPORT_MODE_PCSPP; } @@ -208,7 +208,7 @@ static int parport_PS2_supported(struct parport *pb) clear_epp_timeout(pb); /* try to tri-state the buffer */ - parport_gsc_data_reverse (pb); + parport_gsc_data_reverse(pb); parport_gsc_write_data(pb, 0x55); if (parport_gsc_read_data(pb) != 0x55) @@ -219,7 +219,7 @@ static int parport_PS2_supported(struct parport *pb) ok++; /* cancel input mode */ - parport_gsc_data_forward (pb); + parport_gsc_data_forward(pb); if (ok) { pb->modes |= PARPORT_MODE_TRISTATE; @@ -243,17 +243,17 @@ struct parport *parport_gsc_probe_port(unsigned long base, struct parport tmp; struct parport *p = &tmp; - priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); + priv = kzalloc(sizeof(struct parport_gsc_private), GFP_KERNEL); if (!priv) { - printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); + printk(KERN_DEBUG "parport (0x%lx): no memory!\n", base); return NULL; } ops = kmemdup(&parport_gsc_ops, sizeof(struct parport_operations), GFP_KERNEL); if (!ops) { - printk (KERN_DEBUG "parport (0x%lx): no memory for ops!\n", + printk(KERN_DEBUG "parport (0x%lx): no memory for ops!\n", base); - kfree (priv); + kfree(priv); return NULL; } priv->ctr = 0xc; @@ -268,18 +268,18 @@ struct parport *parport_gsc_probe_port(unsigned long base, p->ops = ops; p->private_data = priv; p->physport = p; - if (!parport_SPP_supported (p)) { + if (!parport_SPP_supported(p)) { /* No port. */ - kfree (priv); + kfree(priv); kfree(ops); return NULL; } - parport_PS2_supported (p); + parport_PS2_supported(p); if (!(p = parport_register_port(base, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, ops))) { - kfree (priv); - kfree (ops); + kfree(priv); + kfree(ops); return NULL; } @@ -320,9 +320,9 @@ struct parport *parport_gsc_probe_port(unsigned long base, pr_cont("]\n"); if (p->irq != PARPORT_IRQ_NONE) { - if (request_irq (p->irq, parport_irq_handler, + if (request_irq(p->irq, parport_irq_handler, 0, p->name, p)) { - printk (KERN_WARNING "%s: irq %d in use, " + printk(KERN_WARNING "%s: irq %d in use, " "resorting to polled operation\n", p->name, p->irq); p->irq = PARPORT_IRQ_NONE; @@ -333,12 +333,12 @@ struct parport *parport_gsc_probe_port(unsigned long base, /* Done probing. Now put the port into a sensible start-up state. */ parport_gsc_write_data(p, 0); - parport_gsc_data_forward (p); + parport_gsc_data_forward(p); /* Now that we've told the sharing engine about the port, and found out its characteristics, let the high-level drivers know about it. */ - parport_announce_port (p); + parport_announce_port(p); return p; } @@ -368,7 +368,7 @@ static int parport_init_chip(struct parisc_device *dev) /* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */ printk("%s: initialize bidirectional-mode.\n", __func__); - parport_writeb ( (0x10 + 0x20), port + 4); + parport_writeb((0x10 + 0x20), port + 4); } else { printk("%s: enhanced parport-modes not supported.\n", __func__); @@ -398,9 +398,9 @@ static int parport_remove_chip(struct parisc_device *dev) pci_free_consistent(priv->dev, PAGE_SIZE, priv->dma_buf, priv->dma_handle); - kfree (p->private_data); + kfree(p->private_data); parport_put_port(p); - kfree (ops); /* hope no-one cached it */ + kfree(ops); /* hope no-one cached it */ } return 0; } diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c index 2f650f68af14..d650b00ce38a 100644 --- a/drivers/parport/parport_mfc3.c +++ b/drivers/parport/parport_mfc3.c @@ -328,7 +328,7 @@ static int __init parport_mfc3_init(void) /* XXX: set operating mode */ p->private_data = (void *)piabase; - parport_announce_port (p); + parport_announce_port(p); if (pias >= MAX_MFC) break; diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index e15b4845f7c6..1d955f5e8da3 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -522,7 +522,7 @@ struct parport_serial_private { /* Register the serial port(s) of a PCI card. */ static int serial_register(struct pci_dev *dev, const struct pci_device_id *id) { - struct parport_serial_private *priv = pci_get_drvdata (dev); + struct parport_serial_private *priv = pci_get_drvdata(dev); struct pciserial_board *board; struct serial_private *serial; @@ -544,13 +544,13 @@ static int serial_register(struct pci_dev *dev, const struct pci_device_id *id) static int parport_register(struct pci_dev *dev, const struct pci_device_id *id) { struct parport_pc_pci *card; - struct parport_serial_private *priv = pci_get_drvdata (dev); + struct parport_serial_private *priv = pci_get_drvdata(dev); int n, success = 0; priv->par = cards[id->driver_data]; card = &priv->par; if (card->preinit_hook && - card->preinit_hook (dev, card, PARPORT_IRQ_NONE, PARPORT_DMA_NONE)) + card->preinit_hook(dev, card, PARPORT_IRQ_NONE, PARPORT_DMA_NONE)) return -ENODEV; for (n = 0; n < card->numports; n++) { @@ -560,18 +560,18 @@ static int parport_register(struct pci_dev *dev, const struct pci_device_id *id) unsigned long io_lo, io_hi; int irq; - if (priv->num_par == ARRAY_SIZE (priv->port)) { - printk (KERN_WARNING + if (priv->num_par == ARRAY_SIZE(priv->port)) { + printk(KERN_WARNING "parport_serial: %s: only %zu parallel ports " - "supported (%d reported)\n", pci_name (dev), + "supported (%d reported)\n", pci_name(dev), ARRAY_SIZE(priv->port), card->numports); break; } - io_lo = pci_resource_start (dev, lo); + io_lo = pci_resource_start(dev, lo); io_hi = 0; if ((hi >= 0) && (hi <= 6)) - io_hi = pci_resource_start (dev, hi); + io_hi = pci_resource_start(dev, hi); else if (hi > 6) io_lo += hi; /* Reinterpret the meaning of "hi" as an offset (see SYBA @@ -588,7 +588,7 @@ static int parport_register(struct pci_dev *dev, const struct pci_device_id *id) "PCI parallel port detected: I/O at %#lx(%#lx), IRQ %d\n", io_lo, io_hi, irq); } - port = parport_pc_probe_port (io_lo, io_hi, irq, + port = parport_pc_probe_port(io_lo, io_hi, irq, PARPORT_DMA_NONE, &dev->dev, IRQF_SHARED); if (port) { priv->port[priv->num_par++] = port; @@ -597,7 +597,7 @@ static int parport_register(struct pci_dev *dev, const struct pci_device_id *id) } if (card->postinit_hook) - card->postinit_hook (dev, card, !success); + card->postinit_hook(dev, card, !success); return 0; } @@ -608,27 +608,27 @@ static int parport_serial_pci_probe(struct pci_dev *dev, struct parport_serial_private *priv; int err; - priv = kzalloc (sizeof *priv, GFP_KERNEL); + priv = kzalloc(sizeof *priv, GFP_KERNEL); if (!priv) return -ENOMEM; - pci_set_drvdata (dev, priv); + pci_set_drvdata(dev, priv); - err = pci_enable_device (dev); + err = pci_enable_device(dev); if (err) { - kfree (priv); + kfree(priv); return err; } - if (parport_register (dev, id)) { - kfree (priv); + if (parport_register(dev, id)) { + kfree(priv); return -ENODEV; } - if (serial_register (dev, id)) { + if (serial_register(dev, id)) { int i; for (i = 0; i < priv->num_par; i++) - parport_pc_unregister_port (priv->port[i]); - kfree (priv); + parport_pc_unregister_port(priv->port[i]); + kfree(priv); return -ENODEV; } @@ -637,7 +637,7 @@ static int parport_serial_pci_probe(struct pci_dev *dev, static void parport_serial_pci_remove(struct pci_dev *dev) { - struct parport_serial_private *priv = pci_get_drvdata (dev); + struct parport_serial_private *priv = pci_get_drvdata(dev); int i; // Serial ports @@ -646,9 +646,9 @@ static void parport_serial_pci_remove(struct pci_dev *dev) // Parallel ports for (i = 0; i < priv->num_par; i++) - parport_pc_unregister_port (priv->port[i]); + parport_pc_unregister_port(priv->port[i]); - kfree (priv); + kfree(priv); return; } @@ -706,14 +706,14 @@ static struct pci_driver parport_serial_pci_driver = { }; -static int __init parport_serial_init (void) +static int __init parport_serial_init(void) { - return pci_register_driver (&parport_serial_pci_driver); + return pci_register_driver(&parport_serial_pci_driver); } -static void __exit parport_serial_exit (void) +static void __exit parport_serial_exit(void) { - pci_unregister_driver (&parport_serial_pci_driver); + pci_unregister_driver(&parport_serial_pci_driver); return; } diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index 01cf1c1a841a..c87bf4ac2006 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c @@ -184,7 +184,7 @@ static void parport_sunbpp_write_control(struct parport *p, unsigned char d) PARPORT_CONTROL_INIT | PARPORT_CONTROL_SELECT); - parport_sunbpp_frob_control (p, wm, d & wm); + parport_sunbpp_frob_control(p, wm, d & wm); } static unsigned char parport_sunbpp_read_status(struct parport *p) @@ -192,7 +192,7 @@ static unsigned char parport_sunbpp_read_status(struct parport *p) return status_sunbpp_to_pc(p); } -static void parport_sunbpp_data_forward (struct parport *p) +static void parport_sunbpp_data_forward(struct parport *p) { struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; unsigned char value_tcr = sbus_readb(®s->p_tcr); @@ -202,7 +202,7 @@ static void parport_sunbpp_data_forward (struct parport *p) sbus_writeb(value_tcr, ®s->p_tcr); } -static void parport_sunbpp_data_reverse (struct parport *p) +static void parport_sunbpp_data_reverse(struct parport *p) { struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; u8 val = sbus_readb(®s->p_tcr); diff --git a/drivers/parport/probe.c b/drivers/parport/probe.c index f2618cc1c793..8a6b8a36fe36 100644 --- a/drivers/parport/probe.c +++ b/drivers/parport/probe.c @@ -40,9 +40,9 @@ static void pretty_print(struct parport *port, int device) printk(KERN_INFO "%s", port->name); if (device >= 0) - printk (" (addr %d)", device); + printk(" (addr %d)", device); - printk (": %s", classes[info->class].descr); + printk(": %s", classes[info->class].descr); if (info->class) printk(", %s %s", info->mfr, info->model); @@ -72,7 +72,7 @@ static void parse_data(struct parport *port, int device, char *str) char *u; *(sep++) = 0; /* Get rid of trailing blanks */ - u = sep + strlen (sep) - 1; + u = sep + strlen(sep) - 1; while (u >= p && *u == ' ') *u-- = '\0'; u = p; @@ -134,7 +134,7 @@ static void parse_data(struct parport *port, int device, char *str) /* Read up to count-1 bytes of device id. Terminate buffer with * '\0'. Buffer begins with two Device ID length bytes as given by * device. */ -static ssize_t parport_read_device_id (struct parport *port, char *buffer, +static ssize_t parport_read_device_id(struct parport *port, char *buffer, size_t count) { unsigned char length[2]; @@ -146,7 +146,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, size_t len; /* First two bytes are MSB,LSB of inclusive length. */ - retval = parport_read (port, length, 2); + retval = parport_read(port, length, 2); if (retval < 0) return retval; @@ -178,7 +178,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, * just return constant nibble forever. This catches * also those cases. */ if (idlens[0] == 0 || idlens[0] > 0xFFF) { - printk (KERN_DEBUG "%s: reported broken Device ID" + printk(KERN_DEBUG "%s: reported broken Device ID" " length of %#zX bytes\n", port->name, idlens[0]); return -EIO; @@ -194,7 +194,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, if (idlen+1 >= count) break; - retval = parport_read (port, buffer+len, idlen-len); + retval = parport_read(port, buffer+len, idlen-len); if (retval < 0) return retval; @@ -202,7 +202,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, if (port->physport->ieee1284.phase != IEEE1284_PH_HBUSY_DAVAIL) { if (belen != len) { - printk (KERN_DEBUG "%s: Device ID was %zd bytes" + printk(KERN_DEBUG "%s: Device ID was %zd bytes" " while device told it would be %d" " bytes\n", port->name, len, belen); @@ -215,7 +215,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, * the first 256 bytes or so that we must have read so * far. */ if (buffer[len-1] == ';') { - printk (KERN_DEBUG "%s: Device ID reading stopped" + printk(KERN_DEBUG "%s: Device ID reading stopped" " before device told data not available. " "Current idlen %u of %u, len bytes %02X %02X\n", port->name, current_idlen, numidlens, @@ -227,7 +227,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, /* Buffer not large enough, read to end of buffer. */ size_t idlen, len2; if (len+1 < count) { - retval = parport_read (port, buffer+len, count-len-1); + retval = parport_read(port, buffer+len, count-len-1); if (retval < 0) return retval; len += retval; @@ -239,7 +239,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, len2 = len; while(len2 < idlen && retval > 0) { char tmp[4]; - retval = parport_read (port, tmp, + retval = parport_read(port, tmp, min(sizeof tmp, idlen-len2)); if (retval < 0) return retval; @@ -255,30 +255,30 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer, } /* Get Std 1284 Device ID. */ -ssize_t parport_device_id (int devnum, char *buffer, size_t count) +ssize_t parport_device_id(int devnum, char *buffer, size_t count) { ssize_t retval = -ENXIO; - struct pardevice *dev = parport_open (devnum, "Device ID probe"); + struct pardevice *dev = parport_open(devnum, "Device ID probe"); if (!dev) return -ENXIO; - parport_claim_or_block (dev); + parport_claim_or_block(dev); /* Negotiate to compatibility mode, and then to device ID * mode. (This so that we start form beginning of device ID if * already in device ID mode.) */ - parport_negotiate (dev->port, IEEE1284_MODE_COMPAT); - retval = parport_negotiate (dev->port, + parport_negotiate(dev->port, IEEE1284_MODE_COMPAT); + retval = parport_negotiate(dev->port, IEEE1284_MODE_NIBBLE | IEEE1284_DEVICEID); if (!retval) { - retval = parport_read_device_id (dev->port, buffer, count); - parport_negotiate (dev->port, IEEE1284_MODE_COMPAT); + retval = parport_read_device_id(dev->port, buffer, count); + parport_negotiate(dev->port, IEEE1284_MODE_COMPAT); if (retval > 2) - parse_data (dev->port, dev->daisy, buffer+2); + parse_data(dev->port, dev->daisy, buffer+2); } - parport_release (dev); - parport_close (dev); + parport_release(dev); + parport_close(dev); return retval; } diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 8ee44a104ac4..6ee97b5849c5 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -86,19 +86,19 @@ static int do_autoprobe(struct ctl_table *table, int write, } if ((str = info->class_name) != NULL) - len += sprintf (buffer + len, "CLASS:%s;\n", str); + len += sprintf(buffer + len, "CLASS:%s;\n", str); if ((str = info->model) != NULL) - len += sprintf (buffer + len, "MODEL:%s;\n", str); + len += sprintf(buffer + len, "MODEL:%s;\n", str); if ((str = info->mfr) != NULL) - len += sprintf (buffer + len, "MANUFACTURER:%s;\n", str); + len += sprintf(buffer + len, "MANUFACTURER:%s;\n", str); if ((str = info->description) != NULL) - len += sprintf (buffer + len, "DESCRIPTION:%s;\n", str); + len += sprintf(buffer + len, "DESCRIPTION:%s;\n", str); if ((str = info->cmdset) != NULL) - len += sprintf (buffer + len, "COMMAND SET:%s;\n", str); + len += sprintf(buffer + len, "COMMAND SET:%s;\n", str); if (len > *lenp) len = *lenp; @@ -107,7 +107,7 @@ static int do_autoprobe(struct ctl_table *table, int write, *ppos += len; - return copy_to_user (result, buffer, len) ? -EFAULT : 0; + return copy_to_user(result, buffer, len) ? -EFAULT : 0; } #endif /* IEEE1284.3 support. */ @@ -127,7 +127,7 @@ static int do_hardware_base_addr(struct ctl_table *table, int write, if (write) /* permissions prevent this anyway */ return -EACCES; - len += sprintf (buffer, "%lu\t%lu\n", port->base, port->base_hi); + len += sprintf(buffer, "%lu\t%lu\n", port->base, port->base_hi); if (len > *lenp) len = *lenp; @@ -155,7 +155,7 @@ static int do_hardware_irq(struct ctl_table *table, int write, if (write) /* permissions prevent this anyway */ return -EACCES; - len += sprintf (buffer, "%d\n", port->irq); + len += sprintf(buffer, "%d\n", port->irq); if (len > *lenp) len = *lenp; @@ -183,7 +183,7 @@ static int do_hardware_dma(struct ctl_table *table, int write, if (write) /* permissions prevent this anyway */ return -EACCES; - len += sprintf (buffer, "%d\n", port->dma); + len += sprintf(buffer, "%d\n", port->dma); if (len > *lenp) len = *lenp; @@ -606,12 +606,12 @@ int parport_device_proc_unregister(struct pardevice *device) return 0; } -static int __init parport_default_proc_register (void) +static int __init parport_default_proc_register(void) { return parport_bus_init(); } -static void __exit parport_default_proc_unregister (void) +static void __exit parport_default_proc_unregister(void) { parport_bus_exit(); } -- 2.11.0