parport: cleanup several checkpatch issues
Subsystems (2)
cover parport: cleanup several checkpatch issues
cleanup 6 type of checkpatch issues, each type per patch:
- trailing statements should be on next line
- space prohibited between function name and open parenthesis '('
- do not initialise statics to 0 / NULL
- that open brace { should be on the previous line
- braces {} are not necessary for any arm of this statement
The patchset was based on linux next, tag next-20170714
Carlos Palminha (5):
parport: add newline to trailing statements
parport: cleanup prohibited space after functions name
parport: cleanup statics initialization to NULL or 0
parport: move open braces to the same line
parport: remove unnecessary braces
drivers/parport/daisy.c | 12 +- drivers/parport/ieee1284.c | 267 +++++++++++++++--------------- drivers/parport/ieee1284_ops.c | 345 ++++++++++++++++++++------------------- drivers/parport/parport_atari.c | 6 +- drivers/parport/parport_cs.c | 4 +- drivers/parport/parport_gsc.c | 78 ++++----- drivers/parport/parport_ip32.c | 2 +- drivers/parport/parport_mfc3.c | 4 +- drivers/parport/parport_pc.c | 3 +- drivers/parport/parport_serial.c | 52 +++--- drivers/parport/parport_sunbpp.c | 29 ++-- drivers/parport/probe.c | 46 +++--- drivers/parport/procfs.c | 28 ++-- 13 files changed, 438 insertions(+), 438 deletions(-)
Signature · 1 line
2.11.0
PATCH 1/5 parport: add newline to trailing statements
based on checkpatch, add newline to trailing statements
--- drivers/parport/daisy.c | 7 +++++-- drivers/parport/ieee1284.c | 17 +++++++++-------- drivers/parport/ieee1284_ops.c | 8 ++++++-- drivers/parport/parport_cs.c | 4 +++- drivers/parport/parport_gsc.c | 6 ++++-- drivers/parport/probe.c | 4 +++- 6 files changed, 30 insertions(+), 16 deletions(-)
drivers/parport/daisy.c +5 -2
@@ -191,7 +191,9 @@ void parport_daisy_fini(struct parport *port)/* Gaps in the numbering could be handled better. How should someone enumerate through all IEEE1284.3 devices in the topology?. */ -if (!topology) numdevs =0 ; +if (!topology) + numdevs =0 ; +spin_unlock (&topology_lock);return ; }
@@ -472,7 +474,8 @@ static int assign_addrs(struct parport *port)/* Ask the new devices to introduce themselves. */ deviceid =kmalloc (1024 ,GFP_KERNEL ); -if (!deviceid)return 0 ; +if (!deviceid) +return 0 ;for (daisy =0 ; thisdev < numdevs; thisdev++, daisy++)parport_device_id (thisdev, deviceid,1024 );
drivers/parport/ieee1284.c +9 -8
@@ -536,16 +536,17 @@ int parport_negotiate (struct parport *port, int mode) port->ieee1284.phase =IEEE1284_PH_FWD_IDLE ;DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n" , port->name); - }else switch (mode) { -case IEEE1284_MODE_NIBBLE : -case IEEE1284_MODE_BYTE : - port->ieee1284.phase =IEEE1284_PH_REV_IDLE ; -break ; -default : - port->ieee1284.phase =IEEE1284_PH_FWD_IDLE ; + }else { +switch (mode) { +case IEEE1284_MODE_NIBBLE : +case IEEE1284_MODE_BYTE : + port->ieee1284.phase =IEEE1284_PH_REV_IDLE ; +break ; +default : + port->ieee1284.phase =IEEE1284_PH_FWD_IDLE ; + } } -return 0 ;#endif /* IEEE1284 support */ }
drivers/parport/ieee1284_ops.c +6 -2
@@ -468,7 +468,9 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port,DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n" , port->name); -if (time_after_eq (jiffies, expire))break ; +if (time_after_eq (jiffies, expire)) +break ; + goto try_again; success:parport_frob_control (port,PARPORT_CONTROL_STROBE ,0 );
@@ -704,7 +706,9 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port,DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n" , port->name); -if (time_after_eq (jiffies, expire))break ; +if (time_after_eq (jiffies, expire)) +break ; + goto try_again; success:parport_frob_control (port,PARPORT_CONTROL_STROBE ,0 );
drivers/parport/parport_cs.c +3 -1
@@ -88,7 +88,9 @@ static int parport_probe(struct pcmcia_device *link)/* Create new parport device */ info =kzalloc (sizeof (*info),GFP_KERNEL ); -if (!info)return -ENOMEM ; +if (!info) +return -ENOMEM ; + link->priv = info; info->p_dev = link;
drivers/parport/parport_gsc.c +4 -2
@@ -211,10 +211,12 @@ static int parport_PS2_supported(struct parport *pb)parport_gsc_data_reverse (pb);parport_gsc_write_data (pb,0x55 ); -if (parport_gsc_read_data (pb) !=0x55 ) ok++; +if (parport_gsc_read_data (pb) !=0x55 ) + ok++;parport_gsc_write_data (pb,0xaa ); -if (parport_gsc_read_data (pb) !=0xaa ) ok++; +if (parport_gsc_read_data (pb) !=0xaa ) + ok++;/* cancel input mode */ parport_gsc_data_forward (pb);
drivers/parport/probe.c +3 -1
@@ -64,7 +64,9 @@ static void parse_data(struct parport *port, int device, char *str)while (p) {char *sep; q =strchr (p,';' ); -if (q) *q =0 ; +if (q) + *q =0 ; + sep =strchr (p,':' );if (sep) {char *u;
Signature · 1 line
2.11.0
Sudip Mukherjee
maintainerRe: [PATCH 1/5] parport: add newline to trailing statements
Hi,
Quoted 11 lines · Carlos Palminha
based on checkpatch, add newline to trailing statements
Signed-off-by Carlos Palminha <[email protected]>--- drivers/parport/daisy.c | 7 +++++-- drivers/parport/ieee1284.c | 17 +++++++++-------- drivers/parport/ieee1284_ops.c | 8 ++++++-- drivers/parport/parport_cs.c | 4 +++- drivers/parport/parport_gsc.c | 6 ++++-- drivers/parport/probe.c | 4 +++- 6 files changed, 30 insertions(+), 16 deletions(-)
<snip>
Quoted 8 lines
drivers/parport/ieee1284_ops.c +0
-0goto try_again; success:parport_frob_control (port,PARPORT_CONTROL_STROBE ,0 );drivers/parport/parport_cs.c +0
-0
drivers/parport/parport_cs.c static int parport_probe(struct pcmcia_device *link) · line 92
Quoted 6 lines
drivers/parport/parport_cs.c +2
-1@@ -88,7 +88,9 @@ static int parport_probe(struct pcmcia_device *link)/* Create new parport device */ info =kzalloc (sizeof (*info),GFP_KERNEL ); -if (!info)return -ENOMEM ; +if (!info) +return -ENOMEM ;
Please use tab to indent the code. I know some part of this file uses 4 spaces to indent, so if you use one tab before 'return -ENOMEM', it will look perfect.
--
Regards
Sudip
PATCH 2/5 parport: cleanup prohibited space after functions name
In reply to Carlos Palminhabased on checkpatch, remove prohibited space between function name and open parenthesis '('.
--- 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(-)
drivers/parport/ieee1284.c +106 -106
@@ -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; }
drivers/parport/ieee1284_ops.c +169 -169
885 lines not on this page · raw message
drivers/parport/parport_atari.c +2 -2
@@ -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 ; }
drivers/parport/parport_gsc.c +31 -31
168 lines not on this page · raw message
drivers/parport/parport_mfc3.c +1 -1
@@ -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 ;
drivers/parport/parport_serial.c +26 -26
135 lines not on this page · raw message
drivers/parport/parport_sunbpp.c +3 -3
@@ -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);
drivers/parport/probe.c +21 -21
123 lines not on this page · raw message
drivers/parport/procfs.c +11 -11
@@ -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 (); }
Signature · 1 line
2.11.0
Sudip Mukherjee
maintainerRe: [PATCH 2/5] parport: cleanup prohibited space after functions name
Quoted 131 lines · Carlos Palminha
based on checkpatch, remove prohibited space between function name and open parenthesis '('.
Signed-off-by Carlos Palminha <[email protected]>--- 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(-)drivers/parport/ieee1284.c +17
-18@@ -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 );
drivers/parport/ieee1284.c static void parport_ieee1284_terminate (struct parport *port) · line 247
Quoted 10 lines
drivers/parport/ieee1284.c +3
-2-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
Now, the alignment is lost and a new checkpatch error is introduced.
--
Regards
Sudip
PATCH 3/5 parport: cleanup statics initialization to NULL or 0
In reply to Carlos Palminhabased on checkpatch, cleanup the "do not initialise statics to" 0 or NULL.
--- drivers/parport/daisy.c | 2 +- drivers/parport/parport_atari.c | 2 +- drivers/parport/parport_ip32.c | 2 +- drivers/parport/parport_mfc3.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/parport/daisy.c +1 -1
@@ -44,7 +44,7 @@ static struct daisydev { } *topology =NULL ;static DEFINE_SPINLOCK (topology_lock); -static int numdevs =0 ; +static int numdevs;/* Forward-declaration of lower-level functions. */ static int mux_present (struct parport *port);
drivers/parport/parport_atari.c +1 -1
@@ -18,7 +18,7 @@#include <asm/irq.h> #include <asm/atariints.h> -static struct parport *this_port =NULL ; +static struct parport *this_port;static unsigned char parport_atari_read_data (struct parport *p)
drivers/parport/parport_ip32.c +1 -1
@@ -138,7 +138,7 @@ static unsigned int features = ~0U;static bool verbose_probing =DEFAULT_VERBOSE_PROBING ;/* We do not support more than one port. */ -static struct parport *this_port =NULL ; +static struct parport *this_port;/* Timing constants for FIFO modes. */ #define FIFO_NFAULT_TIMEOUT 100/* milliseconds */
drivers/parport/parport_mfc3.c +1 -1
@@ -174,7 +174,7 @@ DPRINTK(KERN_DEBUG "read_status %02x\n", status);return status; } -static int use_cnt =0 ; +static int use_cnt;static irqreturn_t mfc3_interrupt (int irq,void *dev_id) {
Signature · 1 line
2.11.0
PATCH 4/5 parport: move open braces to the same line
In reply to Carlos Palminhabased on checkpatch, cleanup the open braces that "should be on the previous line".
--- drivers/parport/daisy.c | 3 +-- drivers/parport/parport_gsc.c | 3 +-- drivers/parport/parport_sunbpp.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/parport/daisy.c +1 -2
@@ -354,8 +354,7 @@ void parport_daisy_deselect_all(struct parport *port)int parport_daisy_select (struct parport *port,int daisy,int mode) { -switch (mode) - { +switch (mode) {// For these modes we should switch to EPP mode: case IEEE1284_MODE_EPP :case IEEE1284_MODE_EPPSL :
drivers/parport/parport_gsc.c +1 -2
@@ -95,8 +95,7 @@ void parport_gsc_restore_state(struct parport *p, struct parport_state *s)parport_writeb (s->u.pc.ctr,CONTROL (p)); } -struct parport_operations parport_gsc_ops = -{ +struct parport_operations parport_gsc_ops = { .write_data = parport_gsc_write_data, .read_data = parport_gsc_read_data,
drivers/parport/parport_sunbpp.c +1 -2
@@ -228,8 +228,7 @@ static void parport_sunbpp_restore_state(struct parport *p, struct parport_stateparport_sunbpp_write_control (p, s->u.pc.ctr); } -static struct parport_operations parport_sunbpp_ops = -{ +static struct parport_operations parport_sunbpp_ops = { .write_data = parport_sunbpp_write_data, .read_data = parport_sunbpp_read_data,
Signature · 1 line
2.11.0
PATCH 5/5 parport: remove unnecessary braces
In reply to Carlos Palminhabased on checkpatch, remove braces not necessary for statements.
--- drivers/parport/ieee1284.c | 40 ++++++++++++++++++++-------------------- drivers/parport/ieee1284_ops.c | 9 +++------ drivers/parport/parport_gsc.c | 7 +++---- drivers/parport/parport_pc.c | 3 +-- drivers/parport/parport_sunbpp.c | 20 ++++++++------------ drivers/parport/procfs.c | 6 ++---- 6 files changed, 37 insertions(+), 48 deletions(-)
drivers/parport/ieee1284.c +20 -20
@@ -631,29 +631,29 @@ ssize_t parport_write(struct parport *port, const void *buffer, size_t len)case IEEE1284_MODE_EPP :DPRINTK (KERN_DEBUG "%s: Using EPP mode\n" , port->name); -if (addr) { +if (addr) fn = port->ops->epp_write_addr; - }else { +else fn = port->ops->epp_write_data; - } +break ;case IEEE1284_MODE_EPPSWE :DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n" , port->name); -if (addr) { +if (addr) fn = parport_ieee1284_epp_write_addr; - }else { +else fn = parport_ieee1284_epp_write_data; - } +break ;case IEEE1284_MODE_ECP :case IEEE1284_MODE_ECPRLE :DPRINTK (KERN_DEBUG "%s: Using ECP mode\n" , port->name); -if (addr) { +if (addr) fn = port->ops->ecp_write_addr; - }else { +else fn = port->ops->ecp_write_data; - } +break ;case IEEE1284_MODE_ECPSWE :
@@ -661,11 +661,11 @@ ssize_t parport_write(struct parport *port, const void *buffer, size_t len) port->name);/* The caller has specified that it must be emulated, * even if we have ECP hardware! */ -if (addr) { +if (addr) fn = parport_ieee1284_ecp_write_addr; - }else { +else fn = parport_ieee1284_ecp_write_data; - } +break ;default :
@@ -726,9 +726,9 @@ ssize_t parport_read(struct parport *port, void *buffer, size_t len) 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);
@@ -742,20 +742,20 @@ ssize_t parport_read(struct parport *port, void *buffer, size_t len)case IEEE1284_MODE_EPP :DPRINTK (KERN_DEBUG "%s: Using EPP mode\n" , port->name); -if (addr) { +if (addr) fn = port->ops->epp_read_addr; - }else { +else fn = port->ops->epp_read_data; - } +break ;case IEEE1284_MODE_EPPSWE :DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n" , port->name); -if (addr) { +if (addr) fn = parport_ieee1284_epp_read_addr; - }else { +else fn = parport_ieee1284_epp_read_data; - } +break ;case IEEE1284_MODE_ECP :case IEEE1284_MODE_ECPRLE :
drivers/parport/ieee1284_ops.c +3 -6
@@ -251,9 +251,8 @@ 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);
@@ -796,9 +795,8 @@ size_t parport_ieee1284_epp_read_data(struct parport *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);
@@ -884,9 +882,8 @@ size_t parport_ieee1284_epp_read_addr(struct parport *port, 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);
drivers/parport/parport_gsc.c +3 -4
@@ -290,15 +290,14 @@ struct parport *parport_gsc_probe_port(unsigned long base,printk (KERN_INFO "%s: PC-style at 0x%lx" , p->name, p->base); p->irq = irq; -if (p->irq ==PARPORT_IRQ_AUTO ) { +if (p->irq ==PARPORT_IRQ_AUTO ) p->irq =PARPORT_IRQ_NONE ; - } +if (p->irq !=PARPORT_IRQ_NONE ) {pr_cont (", irq %d" , p->irq); -if (p->dma ==PARPORT_DMA_AUTO ) { +if (p->dma ==PARPORT_DMA_AUTO ) p->dma =PARPORT_DMA_NONE ; - } }if (p->dma ==PARPORT_DMA_AUTO )/* To use DMA, giving the irq is mandatory (see above) */
drivers/parport/parport_pc.c +1 -2
@@ -1729,9 +1729,8 @@ static int intel_bug_present_check_epp(struct parport *pb)static int intel_bug_present (struct parport *pb) {/* Check whether the device is legacy, not PCI or PCMCIA. Only legacy is known to be affected. */ -if (pb->dev !=NULL ) { +if (pb->dev !=NULL )return 0 ; - }return intel_bug_present_check_epp (pb); }
drivers/parport/parport_sunbpp.c +8 -12
@@ -142,32 +142,28 @@ static unsigned char parport_sunbpp_frob_control(struct parport *p,dprintk ((KERN_DEBUG "frob1: tcr 0x%x or 0x%x\n" , value_tcr, value_or));if (mask &PARPORT_CONTROL_STROBE ) { -if (val &PARPORT_CONTROL_STROBE ) { +if (val &PARPORT_CONTROL_STROBE ) value_tcr &= ~P_TCR_DS ; - }else { +else value_tcr |=P_TCR_DS ; - } }if (mask &PARPORT_CONTROL_AUTOFD ) { -if (val &PARPORT_CONTROL_AUTOFD ) { +if (val &PARPORT_CONTROL_AUTOFD ) value_or &= ~P_OR_AFXN ; - }else { +else value_or |=P_OR_AFXN ; - } }if (mask &PARPORT_CONTROL_INIT ) { -if (val &PARPORT_CONTROL_INIT ) { +if (val &PARPORT_CONTROL_INIT ) value_or &= ~P_OR_INIT ; - }else { +else value_or |=P_OR_INIT ; - } }if (mask &PARPORT_CONTROL_SELECT ) { -if (val &PARPORT_CONTROL_SELECT ) { +if (val &PARPORT_CONTROL_SELECT ) value_or |=P_OR_SLCT_IN ; - }else { +else value_or &= ~P_OR_SLCT_IN ; - } }sbus_writeb (value_or, ®s->p_or);
drivers/parport/procfs.c +2 -4
@@ -49,14 +49,12 @@ static int do_active_device(struct ctl_table *table, int write, }for (dev = port->devices; dev ; dev = dev->next) { -if (dev == port->cad) { +if (dev == port->cad) len +=sprintf (buffer,"%s\n" , dev->name); - } } -if (!len) { +if (!len) len +=sprintf (buffer,"%s\n" ,"none" ); - }if (len > *lenp) len = *lenp;
Signature · 1 line
2.11.0