* [PATCH 0/6] Fix coding style issues
@ 2015-10-25 18:48 Punit Vara
2015-10-25 18:48 ` [PATCH 1/6] block: Remove unneeded variable err for returning 0 Punit Vara
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
Fixed coding style issues reported by coccicheck and checkpatch tool
Punit Vara (6):
block: Remove unneeded variable err for returning 0
block: drbd: Remove unnedded semicolon
block: Remove unnedded semicolon
block: Coding style fix for comma and open , close parenthesis
block: Coding style fix for comma and open , close parenthesis
block: Coding style fix for comma and open , close parenthesis
drivers/block/ataflop.c | 574 +++++++++++++++++++++---------------------
drivers/block/drbd/drbd_req.c | 2 +-
drivers/block/mg_disk.c | 3 +-
drivers/block/sunvdc.c | 2 +-
4 files changed, 290 insertions(+), 291 deletions(-)
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/6] block: Remove unneeded variable err for returning 0
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
@ 2015-10-25 18:48 ` Punit Vara
2015-10-27 19:11 ` punit vara
2015-10-25 18:48 ` [PATCH 2/6] block: drbd: Remove unnedded semicolon Punit Vara
` (4 subsequent siblings)
5 siblings, 1 reply; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
This patch is to the mg_disk.c file that removes unnecessary err
and fixes following warning reported by coccicheck:
Unneeded variable: "err". Return "0" on line 1077
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/mg_disk.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 145ce2a..d6f3feb 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -1038,7 +1038,6 @@ static int mg_remove(struct platform_device *plat_dev)
{
struct mg_drv_data *prv_data = plat_dev->dev.platform_data;
struct mg_host *host = prv_data->host;
- int err = 0;
/* delete timer */
del_timer_sync(&host->timer);
@@ -1074,7 +1073,7 @@ static int mg_remove(struct platform_device *plat_dev)
/* free mg_host */
kfree(host);
- return err;
+ return 0;
}
static struct platform_driver mg_disk_driver = {
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/6] block: drbd: Remove unnedded semicolon
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
2015-10-25 18:48 ` [PATCH 1/6] block: Remove unneeded variable err for returning 0 Punit Vara
@ 2015-10-25 18:48 ` Punit Vara
2015-10-25 18:48 ` [PATCH 3/6] block: " Punit Vara
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
This patch is to the drbd_req.c file that removes unnecessary semicolon
reported by coccicheck
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/drbd/drbd_req.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 2115926..df905ca 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -897,7 +897,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
start_new_tl_epoch(connection);
mod_rq_state(req, m, 0, RQ_NET_OK|RQ_NET_DONE);
break;
- };
+ }
return rv;
}
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/6] block: Remove unnedded semicolon
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
2015-10-25 18:48 ` [PATCH 1/6] block: Remove unneeded variable err for returning 0 Punit Vara
2015-10-25 18:48 ` [PATCH 2/6] block: drbd: Remove unnedded semicolon Punit Vara
@ 2015-10-25 18:48 ` Punit Vara
2015-10-25 18:48 ` [PATCH 4/6] block: Coding style fix for comma and open , close parenthesis Punit Vara
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
This patch is to the sunvdc.c file that removes unnecessary
semicolon reported by coccicheck
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/sunvdc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 4b911ed..f81f637 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -603,7 +603,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)
case VD_OP_SET_EFI:
return -EOPNOTSUPP;
break;
- };
+ }
map_perm |= LDC_MAP_SHADOW | LDC_MAP_DIRECT | LDC_MAP_IO;
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/6] block: Coding style fix for comma and open , close parenthesis
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
` (2 preceding siblings ...)
2015-10-25 18:48 ` [PATCH 3/6] block: " Punit Vara
@ 2015-10-25 18:48 ` Punit Vara
2015-10-25 18:48 ` [PATCH 5/6] " Punit Vara
2015-10-25 18:48 ` [PATCH 6/6] " Punit Vara
5 siblings, 0 replies; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
Add and remove space as per coding style for loops,comma , open and close
parenthesis.It also removes whitespace.
This patch is to the ataflop.c file that fixes up following ERRORs
reported by checkpatch:
- space prohibited before that close parenthesis ')'
- space prohibited after that open parenthesis '('
- trailing whitespace
- space required after that ',' (ctx:VxV)
- spaces required around that '=' (ctx:VxW)
- space required before the open parenthesis '('
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/ataflop.c | 82 ++++++++++++++++++++++++-------------------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 2104b1b..3cd50a8 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1710,12 +1710,12 @@ static void __init fd_probe( int drive )
UD.connected = 0;
UDT = NULL;
- if (!fd_test_drive_present( drive ))
+ if (!fd_test_drive_present(drive))
return;
UD.connected = 1;
UD.track = 0;
- switch( UserSteprate[drive] ) {
+ switch(UserSteprate[drive]) {
case 2:
UD.steprate = FDCSTEP_2;
break;
@@ -1729,7 +1729,7 @@ static void __init fd_probe( int drive )
UD.steprate = FDCSTEP_12;
break;
default: /* should be -1 for "not set by user" */
- if (ATARIHW_PRESENT( FDCSPEED ) || MACH_IS_MEDUSA)
+ if (ATARIHW_PRESENT(FDCSPEED) || MACH_IS_MEDUSA)
UD.steprate = FDCSTEP_3;
else
UD.steprate = FDCSTEP_6;
@@ -1748,46 +1748,46 @@ static void __init fd_probe( int drive )
* declared absent.
*/
-static int __init fd_test_drive_present( int drive )
+static int __init fd_test_drive_present(int drive)
{
unsigned long timeout;
unsigned char status;
int ok;
-
- if (drive >= (MACH_IS_FALCON ? 1 : 2)) return( 0 );
- fd_select_drive( drive );
+
+ if (drive >= (MACH_IS_FALCON ? 1 : 2)) return(0);
+ fd_select_drive(drive);
/* disable interrupt temporarily */
- atari_turnoff_irq( IRQ_MFP_FDC );
+ atari_turnoff_irq(IRQ_MFP_FDC);
FDC_WRITE (FDCREG_TRACK, 0xff00);
- FDC_WRITE( FDCREG_CMD, FDCCMD_RESTORE | FDCCMDADD_H | FDCSTEP_6 );
+ FDC_WRITE(FDCREG_CMD, FDCCMD_RESTORE | FDCCMDADD_H | FDCSTEP_6);
timeout = jiffies + 2*HZ+HZ/2;
while (time_before(jiffies, timeout))
if (!(st_mfp.par_dt_reg & 0x20))
break;
- status = FDC_READ( FDCREG_STATUS );
+ status = FDC_READ(FDCREG_STATUS);
ok = (status & FDCSTAT_TR00) != 0;
/* force interrupt to abort restore operation (FDC would try
* about 50 seconds!) */
- FDC_WRITE( FDCREG_CMD, FDCCMD_FORCI );
+ FDC_WRITE(FDCREG_CMD, FDCCMD_FORCI);
udelay(500);
- status = FDC_READ( FDCREG_STATUS );
+ status = FDC_READ(FDCREG_STATUS);
udelay(20);
if (ok) {
/* dummy seek command to make WP bit accessible */
- FDC_WRITE( FDCREG_DATA, 0 );
- FDC_WRITE( FDCREG_CMD, FDCCMD_SEEK );
- while( st_mfp.par_dt_reg & 0x20 )
+ FDC_WRITE(FDCREG_DATA, 0);
+ FDC_WRITE(FDCREG_CMD, FDCCMD_SEEK);
+ while (st_mfp.par_dt_reg & 0x20)
;
- status = FDC_READ( FDCREG_STATUS );
+ status = FDC_READ(FDCREG_STATUS);
}
- atari_turnon_irq( IRQ_MFP_FDC );
- return( ok );
+ atari_turnon_irq(IRQ_MFP_FDC);
+ return(ok);
}
@@ -1795,7 +1795,7 @@ static int __init fd_test_drive_present( int drive )
* floppies, additionally start the disk-change and motor-off timers.
*/
-static void __init config_types( void )
+static void __init config_types(void)
{
int drive, cnt = 0;
@@ -1804,30 +1804,30 @@ static void __init config_types( void )
dma_wd.fdc_speed = 0;
printk(KERN_INFO "Probing floppy drive(s):\n");
- for( drive = 0; drive < FD_MAX_UNITS; drive++ ) {
- fd_probe( drive );
+ for (drive = 0; drive < FD_MAX_UNITS; drive++) {
+ fd_probe(drive);
if (UD.connected) {
printk(KERN_INFO "fd%d\n", drive);
++cnt;
}
}
- if (FDC_READ( FDCREG_STATUS ) & FDCSTAT_BUSY) {
+ if (FDC_READ(FDCREG_STATUS) & FDCSTAT_BUSY) {
/* If FDC is still busy from probing, give it another FORCI
* command to abort the operation. If this isn't done, the FDC
* will interrupt later and its IRQ line stays low, because
* the status register isn't read. And this will block any
* interrupts on this IRQ line :-(
*/
- FDC_WRITE( FDCREG_CMD, FDCCMD_FORCI );
+ FDC_WRITE(FDCREG_CMD, FDCCMD_FORCI);
udelay(500);
- FDC_READ( FDCREG_STATUS );
+ FDC_READ(FDCREG_STATUS);
udelay(20);
}
-
+
if (cnt > 0) {
start_motor_off_timer();
- if (cnt == 1) fd_select_drive( 0 );
+ if (cnt == 1) fd_select_drive(0);
start_check_change_timer();
}
}
@@ -1843,7 +1843,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
struct atari_floppy_struct *p = bdev->bd_disk->private_data;
int type = MINOR(bdev->bd_dev) >> 2;
- DPRINT(("fd_open: type=%d\n",type));
+ DPRINT(("fd_open: type=%d\n", type));
if (p->ref && p->type != type)
return -EBUSY;
@@ -1900,12 +1900,12 @@ static void floppy_release(struct gendisk *disk, fmode_t mode)
}
static const struct block_device_operations floppy_fops = {
- .owner = THIS_MODULE,
- .open = floppy_unlocked_open,
- .release = floppy_release,
- .ioctl = fd_ioctl,
- .check_events = floppy_check_events,
- .revalidate_disk= floppy_revalidate,
+ .owner = THIS_MODULE,
+ .open = floppy_unlocked_open,
+ .release = floppy_release,
+ .ioctl = fd_ioctl,
+ .check_events = floppy_check_events,
+ .revalidate_disk = floppy_revalidate,
};
static struct kobject *floppy_find(dev_t dev, int *part, void *data)
@@ -1926,7 +1926,7 @@ static int __init atari_floppy_init (void)
/* Amiga, Mac, ... don't have Atari-compatible floppy :-) */
return -ENODEV;
- if (register_blkdev(FLOPPY_MAJOR,"fd"))
+ if (register_blkdev(FLOPPY_MAJOR, "fd"))
return -EBUSY;
for (i = 0; i < FD_MAX_UNITS; i++) {
@@ -2004,26 +2004,26 @@ static int __init atari_floppy_setup(char *str)
return 0;
str = get_options(str, 3 + FD_MAX_UNITS, ints);
-
+
if (ints[0] < 1) {
- printk(KERN_ERR "ataflop_setup: no arguments!\n" );
+ printk(KERN_ERR "ataflop_setup: no arguments!\n");
return 0;
}
else if (ints[0] > 2+FD_MAX_UNITS) {
- printk(KERN_ERR "ataflop_setup: too many arguments\n" );
+ printk(KERN_ERR "ataflop_setup: too many arguments\n");
}
if (ints[1] < 0 || ints[1] > 2)
- printk(KERN_ERR "ataflop_setup: bad drive type\n" );
+ printk(KERN_ERR "ataflop_setup: bad drive type\n");
else
DriveType = ints[1];
if (ints[0] >= 2)
UseTrackbuffer = (ints[2] > 0);
- for( i = 3; i <= ints[0] && i-3 < FD_MAX_UNITS; ++i ) {
+ for (i = 3; i <= ints[0] && i-3 < FD_MAX_UNITS; ++i) {
if (ints[i] != 2 && ints[i] != 3 && ints[i] != 6 && ints[i] != 12)
- printk(KERN_ERR "ataflop_setup: bad steprate\n" );
+ printk(KERN_ERR "ataflop_setup: bad steprate\n");
else
UserSteprate[i-3] = ints[i];
}
@@ -2047,7 +2047,7 @@ static void __exit atari_floppy_exit(void)
unregister_blkdev(FLOPPY_MAJOR, "fd");
del_timer_sync(&fd_timer);
- atari_stram_free( DMABuffer );
+ atari_stram_free(DMABuffer);
}
module_init(atari_floppy_init)
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 5/6] block: Coding style fix for comma and open , close parenthesis
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
` (3 preceding siblings ...)
2015-10-25 18:48 ` [PATCH 4/6] block: Coding style fix for comma and open , close parenthesis Punit Vara
@ 2015-10-25 18:48 ` Punit Vara
2015-10-25 18:48 ` [PATCH 6/6] " Punit Vara
5 siblings, 0 replies; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
Add and remove space as per coding style for loops,comma , open and
close parenthesis.It also removes whitespace.
This patch is to the ataflop.c file that fixes up following ERRORs
reported by checkpatch:
- space prohibited before that close parenthesis ')'
- space prohibited after that open parenthesis '('
- trailing whitespace
- space required after that ',' (ctx:VxV)
- spaces required around that '=' (ctx:VxW)
- space required before the open parenthesis '('
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/ataflop.c | 250 ++++++++++++++++++++++++------------------------
1 file changed, 125 insertions(+), 125 deletions(-)
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 3cd50a8..5b31772 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -747,14 +747,14 @@ static void do_fd_action( int drive )
else {
/* cmd == WRITE, pay attention to track buffer
* consistency! */
- copy_buffer( ReqData, SECTOR_BUFFER(ReqSector) );
+ copy_buffer(ReqData, SECTOR_BUFFER(ReqSector));
}
}
}
if (SelectedDrive != drive)
- fd_select_drive( drive );
-
+ fd_select_drive(drive);
+
if (UD.track == -1)
fd_calibrate();
else if (UD.track != ReqTrack << UDT->stretch)
@@ -768,19 +768,19 @@ static void do_fd_action( int drive )
/* Seek to track 0 if the current track is unknown */
-static void fd_calibrate( void )
+static void fd_calibrate(void)
{
if (SUD.track >= 0) {
- fd_calibrate_done( 0 );
+ fd_calibrate_done(0);
return;
}
if (ATARIHW_PRESENT(FDCSPEED))
dma_wd.fdc_speed = 0; /* always seek with 8 Mhz */;
DPRINT(("fd_calibrate\n"));
- SET_IRQ_HANDLER( fd_calibrate_done );
+ SET_IRQ_HANDLER(fd_calibrate_done);
/* we can't verify, since the speed may be incorrect */
- FDC_WRITE( FDCREG_CMD, FDCCMD_RESTORE | SUD.steprate );
+ FDC_WRITE(FDCREG_CMD, FDCCMD_RESTORE | SUD.steprate);
NeedSeek = 1;
MotorOn = 1;
@@ -789,16 +789,16 @@ static void fd_calibrate( void )
}
-static void fd_calibrate_done( int status )
+static void fd_calibrate_done(int status)
{
DPRINT(("fd_calibrate_done()\n"));
stop_timeout();
-
+
/* set the correct speed now */
if (ATARIHW_PRESENT(FDCSPEED))
dma_wd.fdc_speed = SUDT->fdc_speed;
if (status & FDCSTAT_RECNF) {
- printk(KERN_ERR "fd%d: restore failed\n", SelectedDrive );
+ printk(KERN_ERR "fd%d: restore failed\n", SelectedDrive);
fd_error();
}
else {
@@ -806,16 +806,16 @@ static void fd_calibrate_done( int status )
fd_seek();
}
}
-
-
+
+
/* Seek the drive to the requested track. The drive must have been
* calibrated at some point before this.
*/
-
-static void fd_seek( void )
+
+static void fd_seek(void)
{
if (SUD.track == ReqTrack << SUDT->stretch) {
- fd_seek_done( 0 );
+ fd_seek_done(0);
return;
}
@@ -824,11 +824,11 @@ static void fd_seek( void )
MFPDELAY();
}
- DPRINT(("fd_seek() to track %d\n",ReqTrack));
- FDC_WRITE( FDCREG_DATA, ReqTrack << SUDT->stretch);
+ DPRINT(("fd_seek() to track %d\n", ReqTrack));
+ FDC_WRITE(FDCREG_DATA, ReqTrack << SUDT->stretch);
udelay(25);
- SET_IRQ_HANDLER( fd_seek_done );
- FDC_WRITE( FDCREG_CMD, FDCCMD_SEEK | SUD.steprate );
+ SET_IRQ_HANDLER(fd_seek_done);
+ FDC_WRITE(FDCREG_CMD, FDCCMD_SEEK | SUD.steprate);
MotorOn = 1;
set_head_settle_flag();
@@ -837,11 +837,11 @@ static void fd_seek( void )
}
-static void fd_seek_done( int status )
+static void fd_seek_done(int status)
{
DPRINT(("fd_seek_done()\n"));
stop_timeout();
-
+
/* set the correct speed */
if (ATARIHW_PRESENT(FDCSPEED))
dma_wd.fdc_speed = SUDT->fdc_speed;
@@ -870,46 +870,46 @@ static void fd_seek_done( int status )
static int MultReadInProgress = 0;
-static void fd_rwsec( void )
+static void fd_rwsec(void)
{
unsigned long paddr, flags;
unsigned int rwflag, old_motoron;
unsigned int track;
-
- DPRINT(("fd_rwsec(), Sec=%d, Access=%c\n",ReqSector, ReqCmd == WRITE ? 'w' : 'r' ));
+
+ DPRINT(("fd_rwsec(), Sec=%d, Access=%c\n", ReqSector, ReqCmd == WRITE ? 'w' : 'r'));
if (ReqCmd == WRITE) {
if (ATARIHW_PRESENT(EXTD_DMA)) {
paddr = virt_to_phys(ReqData);
}
else {
- copy_buffer( ReqData, DMABuffer );
+ copy_buffer(ReqData, DMABuffer);
paddr = PhysDMABuffer;
}
- dma_cache_maintenance( paddr, 512, 1 );
+ dma_cache_maintenance(paddr, 512, 1);
rwflag = 0x100;
}
else {
if (read_track)
paddr = PhysTrackBuffer;
else
- paddr = ATARIHW_PRESENT(EXTD_DMA) ?
+ paddr = ATARIHW_PRESENT(EXTD_DMA) ?
virt_to_phys(ReqData) : PhysDMABuffer;
rwflag = 0;
}
- fd_select_side( ReqSide );
-
+ fd_select_side(ReqSide);
+
/* Start sector of this operation */
- FDC_WRITE( FDCREG_SECTOR, read_track ? 1 : ReqSector );
+ FDC_WRITE(FDCREG_SECTOR, read_track ? 1 : ReqSector);
MFPDELAY();
/* Cheat for track if stretch != 0 */
if (SUDT->stretch) {
- track = FDC_READ( FDCREG_TRACK);
+ track = FDC_READ(FDCREG_TRACK);
MFPDELAY();
- FDC_WRITE( FDCREG_TRACK, track >> SUDT->stretch);
+ FDC_WRITE(FDCREG_TRACK, track >> SUDT->stretch);
}
udelay(25);
-
+
/* Setup DMA */
local_irq_save(flags);
dma_wd.dma_lo = (unsigned char)paddr;
@@ -925,23 +925,23 @@ static void fd_rwsec( void )
MFPDELAY();
local_irq_restore(flags);
- /* Clear FIFO and switch DMA to correct mode */
- dma_wd.dma_mode_status = 0x90 | rwflag;
+ /* Clear FIFO and switch DMA to correct mode */
+ dma_wd.dma_mode_status = 0x90 | rwflag;
MFPDELAY();
- dma_wd.dma_mode_status = 0x90 | (rwflag ^ 0x100);
+ dma_wd.dma_mode_status = 0x90 | (rwflag ^ 0x100);
MFPDELAY();
dma_wd.dma_mode_status = 0x90 | rwflag;
MFPDELAY();
-
+
/* How many sectors for DMA */
dma_wd.fdc_acces_seccount = read_track ? SUDT->spt : 1;
-
- udelay(25);
-
+
+ udelay(25);
+
/* Start operation */
dma_wd.dma_mode_status = FDCSELREG_STP | rwflag;
udelay(25);
- SET_IRQ_HANDLER( fd_rwsec_done );
+ SET_IRQ_HANDLER(fd_rwsec_done);
dma_wd.fdc_acces_seccount =
(get_head_settle_flag() |
(rwflag ? FDCCMD_WRSEC : (FDCCMD_RDSEC | (read_track ? FDCCMDADD_M : 0))));
@@ -965,8 +965,8 @@ static void fd_rwsec( void )
start_timeout();
}
-
-static void fd_readtrack_check( unsigned long dummy )
+
+static void fd_readtrack_check(unsigned long dummy)
{
unsigned long flags, addr, addr2;
@@ -992,22 +992,22 @@ static void fd_readtrack_check( unsigned long dummy )
MFPDELAY();
addr |= (dma_wd.dma_md & 0xff) << 8;
MFPDELAY();
- if (ATARIHW_PRESENT( EXTD_DMA ))
+ if (ATARIHW_PRESENT(EXTD_DMA))
addr |= (st_dma_ext_dmahi & 0xffff) << 16;
else
addr |= (dma_wd.dma_hi & 0xff) << 16;
MFPDELAY();
- } while(addr != addr2);
-
+ } while (addr != addr2);
+
if (addr >= PhysTrackBuffer + SUDT->spt*512) {
/* already read enough data, force an FDC interrupt to stop
* the read operation
*/
- SET_IRQ_HANDLER( NULL );
+ SET_IRQ_HANDLER(NULL);
MultReadInProgress = 0;
local_irq_restore(flags);
DPRINT(("fd_readtrack_check(): done\n"));
- FDC_WRITE( FDCREG_CMD, FDCCMD_FORCI );
+ FDC_WRITE(FDCREG_CMD, FDCCMD_FORCI);
udelay(25);
/* No error until now -- the FDC would have interrupted
@@ -1024,7 +1024,7 @@ static void fd_readtrack_check( unsigned long dummy )
}
-static void fd_rwsec_done( int status )
+static void fd_rwsec_done(int status)
{
DPRINT(("fd_rwsec_done()\n"));
@@ -1042,28 +1042,28 @@ static void fd_rwsec_done1(int status)
unsigned int track;
stop_timeout();
-
+
/* Correct the track if stretch != 0 */
if (SUDT->stretch) {
- track = FDC_READ( FDCREG_TRACK);
+ track = FDC_READ(FDCREG_TRACK);
MFPDELAY();
- FDC_WRITE( FDCREG_TRACK, track << SUDT->stretch);
+ FDC_WRITE(FDCREG_TRACK, track << SUDT->stretch);
}
if (!UseTrackbuffer) {
dma_wd.dma_mode_status = 0x90;
MFPDELAY();
if (!(dma_wd.dma_mode_status & 0x01)) {
- printk(KERN_ERR "fd%d: DMA error\n", SelectedDrive );
+ printk(KERN_ERR "fd%d: DMA error\n", SelectedDrive);
goto err_end;
}
}
MFPDELAY();
if (ReqCmd == WRITE && (status & FDCSTAT_WPROT)) {
- printk(KERN_NOTICE "fd%d: is write protected\n", SelectedDrive );
+ printk(KERN_NOTICE "fd%d: is write protected\n", SelectedDrive);
goto err_end;
- }
+ }
if ((status & FDCSTAT_RECNF) &&
/* RECNF is no error after a multiple read when the FDC
searched for a non-existent sector! */
@@ -1081,10 +1081,10 @@ static void fd_rwsec_done1(int status)
else {
if (SUD.flags & FTD_MSG)
printk(KERN_INFO "fd%d: Auto-detected floppy type %s\n",
- SelectedDrive, SUDT->name );
- Probing=0;
+ SelectedDrive, SUDT->name);
+ Probing = 0;
}
- } else {
+ } else {
/* record not found, but not probing. Maybe stretch wrong ? Restart probing */
if (SUD.autoprobe) {
SUDT = atari_disk_type + StartDiskType[DriveType];
@@ -1098,49 +1098,49 @@ static void fd_rwsec_done1(int status)
dma_wd.fdc_speed = SUDT->fdc_speed;
MFPDELAY();
}
- setup_req_params( SelectedDrive );
+ setup_req_params(SelectedDrive);
BufferDrive = -1;
- do_fd_action( SelectedDrive );
+ do_fd_action(SelectedDrive);
return;
}
printk(KERN_ERR "fd%d: sector %d not found (side %d, track %d)\n",
- SelectedDrive, FDC_READ (FDCREG_SECTOR), ReqSide, ReqTrack );
+ SelectedDrive, FDC_READ (FDCREG_SECTOR), ReqSide, ReqTrack);
goto err_end;
}
if (status & FDCSTAT_CRC) {
printk(KERN_ERR "fd%d: CRC error (side %d, track %d, sector %d)\n",
- SelectedDrive, ReqSide, ReqTrack, FDC_READ (FDCREG_SECTOR) );
+ SelectedDrive, ReqSide, ReqTrack, FDC_READ (FDCREG_SECTOR));
goto err_end;
}
if (status & FDCSTAT_LOST) {
printk(KERN_ERR "fd%d: lost data (side %d, track %d, sector %d)\n",
- SelectedDrive, ReqSide, ReqTrack, FDC_READ (FDCREG_SECTOR) );
+ SelectedDrive, ReqSide, ReqTrack, FDC_READ (FDCREG_SECTOR));
goto err_end;
}
Probing = 0;
-
+
if (ReqCmd == READ) {
if (!read_track) {
void *addr;
- addr = ATARIHW_PRESENT( EXTD_DMA ) ? ReqData : DMABuffer;
- dma_cache_maintenance( virt_to_phys(addr), 512, 0 );
- if (!ATARIHW_PRESENT( EXTD_DMA ))
+ addr = ATARIHW_PRESENT(EXTD_DMA) ? ReqData : DMABuffer;
+ dma_cache_maintenance(virt_to_phys(addr), 512, 0);
+ if (!ATARIHW_PRESENT(EXTD_DMA))
copy_buffer (addr, ReqData);
} else {
- dma_cache_maintenance( PhysTrackBuffer, MaxSectors[DriveType] * 512, 0 );
+ dma_cache_maintenance(PhysTrackBuffer, MaxSectors[DriveType] * 512, 0);
BufferDrive = SelectedDrive;
BufferSide = ReqSide;
BufferTrack = ReqTrack;
copy_buffer (SECTOR_BUFFER (ReqSector), ReqData);
}
}
-
+
if (++ReqCnt < blk_rq_cur_sectors(fd_request)) {
/* read next sector */
- setup_req_params( SelectedDrive );
- do_fd_action( SelectedDrive );
+ setup_req_params(SelectedDrive);
+ do_fd_action(SelectedDrive);
}
else {
/* all sectors finished */
@@ -1148,33 +1148,33 @@ static void fd_rwsec_done1(int status)
redo_fd_request();
}
return;
-
+
err_end:
BufferDrive = -1;
fd_error();
}
-static void fd_writetrack( void )
+static void fd_writetrack(void)
{
unsigned long paddr, flags;
unsigned int track;
-
- DPRINT(("fd_writetrack() Tr=%d Si=%d\n", ReqTrack, ReqSide ));
+
+ DPRINT(("fd_writetrack() Tr=%d Si=%d\n", ReqTrack, ReqSide));
paddr = PhysTrackBuffer;
- dma_cache_maintenance( paddr, BUFFER_SIZE, 1 );
+ dma_cache_maintenance(paddr, BUFFER_SIZE, 1);
+
+ fd_select_side(ReqSide);
- fd_select_side( ReqSide );
-
/* Cheat for track if stretch != 0 */
if (SUDT->stretch) {
- track = FDC_READ( FDCREG_TRACK);
+ track = FDC_READ(FDCREG_TRACK);
MFPDELAY();
- FDC_WRITE(FDCREG_TRACK,track >> SUDT->stretch);
+ FDC_WRITE(FDCREG_TRACK, track >> SUDT->stretch);
}
udelay(40);
-
+
/* Setup DMA */
local_irq_save(flags);
dma_wd.dma_lo = (unsigned char)paddr;
@@ -1183,30 +1183,30 @@ static void fd_writetrack( void )
dma_wd.dma_md = (unsigned char)paddr;
MFPDELAY();
paddr >>= 8;
- if (ATARIHW_PRESENT( EXTD_DMA ))
+ if (ATARIHW_PRESENT(EXTD_DMA))
st_dma_ext_dmahi = (unsigned short)paddr;
else
dma_wd.dma_hi = (unsigned char)paddr;
MFPDELAY();
local_irq_restore(flags);
-
- /* Clear FIFO and switch DMA to correct mode */
- dma_wd.dma_mode_status = 0x190;
+
+ /* Clear FIFO and switch DMA to correct mode */
+ dma_wd.dma_mode_status = 0x190;
MFPDELAY();
- dma_wd.dma_mode_status = 0x90;
+ dma_wd.dma_mode_status = 0x90;
MFPDELAY();
dma_wd.dma_mode_status = 0x190;
MFPDELAY();
-
+
/* How many sectors for DMA */
dma_wd.fdc_acces_seccount = BUFFER_SIZE/512;
- udelay(40);
-
+ udelay(40);
+
/* Start operation */
dma_wd.dma_mode_status = FDCSELREG_STP | 0x100;
udelay(40);
- SET_IRQ_HANDLER( fd_writetrack_done );
- dma_wd.fdc_acces_seccount = FDCCMD_WRTRA | get_head_settle_flag();
+ SET_IRQ_HANDLER(fd_writetrack_done);
+ dma_wd.fdc_acces_seccount = FDCCMD_WRTRA | get_head_settle_flag();
MotorOn = 1;
start_timeout();
@@ -1214,19 +1214,19 @@ static void fd_writetrack( void )
}
-static void fd_writetrack_done( int status )
+static void fd_writetrack_done(int status)
{
DPRINT(("fd_writetrack_done()\n"));
stop_timeout();
if (status & FDCSTAT_WPROT) {
- printk(KERN_NOTICE "fd%d: is write protected\n", SelectedDrive );
+ printk(KERN_NOTICE "fd%d: is write protected\n", SelectedDrive);
goto err_end;
- }
+ }
if (status & FDCSTAT_LOST) {
printk(KERN_ERR "fd%d: lost data (side %d, track %d)\n",
- SelectedDrive, ReqSide, ReqTrack );
+ SelectedDrive, ReqSide, ReqTrack);
goto err_end;
}
@@ -1237,20 +1237,20 @@ static void fd_writetrack_done( int status )
fd_error();
}
-static void fd_times_out( unsigned long dummy )
+static void fd_times_out(unsigned long dummy)
{
- atari_disable_irq( IRQ_MFP_FDC );
+ atari_disable_irq(IRQ_MFP_FDC);
if (!FloppyIRQHandler) goto end; /* int occurred after timer was fired, but
* before we came here... */
- SET_IRQ_HANDLER( NULL );
+ SET_IRQ_HANDLER(NULL);
/* If the timeout occurred while the readtrack_check timer was
* active, we need to cancel it, else bad things will happen */
if (UseTrackbuffer)
- del_timer( &readtrack_timer );
- FDC_WRITE( FDCREG_CMD, FDCCMD_FORCI );
- udelay( 25 );
-
+ del_timer(&readtrack_timer);
+ FDC_WRITE(FDCREG_CMD, FDCCMD_FORCI);
+ udelay(25);
+
printk(KERN_ERR "floppy timeout\n" );
fd_error();
end:
@@ -1265,15 +1265,15 @@ static void fd_times_out( unsigned long dummy )
* already on.
*/
-static void finish_fdc( void )
+static void finish_fdc(void)
{
if (!NeedSeek) {
- finish_fdc_done( 0 );
+ finish_fdc_done(0);
}
else {
DPRINT(("finish_fdc: dummy seek started\n"));
FDC_WRITE (FDCREG_DATA, SUD.track);
- SET_IRQ_HANDLER( finish_fdc_done );
+ SET_IRQ_HANDLER(finish_fdc_done);
FDC_WRITE (FDCREG_CMD, FDCCMD_SEEK);
MotorOn = 1;
start_timeout();
@@ -1375,7 +1375,7 @@ static int floppy_revalidate(struct gendisk *disk)
/* This sets up the global variables describing the current request. */
-static void setup_req_params( int drive )
+static void setup_req_params(int drive)
{
int block = ReqBlock + ReqCnt;
@@ -1390,8 +1390,8 @@ static void setup_req_params( int drive )
else
read_track = 0;
- DPRINT(("Request params: Si=%d Tr=%d Se=%d Data=%08lx\n",ReqSide,
- ReqTrack, ReqSector, (unsigned long)ReqData ));
+ DPRINT(("Request params: Si=%d Tr=%d Se=%d Data=%08lx\n", ReqSide,
+ ReqTrack, ReqSector, (unsigned long)ReqData));
}
/*
@@ -1425,7 +1425,7 @@ static void redo_fd_request(void)
DPRINT(("redo_fd_request: fd_request=%p dev=%s fd_request->sector=%ld\n",
fd_request, fd_request ? fd_request->rq_disk->disk_name : "",
- fd_request ? blk_rq_pos(fd_request) : 0 ));
+ fd_request ? blk_rq_pos(fd_request) : 0));
IsFormatting = 0;
@@ -1439,14 +1439,14 @@ repeat:
floppy = fd_request->rq_disk->private_data;
drive = floppy - unit;
type = floppy->type;
-
+
if (!UD.connected) {
/* drive not connected */
- printk(KERN_ERR "Unknown Device: fd%d\n", drive );
+ printk(KERN_ERR "Unknown Device: fd%d\n", drive);
fd_end_request_cur(-EIO);
goto repeat;
}
-
+
if (type == 0) {
if (!UDT) {
Probing = 1;
@@ -1454,16 +1454,16 @@ repeat:
set_capacity(floppy->disk, UDT->blocks);
UD.autoprobe = 1;
}
- }
+ }
else {
/* user supplied disk type */
if (--type >= NUM_DISK_MINORS) {
- printk(KERN_WARNING "fd%d: invalid disk format", drive );
+ printk(KERN_WARNING "fd%d: invalid disk format", drive);
fd_end_request_cur(-EIO);
goto repeat;
}
if (minor2disktype[type].drive_types > DriveType) {
- printk(KERN_WARNING "fd%d: unsupported disk format", drive );
+ printk(KERN_WARNING "fd%d: unsupported disk format", drive);
fd_end_request_cur(-EIO);
goto repeat;
}
@@ -1472,21 +1472,21 @@ repeat:
set_capacity(floppy->disk, UDT->blocks);
UD.autoprobe = 0;
}
-
+
if (blk_rq_pos(fd_request) + 1 > UDT->blocks) {
fd_end_request_cur(-EIO);
goto repeat;
}
/* stop deselect timer */
- del_timer( &motor_off_timer );
-
+ del_timer(&motor_off_timer);
+
ReqCnt = 0;
ReqCmd = rq_data_dir(fd_request);
ReqBlock = blk_rq_pos(fd_request);
ReqBuffer = bio_data(fd_request->bio);
- setup_req_params( drive );
- do_fd_action( drive );
+ setup_req_params(drive);
+ do_fd_action(drive);
return;
@@ -1497,13 +1497,13 @@ repeat:
void do_fd_request(struct request_queue * q)
{
- DPRINT(("do_fd_request for pid %d\n",current->pid));
+ DPRINT(("do_fd_request for pid %d\n", current->pid));
wait_event(fdc_wait, cmpxchg(&fdc_busy, 0, 1) == 0);
stdma_lock(floppy_irq, NULL);
- atari_disable_irq( IRQ_MFP_FDC );
+ atari_disable_irq(IRQ_MFP_FDC);
redo_fd_request();
- atari_enable_irq( IRQ_MFP_FDC );
+ atari_enable_irq(IRQ_MFP_FDC);
}
static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
@@ -1637,7 +1637,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
dtp->name = "user format";
dtp->blocks = setprm.size;
dtp->spt = setprm.sect;
- if (setprm.sect > 14)
+ if (setprm.sect > 14)
dtp->fdc_speed = 3;
else
dtp->fdc_speed = 0;
@@ -1705,7 +1705,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
/* Initialize the 'unit' variable for drive 'drive' */
-static void __init fd_probe( int drive )
+static void __init fd_probe(int drive)
{
UD.connected = 0;
UDT = NULL;
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 6/6] block: Coding style fix for comma and open , close parenthesis
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
` (4 preceding siblings ...)
2015-10-25 18:48 ` [PATCH 5/6] " Punit Vara
@ 2015-10-25 18:48 ` Punit Vara
2015-10-25 18:55 ` punit vara
5 siblings, 1 reply; 9+ messages in thread
From: Punit Vara @ 2015-10-25 18:48 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
Add and remove space as per coding style for loops,comma , open and
close parenthesis.It also removes whitespace.
This patch is to the ataflop.c file that fixes up following ERRORs
reported by checkpatch:
- space prohibited before that close parenthesis ')'
- space prohibited after that open parenthesis '('
- trailing whitespace
- space required after that ',' (ctx:VxV)
- space required before the open parenthesis '('
Signed-off-by: Punit Vara <punitvara@gmail.com>
---
drivers/block/ataflop.c | 244 ++++++++++++++++++++++++------------------------
1 file changed, 122 insertions(+), 122 deletions(-)
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 5b31772..62763fd 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -32,7 +32,7 @@
* the FDC will otherwise wait forever when no disk is inserted...
*
* ++ Freddi Aschwanden (fa) 20.9.95 fixes for medusa:
- * - MFPDELAY() after each FDC access -> atari
+ * - MFPDELAY() after each FDC access -> atari
* - more/other disk formats
* - DMA to the block buffer directly if we have a 32bit DMA
* - for medusa, the step rate is always 3ms
@@ -45,7 +45,7 @@
* Roman 10/15/95:
* - implement some more ioctls
* - disk formatting
- *
+ *
* Andreas 95/12/12:
* - increase gap size at start of track for HD/ED disks
*
@@ -95,39 +95,39 @@ static struct atari_disk_type {
} atari_disk_type[] = {
{ "d360", 9, 720, 0, 0}, /* 0: 360kB diskette */
{ "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */
- { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
- { "D820", 10,1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */
+ { "D720", 9, 1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
+ { "D820", 10, 1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */
/* formats above are probed for type DD */
#define MAX_TYPE_DD 3
- { "h1200",15,2400, 3, 0}, /* 4: 1.2MB diskette */
- { "H1440",18,2880, 3, 0}, /* 5: 1.4 MB diskette (HD) */
- { "H1640",20,3280, 3, 0}, /* 6: 1.64MB diskette (fat HD) 82 tr 20 sec */
+ { "h1200", 15, 2400, 3, 0}, /* 4: 1.2MB diskette */
+ { "H1440", 18, 2880, 3, 0}, /* 5: 1.4 MB diskette (HD) */
+ { "H1640", 20, 3280, 3, 0}, /* 6: 1.64MB diskette (fat HD) 82 tr 20 sec */
/* formats above are probed for types DD and HD */
#define MAX_TYPE_HD 6
- { "E2880",36,5760, 3, 0}, /* 7: 2.8 MB diskette (ED) */
- { "E3280",40,6560, 3, 0}, /* 8: 3.2 MB diskette (fat ED) 82 tr 40 sec */
+ { "E2880", 36, 5760, 3, 0}, /* 7: 2.8 MB diskette (ED) */
+ { "E3280", 40, 6560, 3, 0}, /* 8: 3.2 MB diskette (fat ED) 82 tr 40 sec */
/* formats above are probed for types DD, HD and ED */
#define MAX_TYPE_ED 8
/* types below are never autoprobed */
- { "H1680",21,3360, 3, 0}, /* 9: 1.68MB diskette (fat HD) 80 tr 21 sec */
- { "h410",10,820, 0, 1}, /* 10: 410k diskette 41 tr 10 sec, stretch */
- { "h1476",18,2952, 3, 0}, /* 11: 1.48MB diskette 82 tr 18 sec */
- { "H1722",21,3444, 3, 0}, /* 12: 1.72MB diskette 82 tr 21 sec */
- { "h420",10,840, 0, 1}, /* 13: 420k diskette 42 tr 10 sec, stretch */
- { "H830",10,1660, 0, 0}, /* 14: 820k diskette 83 tr 10 sec */
- { "h1494",18,2952, 3, 0}, /* 15: 1.49MB diskette 83 tr 18 sec */
- { "H1743",21,3486, 3, 0}, /* 16: 1.74MB diskette 83 tr 21 sec */
- { "h880",11,1760, 0, 0}, /* 17: 880k diskette 80 tr 11 sec */
- { "D1040",13,2080, 0, 0}, /* 18: 1.04MB diskette 80 tr 13 sec */
- { "D1120",14,2240, 0, 0}, /* 19: 1.12MB diskette 80 tr 14 sec */
- { "h1600",20,3200, 3, 0}, /* 20: 1.60MB diskette 80 tr 20 sec */
- { "H1760",22,3520, 3, 0}, /* 21: 1.76MB diskette 80 tr 22 sec */
- { "H1920",24,3840, 3, 0}, /* 22: 1.92MB diskette 80 tr 24 sec */
- { "E3200",40,6400, 3, 0}, /* 23: 3.2MB diskette 80 tr 40 sec */
- { "E3520",44,7040, 3, 0}, /* 24: 3.52MB diskette 80 tr 44 sec */
- { "E3840",48,7680, 3, 0}, /* 25: 3.84MB diskette 80 tr 48 sec */
- { "H1840",23,3680, 3, 0}, /* 26: 1.84MB diskette 80 tr 23 sec */
- { "D800",10,1600, 0, 0}, /* 27: 800k diskette 80 tr 10 sec */
+ { "H1680", 21, 3360, 3, 0}, /* 9: 1.68MB diskette (fat HD) 80 tr 21 sec */
+ { "h410", 10, 820, 0, 1}, /* 10: 410k diskette 41 tr 10 sec, stretch */
+ { "h1476", 18, 2952, 3, 0}, /* 11: 1.48MB diskette 82 tr 18 sec */
+ { "H1722", 21, 3444, 3, 0}, /* 12: 1.72MB diskette 82 tr 21 sec */
+ { "h420", 10, 840, 0, 1}, /* 13: 420k diskette 42 tr 10 sec, stretch */
+ { "H830", 10, 1660, 0, 0}, /* 14: 820k diskette 83 tr 10 sec */
+ { "h1494", 18, 2952, 3, 0}, /* 15: 1.49MB diskette 83 tr 18 sec */
+ { "H1743", 21, 3486, 3, 0}, /* 16: 1.74MB diskette 83 tr 21 sec */
+ { "h880", 11, 1760, 0, 0}, /* 17: 880k diskette 80 tr 11 sec */
+ { "D1040", 13, 2080, 0, 0}, /* 18: 1.04MB diskette 80 tr 13 sec */
+ { "D1120", 14, 2240, 0, 0}, /* 19: 1.12MB diskette 80 tr 14 sec */
+ { "h1600", 20, 3200, 3, 0}, /* 20: 1.60MB diskette 80 tr 20 sec */
+ { "H1760", 22, 3520, 3, 0}, /* 21: 1.76MB diskette 80 tr 22 sec */
+ { "H1920", 24, 3840, 3, 0}, /* 22: 1.92MB diskette 80 tr 24 sec */
+ { "E3200", 40, 6400, 3, 0}, /* 23: 3.2MB diskette 80 tr 40 sec */
+ { "E3520", 44, 7040, 3, 0}, /* 24: 3.52MB diskette 80 tr 44 sec */
+ { "E3840", 48, 7680, 3, 0}, /* 25: 3.84MB diskette 80 tr 48 sec */
+ { "H1840", 23, 3680, 3, 0}, /* 26: 1.84MB diskette 80 tr 23 sec */
+ { "D800", 10, 1600, 0, 0}, /* 27: 800k diskette 80 tr 10 sec */
};
static int StartDiskType[] = {
@@ -199,7 +199,7 @@ static struct atari_disk_type user_params[FD_MAX_UNITS];
/*
* User-provided permanent type information. 'drive' points to
- * the respective entry of this array. Set by FDDEFPRM ioctls,
+ * the respective entry of this array. Set by FDDEFPRM ioctls,
* restored upon disk change by floppy_revalidate() if valid (as seen by
* default_params[].blocks > 0 - a bit in unit[].flags might be used for this?)
*/
@@ -241,7 +241,7 @@ static struct atari_floppy_struct {
__val & 0xff; \
})
-#define FDC_WRITE(reg,val) \
+#define FDC_WRITE(reg, val) \
do { \
/* unsigned long __flags; */ \
/* local_irq_save(__flags); */ \
@@ -250,7 +250,7 @@ static struct atari_floppy_struct {
dma_wd.fdc_acces_seccount = (val); \
MFPDELAY(); \
/* local_irq_restore(__flags); */ \
- } while(0)
+ } while (0)
/* Buffering variables:
@@ -281,7 +281,7 @@ static int BufferDrive, BufferSide, BufferTrack;
static int read_track; /* non-zero if we are reading whole tracks */
#define SECTOR_BUFFER(sec) (TrackBuffer + ((sec)-1)*512)
-#define IS_BUFFERED(drive,side,track) \
+#define IS_BUFFERED(drive, side, track) \
(BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
/*
@@ -339,35 +339,35 @@ static int NeedSeek = 0;
/***************************** Prototypes *****************************/
-static void fd_select_side( int side );
-static void fd_select_drive( int drive );
-static void fd_deselect( void );
-static void fd_motor_off_timer( unsigned long dummy );
-static void check_change( unsigned long dummy );
+static void fd_select_side(int side);
+static void fd_select_drive(int drive);
+static void fd_deselect(void);
+static void fd_motor_off_timer(unsigned long dummy);
+static void check_change(unsigned long dummy);
static irqreturn_t floppy_irq (int irq, void *dummy);
-static void fd_error( void );
+static void fd_error(void);
static int do_format(int drive, int type, struct atari_format_descr *desc);
-static void do_fd_action( int drive );
-static void fd_calibrate( void );
-static void fd_calibrate_done( int status );
-static void fd_seek( void );
-static void fd_seek_done( int status );
-static void fd_rwsec( void );
-static void fd_readtrack_check( unsigned long dummy );
-static void fd_rwsec_done( int status );
+static void do_fd_action(int drive);
+static void fd_calibrate(void);
+static void fd_calibrate_done(int status);
+static void fd_seek(void);
+static void fd_seek_done(int status);
+static void fd_rwsec(void);
+static void fd_readtrack_check(unsigned long dummy);
+static void fd_rwsec_done(int status);
static void fd_rwsec_done1(int status);
-static void fd_writetrack( void );
-static void fd_writetrack_done( int status );
-static void fd_times_out( unsigned long dummy );
-static void finish_fdc( void );
-static void finish_fdc_done( int dummy );
-static void setup_req_params( int drive );
-static void redo_fd_request( void);
+static void fd_writetrack(void);
+static void fd_writetrack_done(int status);
+static void fd_times_out(unsigned long dummy);
+static void finish_fdc(void);
+static void finish_fdc_done(int dummy);
+static void setup_req_params(int drive);
+static void redo_fd_request(void);
static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
cmd, unsigned long param);
-static void fd_probe( int drive );
-static int fd_test_drive_present( int drive );
-static void config_types( void );
+static void fd_probe(int drive);
+static int fd_test_drive_present(int drive);
+static void config_types(void);
static int floppy_open(struct block_device *bdev, fmode_t mode);
static void floppy_release(struct gendisk *disk, fmode_t mode);
@@ -377,7 +377,7 @@ static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0);
static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0);
static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0);
static DEFINE_TIMER(fd_timer, check_change, 0, 0);
-
+
static void fd_end_request_cur(int err)
{
if (!__blk_end_request_cur(fd_request, err))
@@ -390,7 +390,7 @@ static inline void start_motor_off_timer(void)
MotorOffTrys = 0;
}
-static inline void start_check_change_timer( void )
+static inline void start_check_change_timer(void)
{
mod_timer(&fd_timer, jiffies + CHECK_CHANGE_DELAY);
}
@@ -407,13 +407,13 @@ static inline void stop_timeout(void)
/* Select the side to use. */
-static void fd_select_side( int side )
+static void fd_select_side(int side)
{
unsigned long flags;
/* protect against various other ints mucking around with the PSG */
local_irq_save(flags);
-
+
sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
sound_ym.wd_data = (side == 0) ? sound_ym.rd_data_reg_sel | 0x01 :
sound_ym.rd_data_reg_sel & 0xfe;
@@ -426,11 +426,11 @@ static void fd_select_side( int side )
* clock speed for this disk's type.
*/
-static void fd_select_drive( int drive )
+static void fd_select_drive(int drive)
{
unsigned long flags;
unsigned char tmp;
-
+
if (drive == SelectedDrive)
return;
@@ -443,28 +443,28 @@ static void fd_select_drive( int drive )
local_irq_restore(flags);
/* restore track register to saved value */
- FDC_WRITE( FDCREG_TRACK, UD.track );
+ FDC_WRITE(FDCREG_TRACK, UD.track);
udelay(25);
/* select 8/16 MHz */
if (UDT)
if (ATARIHW_PRESENT(FDCSPEED))
dma_wd.fdc_speed = UDT->fdc_speed;
-
+
SelectedDrive = drive;
}
/* Deselect both drives. */
-static void fd_deselect( void )
+static void fd_deselect(void)
{
unsigned long flags;
/* protect against various other ints mucking around with the PSG */
local_irq_save(flags);
atari_dont_touch_floppy_select = 0;
- sound_ym.rd_data_reg_sel=14; /* Select PSG Port A */
+ sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
sound_ym.wd_data = (sound_ym.rd_data_reg_sel |
(MACH_IS_FALCON ? 3 : 7)); /* no drives selected */
/* On Falcon, the drive B select line is used on the printer port, so
@@ -479,7 +479,7 @@ static void fd_deselect( void )
* counts the index signals, which arrive only if one drive is selected.
*/
-static void fd_motor_off_timer( unsigned long dummy )
+static void fd_motor_off_timer(unsigned long dummy)
{
unsigned char status;
@@ -490,7 +490,7 @@ static void fd_motor_off_timer( unsigned long dummy )
if (stdma_islocked())
goto retry;
- status = FDC_READ( FDCREG_STATUS );
+ status = FDC_READ(FDCREG_STATUS);
if (!(status & 0x80)) {
/* motor already turned off by FDC -> deselect drives */
@@ -515,7 +515,7 @@ static void fd_motor_off_timer( unsigned long dummy )
* as possible) and keep track of the current state of the write protection.
*/
-static void check_change( unsigned long dummy )
+static void check_change(unsigned long dummy)
{
static int drive = 0;
@@ -534,11 +534,11 @@ static void check_change( unsigned long dummy )
old_porta = sound_ym.rd_data_reg_sel;
sound_ym.wd_data = (old_porta | DSKDRVNONE) &
~(drive == 0 ? DSKDRV0 : DSKDRV1);
- stat = !!(FDC_READ( FDCREG_STATUS ) & FDCSTAT_WPROT);
+ stat = !!(FDC_READ(FDCREG_STATUS) & FDCSTAT_WPROT);
sound_ym.wd_data = old_porta;
if (stat != UD.wpstat) {
- DPRINT(( "wpstat[%d] = %d\n", drive, stat ));
+ DPRINT(("wpstat[%d] = %d\n", drive, stat));
UD.wpstat = stat;
set_bit (drive, &changed_floppies);
}
@@ -548,7 +548,7 @@ static void check_change( unsigned long dummy )
start_check_change_timer();
}
-
+
/* Handling of the Head Settling Flag: This flag should be set after each
* seek operation, because we don't use seeks with verify.
*/
@@ -562,7 +562,7 @@ static inline int get_head_settle_flag(void)
{
int tmp = HeadSettleFlag;
HeadSettleFlag = 0;
- return( tmp );
+ return(tmp);
}
static inline void copy_buffer(void *from, void *to)
@@ -574,25 +574,25 @@ static inline void copy_buffer(void *from, void *to)
*p2++ = *p1++;
}
-
-
+
+
/* General Interrupt Handling */
-static void (*FloppyIRQHandler)( int status ) = NULL;
+static void (*FloppyIRQHandler)(int status) = NULL;
static irqreturn_t floppy_irq (int irq, void *dummy)
{
unsigned char status;
- void (*handler)( int );
+ void (*handler)(int);
handler = xchg(&FloppyIRQHandler, NULL);
if (handler) {
nop();
- status = FDC_READ( FDCREG_STATUS );
- DPRINT(("FDC irq, status = %02x handler = %08lx\n",status,(unsigned long)handler));
- handler( status );
+ status = FDC_READ(FDCREG_STATUS);
+ DPRINT(("FDC irq, status = %02x handler = %08lx\n", status, (unsigned long)handler));
+ handler(status);
}
else {
DPRINT(("FDC irq, no handler\n"));
@@ -605,7 +605,7 @@ static irqreturn_t floppy_irq (int irq, void *dummy)
* recalibrate, then try again, and fail after MAX_ERRORS.
*/
-static void fd_error( void )
+static void fd_error(void)
{
if (IsFormatting) {
IsFormatting = 0;
@@ -619,11 +619,11 @@ static void fd_error( void )
fd_request->errors++;
if (fd_request->errors >= MAX_ERRORS) {
- printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive );
+ printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive);
fd_end_request_cur(-EIO);
}
else if (fd_request->errors == RECALIBRATE_ERRORS) {
- printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive );
+ printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive);
if (SelectedDrive != -1)
SUD.track = -1;
}
@@ -632,16 +632,16 @@ static void fd_error( void )
-#define SET_IRQ_HANDLER(proc) do { FloppyIRQHandler = (proc); } while(0)
+#define SET_IRQ_HANDLER(proc) do { FloppyIRQHandler = (proc); } while (0)
/* ---------- Formatting ---------- */
-#define FILL(n,val) \
+#define FILL(n, val) \
do { \
- memset( p, val, n ); \
+ memset(p, val, n); \
p += n; \
- } while(0)
+ } while (0)
static int do_format(int drive, int type, struct atari_format_descr *desc)
{
@@ -650,12 +650,12 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
unsigned long flags;
DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n",
- drive, desc->track, desc->head, desc->sect_offset ));
+ drive, desc->track, desc->head, desc->sect_offset));
wait_event(fdc_wait, cmpxchg(&fdc_busy, 0, 1) == 0);
local_irq_save(flags);
stdma_lock(floppy_irq, NULL);
- atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */
+ atari_turnon_irq(IRQ_MFP_FDC); /* should be already, just to be sure */
local_irq_restore(flags);
if (type) {
@@ -679,38 +679,38 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
contents become invalid! */
BufferDrive = -1;
/* stop deselect timer */
- del_timer( &motor_off_timer );
+ del_timer(&motor_off_timer);
- FILL( 60 * (nsect / 9), 0x4e );
- for( sect = 0; sect < nsect; ++sect ) {
- FILL( 12, 0 );
- FILL( 3, 0xf5 );
+ FILL(60 * (nsect / 9), 0x4e);
+ for (sect = 0; sect < nsect; ++sect) {
+ FILL(12, 0);
+ FILL(3, 0xf5);
*p++ = 0xfe;
*p++ = desc->track;
*p++ = desc->head;
*p++ = (nsect + sect - desc->sect_offset) % nsect + 1;
*p++ = 2;
*p++ = 0xf7;
- FILL( 22, 0x4e );
- FILL( 12, 0 );
- FILL( 3, 0xf5 );
+ FILL(22, 0x4e);
+ FILL(12, 0);
+ FILL(3, 0xf5);
*p++ = 0xfb;
- FILL( 512, 0xe5 );
+ FILL(512, 0xe5);
*p++ = 0xf7;
- FILL( 40, 0x4e );
+ FILL(40, 0x4e);
}
- FILL( TrackBuffer+BUFFER_SIZE-p, 0x4e );
+ FILL(TrackBuffer+BUFFER_SIZE-p, 0x4e);
IsFormatting = 1;
FormatError = 0;
ReqTrack = desc->track;
ReqSide = desc->head;
- do_fd_action( drive );
+ do_fd_action(drive);
wait_for_completion(&format_wait);
redo_fd_request();
- return( FormatError ? -EIO : 0 );
+ return(FormatError ? -EIO : 0);
}
@@ -723,18 +723,18 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
* set function to propagate the request down to fd_rwsec_done().
*/
-static void do_fd_action( int drive )
+static void do_fd_action(int drive)
{
DPRINT(("do_fd_action\n"));
-
+
if (UseTrackbuffer && !IsFormatting) {
repeat:
- if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
+ if (IS_BUFFERED(drive, ReqSide, ReqTrack)) {
if (ReqCmd == READ) {
- copy_buffer( SECTOR_BUFFER(ReqSector), ReqData );
+ copy_buffer( SECTOR_BUFFER(ReqSector), ReqData);
if (++ReqCnt < blk_rq_cur_sectors(fd_request)) {
/* read next sector */
- setup_req_params( drive );
+ setup_req_params(drive);
goto repeat;
}
else {
@@ -847,7 +847,7 @@ static void fd_seek_done(int status)
dma_wd.fdc_speed = SUDT->fdc_speed;
if (status & FDCSTAT_RECNF) {
printk(KERN_ERR "fd%d: seek error (to track %d)\n",
- SelectedDrive, ReqTrack );
+ SelectedDrive, ReqTrack);
/* we don't know exactly which track we are on now! */
SUD.track = -1;
fd_error();
@@ -924,7 +924,7 @@ static void fd_rwsec(void)
dma_wd.dma_hi = (unsigned char)paddr;
MFPDELAY();
local_irq_restore(flags);
-
+
/* Clear FIFO and switch DMA to correct mode */
dma_wd.dma_mode_status = 0x90 | rwflag;
MFPDELAY();
@@ -1251,10 +1251,10 @@ static void fd_times_out(unsigned long dummy)
FDC_WRITE(FDCREG_CMD, FDCCMD_FORCI);
udelay(25);
- printk(KERN_ERR "floppy timeout\n" );
+ printk(KERN_ERR "floppy timeout\n");
fd_error();
end:
- atari_enable_irq( IRQ_MFP_FDC );
+ atari_enable_irq(IRQ_MFP_FDC);
}
@@ -1284,7 +1284,7 @@ static void finish_fdc(void)
}
-static void finish_fdc_done( int dummy )
+static void finish_fdc_done(int dummy)
{
unsigned long flags;
@@ -1304,7 +1304,7 @@ static void finish_fdc_done( int dummy )
local_irq_save(flags);
stdma_release();
fdc_busy = 0;
- wake_up( &fdc_wait );
+ wake_up(&fdc_wait);
local_irq_restore(flags);
DPRINT(("finish_fdc() finished\n"));
@@ -1552,7 +1552,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
switch (cmd) {
case FDSETPRM:
case FDDEFPRM:
- /*
+ /*
* MSch 7/96: simple 'set geometry' case: just set the
* 'default' device params (minor == 0).
* Currently, the drive geometry is cleared after each
@@ -1566,8 +1566,8 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
return -EBUSY;
if (copy_from_user(&setprm, argp, sizeof(setprm)))
return -EFAULT;
- /*
- * first of all: check for floppy change and revalidate,
+ /*
+ * first of all: check for floppy change and revalidate,
* or the next access will revalidate - and clear UDT :-(
*/
@@ -1585,10 +1585,10 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
return -EINVAL;
}
- /*
+ /*
* type == 0: first look for a matching entry in the type list,
* and set the UD.disktype field to use the perdefined entry.
- * TODO: add user-defined format to head of autoprobe list ?
+ * TODO: add user-defined format to head of autoprobe list ?
* Useful to include the user-type for future autodetection!
*/
@@ -1602,9 +1602,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
dtp = &atari_disk_type[setidx];
/* found matching entry ?? */
- if ( dtp->blocks == setprm.size
+ if (dtp->blocks == setprm.size
&& dtp->spt == setprm.sect
- && dtp->stretch == setprm.stretch ) {
+ && dtp->stretch == setprm.stretch) {
if (UD.flags & FTD_MSG)
printk (KERN_INFO "floppy%d: setting %s %p!\n",
drive, dtp->name, dtp);
@@ -1619,7 +1619,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
default_params[drive].fdc_speed = dtp->fdc_speed;
default_params[drive].stretch = dtp->stretch;
}
-
+
return 0;
}
@@ -1715,7 +1715,7 @@ static void __init fd_probe(int drive)
UD.connected = 1;
UD.track = 0;
- switch(UserSteprate[drive]) {
+ switch (UserSteprate[drive]) {
case 2:
UD.steprate = FDCSTEP_2;
break;
--
2.5.3
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 6/6] block: Coding style fix for comma and open , close parenthesis
2015-10-25 18:48 ` [PATCH 6/6] " Punit Vara
@ 2015-10-25 18:55 ` punit vara
0 siblings, 0 replies; 9+ messages in thread
From: punit vara @ 2015-10-25 18:55 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
On Mon, Oct 26, 2015 at 12:18 AM, Punit Vara <punitvara@gmail.com> wrote:
> Add and remove space as per coding style for loops,comma , open and
> close parenthesis.It also removes whitespace.
>
> This patch is to the ataflop.c file that fixes up following ERRORs
> reported by checkpatch:
>
> - space prohibited before that close parenthesis ')'
> - space prohibited after that open parenthesis '('
> - trailing whitespace
> - space required after that ',' (ctx:VxV)
> - space required before the open parenthesis '('
>
> Signed-off-by: Punit Vara <punitvara@gmail.com>
> ---
> drivers/block/ataflop.c | 244 ++++++++++++++++++++++++------------------------
> 1 file changed, 122 insertions(+), 122 deletions(-)
>
> diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
> index 5b31772..62763fd 100644
> --- a/drivers/block/ataflop.c
> +++ b/drivers/block/ataflop.c
> @@ -32,7 +32,7 @@
> * the FDC will otherwise wait forever when no disk is inserted...
> *
> * ++ Freddi Aschwanden (fa) 20.9.95 fixes for medusa:
> - * - MFPDELAY() after each FDC access -> atari
> + * - MFPDELAY() after each FDC access -> atari
> * - more/other disk formats
> * - DMA to the block buffer directly if we have a 32bit DMA
> * - for medusa, the step rate is always 3ms
> @@ -45,7 +45,7 @@
> * Roman 10/15/95:
> * - implement some more ioctls
> * - disk formatting
> - *
> + *
> * Andreas 95/12/12:
> * - increase gap size at start of track for HD/ED disks
> *
> @@ -95,39 +95,39 @@ static struct atari_disk_type {
> } atari_disk_type[] = {
> { "d360", 9, 720, 0, 0}, /* 0: 360kB diskette */
> { "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */
> - { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
> - { "D820", 10,1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */
> + { "D720", 9, 1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
> + { "D820", 10, 1640, 0, 0}, /* 3: DD disk with 82 tracks/10 sectors */
> /* formats above are probed for type DD */
> #define MAX_TYPE_DD 3
> - { "h1200",15,2400, 3, 0}, /* 4: 1.2MB diskette */
> - { "H1440",18,2880, 3, 0}, /* 5: 1.4 MB diskette (HD) */
> - { "H1640",20,3280, 3, 0}, /* 6: 1.64MB diskette (fat HD) 82 tr 20 sec */
> + { "h1200", 15, 2400, 3, 0}, /* 4: 1.2MB diskette */
> + { "H1440", 18, 2880, 3, 0}, /* 5: 1.4 MB diskette (HD) */
> + { "H1640", 20, 3280, 3, 0}, /* 6: 1.64MB diskette (fat HD) 82 tr 20 sec */
> /* formats above are probed for types DD and HD */
> #define MAX_TYPE_HD 6
> - { "E2880",36,5760, 3, 0}, /* 7: 2.8 MB diskette (ED) */
> - { "E3280",40,6560, 3, 0}, /* 8: 3.2 MB diskette (fat ED) 82 tr 40 sec */
> + { "E2880", 36, 5760, 3, 0}, /* 7: 2.8 MB diskette (ED) */
> + { "E3280", 40, 6560, 3, 0}, /* 8: 3.2 MB diskette (fat ED) 82 tr 40 sec */
> /* formats above are probed for types DD, HD and ED */
> #define MAX_TYPE_ED 8
> /* types below are never autoprobed */
> - { "H1680",21,3360, 3, 0}, /* 9: 1.68MB diskette (fat HD) 80 tr 21 sec */
> - { "h410",10,820, 0, 1}, /* 10: 410k diskette 41 tr 10 sec, stretch */
> - { "h1476",18,2952, 3, 0}, /* 11: 1.48MB diskette 82 tr 18 sec */
> - { "H1722",21,3444, 3, 0}, /* 12: 1.72MB diskette 82 tr 21 sec */
> - { "h420",10,840, 0, 1}, /* 13: 420k diskette 42 tr 10 sec, stretch */
> - { "H830",10,1660, 0, 0}, /* 14: 820k diskette 83 tr 10 sec */
> - { "h1494",18,2952, 3, 0}, /* 15: 1.49MB diskette 83 tr 18 sec */
> - { "H1743",21,3486, 3, 0}, /* 16: 1.74MB diskette 83 tr 21 sec */
> - { "h880",11,1760, 0, 0}, /* 17: 880k diskette 80 tr 11 sec */
> - { "D1040",13,2080, 0, 0}, /* 18: 1.04MB diskette 80 tr 13 sec */
> - { "D1120",14,2240, 0, 0}, /* 19: 1.12MB diskette 80 tr 14 sec */
> - { "h1600",20,3200, 3, 0}, /* 20: 1.60MB diskette 80 tr 20 sec */
> - { "H1760",22,3520, 3, 0}, /* 21: 1.76MB diskette 80 tr 22 sec */
> - { "H1920",24,3840, 3, 0}, /* 22: 1.92MB diskette 80 tr 24 sec */
> - { "E3200",40,6400, 3, 0}, /* 23: 3.2MB diskette 80 tr 40 sec */
> - { "E3520",44,7040, 3, 0}, /* 24: 3.52MB diskette 80 tr 44 sec */
> - { "E3840",48,7680, 3, 0}, /* 25: 3.84MB diskette 80 tr 48 sec */
> - { "H1840",23,3680, 3, 0}, /* 26: 1.84MB diskette 80 tr 23 sec */
> - { "D800",10,1600, 0, 0}, /* 27: 800k diskette 80 tr 10 sec */
> + { "H1680", 21, 3360, 3, 0}, /* 9: 1.68MB diskette (fat HD) 80 tr 21 sec */
> + { "h410", 10, 820, 0, 1}, /* 10: 410k diskette 41 tr 10 sec, stretch */
> + { "h1476", 18, 2952, 3, 0}, /* 11: 1.48MB diskette 82 tr 18 sec */
> + { "H1722", 21, 3444, 3, 0}, /* 12: 1.72MB diskette 82 tr 21 sec */
> + { "h420", 10, 840, 0, 1}, /* 13: 420k diskette 42 tr 10 sec, stretch */
> + { "H830", 10, 1660, 0, 0}, /* 14: 820k diskette 83 tr 10 sec */
> + { "h1494", 18, 2952, 3, 0}, /* 15: 1.49MB diskette 83 tr 18 sec */
> + { "H1743", 21, 3486, 3, 0}, /* 16: 1.74MB diskette 83 tr 21 sec */
> + { "h880", 11, 1760, 0, 0}, /* 17: 880k diskette 80 tr 11 sec */
> + { "D1040", 13, 2080, 0, 0}, /* 18: 1.04MB diskette 80 tr 13 sec */
> + { "D1120", 14, 2240, 0, 0}, /* 19: 1.12MB diskette 80 tr 14 sec */
> + { "h1600", 20, 3200, 3, 0}, /* 20: 1.60MB diskette 80 tr 20 sec */
> + { "H1760", 22, 3520, 3, 0}, /* 21: 1.76MB diskette 80 tr 22 sec */
> + { "H1920", 24, 3840, 3, 0}, /* 22: 1.92MB diskette 80 tr 24 sec */
> + { "E3200", 40, 6400, 3, 0}, /* 23: 3.2MB diskette 80 tr 40 sec */
> + { "E3520", 44, 7040, 3, 0}, /* 24: 3.52MB diskette 80 tr 44 sec */
> + { "E3840", 48, 7680, 3, 0}, /* 25: 3.84MB diskette 80 tr 48 sec */
> + { "H1840", 23, 3680, 3, 0}, /* 26: 1.84MB diskette 80 tr 23 sec */
> + { "D800", 10, 1600, 0, 0}, /* 27: 800k diskette 80 tr 10 sec */
> };
>
> static int StartDiskType[] = {
> @@ -199,7 +199,7 @@ static struct atari_disk_type user_params[FD_MAX_UNITS];
>
> /*
> * User-provided permanent type information. 'drive' points to
> - * the respective entry of this array. Set by FDDEFPRM ioctls,
> + * the respective entry of this array. Set by FDDEFPRM ioctls,
> * restored upon disk change by floppy_revalidate() if valid (as seen by
> * default_params[].blocks > 0 - a bit in unit[].flags might be used for this?)
> */
> @@ -241,7 +241,7 @@ static struct atari_floppy_struct {
> __val & 0xff; \
> })
>
> -#define FDC_WRITE(reg,val) \
> +#define FDC_WRITE(reg, val) \
> do { \
> /* unsigned long __flags; */ \
> /* local_irq_save(__flags); */ \
> @@ -250,7 +250,7 @@ static struct atari_floppy_struct {
> dma_wd.fdc_acces_seccount = (val); \
> MFPDELAY(); \
> /* local_irq_restore(__flags); */ \
> - } while(0)
> + } while (0)
>
>
> /* Buffering variables:
> @@ -281,7 +281,7 @@ static int BufferDrive, BufferSide, BufferTrack;
> static int read_track; /* non-zero if we are reading whole tracks */
>
> #define SECTOR_BUFFER(sec) (TrackBuffer + ((sec)-1)*512)
> -#define IS_BUFFERED(drive,side,track) \
> +#define IS_BUFFERED(drive, side, track) \
> (BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
>
> /*
> @@ -339,35 +339,35 @@ static int NeedSeek = 0;
>
> /***************************** Prototypes *****************************/
>
> -static void fd_select_side( int side );
> -static void fd_select_drive( int drive );
> -static void fd_deselect( void );
> -static void fd_motor_off_timer( unsigned long dummy );
> -static void check_change( unsigned long dummy );
> +static void fd_select_side(int side);
> +static void fd_select_drive(int drive);
> +static void fd_deselect(void);
> +static void fd_motor_off_timer(unsigned long dummy);
> +static void check_change(unsigned long dummy);
> static irqreturn_t floppy_irq (int irq, void *dummy);
> -static void fd_error( void );
> +static void fd_error(void);
> static int do_format(int drive, int type, struct atari_format_descr *desc);
> -static void do_fd_action( int drive );
> -static void fd_calibrate( void );
> -static void fd_calibrate_done( int status );
> -static void fd_seek( void );
> -static void fd_seek_done( int status );
> -static void fd_rwsec( void );
> -static void fd_readtrack_check( unsigned long dummy );
> -static void fd_rwsec_done( int status );
> +static void do_fd_action(int drive);
> +static void fd_calibrate(void);
> +static void fd_calibrate_done(int status);
> +static void fd_seek(void);
> +static void fd_seek_done(int status);
> +static void fd_rwsec(void);
> +static void fd_readtrack_check(unsigned long dummy);
> +static void fd_rwsec_done(int status);
> static void fd_rwsec_done1(int status);
> -static void fd_writetrack( void );
> -static void fd_writetrack_done( int status );
> -static void fd_times_out( unsigned long dummy );
> -static void finish_fdc( void );
> -static void finish_fdc_done( int dummy );
> -static void setup_req_params( int drive );
> -static void redo_fd_request( void);
> +static void fd_writetrack(void);
> +static void fd_writetrack_done(int status);
> +static void fd_times_out(unsigned long dummy);
> +static void finish_fdc(void);
> +static void finish_fdc_done(int dummy);
> +static void setup_req_params(int drive);
> +static void redo_fd_request(void);
> static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
> cmd, unsigned long param);
> -static void fd_probe( int drive );
> -static int fd_test_drive_present( int drive );
> -static void config_types( void );
> +static void fd_probe(int drive);
> +static int fd_test_drive_present(int drive);
> +static void config_types(void);
> static int floppy_open(struct block_device *bdev, fmode_t mode);
> static void floppy_release(struct gendisk *disk, fmode_t mode);
>
> @@ -377,7 +377,7 @@ static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0);
> static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0);
> static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0);
> static DEFINE_TIMER(fd_timer, check_change, 0, 0);
> -
> +
> static void fd_end_request_cur(int err)
> {
> if (!__blk_end_request_cur(fd_request, err))
> @@ -390,7 +390,7 @@ static inline void start_motor_off_timer(void)
> MotorOffTrys = 0;
> }
>
> -static inline void start_check_change_timer( void )
> +static inline void start_check_change_timer(void)
> {
> mod_timer(&fd_timer, jiffies + CHECK_CHANGE_DELAY);
> }
> @@ -407,13 +407,13 @@ static inline void stop_timeout(void)
>
> /* Select the side to use. */
>
> -static void fd_select_side( int side )
> +static void fd_select_side(int side)
> {
> unsigned long flags;
>
> /* protect against various other ints mucking around with the PSG */
> local_irq_save(flags);
> -
> +
> sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
> sound_ym.wd_data = (side == 0) ? sound_ym.rd_data_reg_sel | 0x01 :
> sound_ym.rd_data_reg_sel & 0xfe;
> @@ -426,11 +426,11 @@ static void fd_select_side( int side )
> * clock speed for this disk's type.
> */
>
> -static void fd_select_drive( int drive )
> +static void fd_select_drive(int drive)
> {
> unsigned long flags;
> unsigned char tmp;
> -
> +
> if (drive == SelectedDrive)
> return;
>
> @@ -443,28 +443,28 @@ static void fd_select_drive( int drive )
> local_irq_restore(flags);
>
> /* restore track register to saved value */
> - FDC_WRITE( FDCREG_TRACK, UD.track );
> + FDC_WRITE(FDCREG_TRACK, UD.track);
> udelay(25);
>
> /* select 8/16 MHz */
> if (UDT)
> if (ATARIHW_PRESENT(FDCSPEED))
> dma_wd.fdc_speed = UDT->fdc_speed;
> -
> +
> SelectedDrive = drive;
> }
>
>
> /* Deselect both drives. */
>
> -static void fd_deselect( void )
> +static void fd_deselect(void)
> {
> unsigned long flags;
>
> /* protect against various other ints mucking around with the PSG */
> local_irq_save(flags);
> atari_dont_touch_floppy_select = 0;
> - sound_ym.rd_data_reg_sel=14; /* Select PSG Port A */
> + sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
> sound_ym.wd_data = (sound_ym.rd_data_reg_sel |
> (MACH_IS_FALCON ? 3 : 7)); /* no drives selected */
> /* On Falcon, the drive B select line is used on the printer port, so
> @@ -479,7 +479,7 @@ static void fd_deselect( void )
> * counts the index signals, which arrive only if one drive is selected.
> */
>
> -static void fd_motor_off_timer( unsigned long dummy )
> +static void fd_motor_off_timer(unsigned long dummy)
> {
> unsigned char status;
>
> @@ -490,7 +490,7 @@ static void fd_motor_off_timer( unsigned long dummy )
> if (stdma_islocked())
> goto retry;
>
> - status = FDC_READ( FDCREG_STATUS );
> + status = FDC_READ(FDCREG_STATUS);
>
> if (!(status & 0x80)) {
> /* motor already turned off by FDC -> deselect drives */
> @@ -515,7 +515,7 @@ static void fd_motor_off_timer( unsigned long dummy )
> * as possible) and keep track of the current state of the write protection.
> */
>
> -static void check_change( unsigned long dummy )
> +static void check_change(unsigned long dummy)
> {
> static int drive = 0;
>
> @@ -534,11 +534,11 @@ static void check_change( unsigned long dummy )
> old_porta = sound_ym.rd_data_reg_sel;
> sound_ym.wd_data = (old_porta | DSKDRVNONE) &
> ~(drive == 0 ? DSKDRV0 : DSKDRV1);
> - stat = !!(FDC_READ( FDCREG_STATUS ) & FDCSTAT_WPROT);
> + stat = !!(FDC_READ(FDCREG_STATUS) & FDCSTAT_WPROT);
> sound_ym.wd_data = old_porta;
>
> if (stat != UD.wpstat) {
> - DPRINT(( "wpstat[%d] = %d\n", drive, stat ));
> + DPRINT(("wpstat[%d] = %d\n", drive, stat));
> UD.wpstat = stat;
> set_bit (drive, &changed_floppies);
> }
> @@ -548,7 +548,7 @@ static void check_change( unsigned long dummy )
> start_check_change_timer();
> }
>
> -
> +
> /* Handling of the Head Settling Flag: This flag should be set after each
> * seek operation, because we don't use seeks with verify.
> */
> @@ -562,7 +562,7 @@ static inline int get_head_settle_flag(void)
> {
> int tmp = HeadSettleFlag;
> HeadSettleFlag = 0;
> - return( tmp );
> + return(tmp);
> }
>
> static inline void copy_buffer(void *from, void *to)
> @@ -574,25 +574,25 @@ static inline void copy_buffer(void *from, void *to)
> *p2++ = *p1++;
> }
>
> -
> -
> +
> +
>
> /* General Interrupt Handling */
>
> -static void (*FloppyIRQHandler)( int status ) = NULL;
> +static void (*FloppyIRQHandler)(int status) = NULL;
>
> static irqreturn_t floppy_irq (int irq, void *dummy)
> {
> unsigned char status;
> - void (*handler)( int );
> + void (*handler)(int);
>
> handler = xchg(&FloppyIRQHandler, NULL);
>
> if (handler) {
> nop();
> - status = FDC_READ( FDCREG_STATUS );
> - DPRINT(("FDC irq, status = %02x handler = %08lx\n",status,(unsigned long)handler));
> - handler( status );
> + status = FDC_READ(FDCREG_STATUS);
> + DPRINT(("FDC irq, status = %02x handler = %08lx\n", status, (unsigned long)handler));
> + handler(status);
> }
> else {
> DPRINT(("FDC irq, no handler\n"));
> @@ -605,7 +605,7 @@ static irqreturn_t floppy_irq (int irq, void *dummy)
> * recalibrate, then try again, and fail after MAX_ERRORS.
> */
>
> -static void fd_error( void )
> +static void fd_error(void)
> {
> if (IsFormatting) {
> IsFormatting = 0;
> @@ -619,11 +619,11 @@ static void fd_error( void )
>
> fd_request->errors++;
> if (fd_request->errors >= MAX_ERRORS) {
> - printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive );
> + printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive);
> fd_end_request_cur(-EIO);
> }
> else if (fd_request->errors == RECALIBRATE_ERRORS) {
> - printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive );
> + printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive);
> if (SelectedDrive != -1)
> SUD.track = -1;
> }
> @@ -632,16 +632,16 @@ static void fd_error( void )
>
>
>
> -#define SET_IRQ_HANDLER(proc) do { FloppyIRQHandler = (proc); } while(0)
> +#define SET_IRQ_HANDLER(proc) do { FloppyIRQHandler = (proc); } while (0)
>
>
> /* ---------- Formatting ---------- */
>
> -#define FILL(n,val) \
> +#define FILL(n, val) \
> do { \
> - memset( p, val, n ); \
> + memset(p, val, n); \
> p += n; \
> - } while(0)
> + } while (0)
>
> static int do_format(int drive, int type, struct atari_format_descr *desc)
> {
> @@ -650,12 +650,12 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
> unsigned long flags;
>
> DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n",
> - drive, desc->track, desc->head, desc->sect_offset ));
> + drive, desc->track, desc->head, desc->sect_offset));
>
> wait_event(fdc_wait, cmpxchg(&fdc_busy, 0, 1) == 0);
> local_irq_save(flags);
> stdma_lock(floppy_irq, NULL);
> - atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */
> + atari_turnon_irq(IRQ_MFP_FDC); /* should be already, just to be sure */
> local_irq_restore(flags);
>
> if (type) {
> @@ -679,38 +679,38 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
> contents become invalid! */
> BufferDrive = -1;
> /* stop deselect timer */
> - del_timer( &motor_off_timer );
> + del_timer(&motor_off_timer);
>
> - FILL( 60 * (nsect / 9), 0x4e );
> - for( sect = 0; sect < nsect; ++sect ) {
> - FILL( 12, 0 );
> - FILL( 3, 0xf5 );
> + FILL(60 * (nsect / 9), 0x4e);
> + for (sect = 0; sect < nsect; ++sect) {
> + FILL(12, 0);
> + FILL(3, 0xf5);
> *p++ = 0xfe;
> *p++ = desc->track;
> *p++ = desc->head;
> *p++ = (nsect + sect - desc->sect_offset) % nsect + 1;
> *p++ = 2;
> *p++ = 0xf7;
> - FILL( 22, 0x4e );
> - FILL( 12, 0 );
> - FILL( 3, 0xf5 );
> + FILL(22, 0x4e);
> + FILL(12, 0);
> + FILL(3, 0xf5);
> *p++ = 0xfb;
> - FILL( 512, 0xe5 );
> + FILL(512, 0xe5);
> *p++ = 0xf7;
> - FILL( 40, 0x4e );
> + FILL(40, 0x4e);
> }
> - FILL( TrackBuffer+BUFFER_SIZE-p, 0x4e );
> + FILL(TrackBuffer+BUFFER_SIZE-p, 0x4e);
>
> IsFormatting = 1;
> FormatError = 0;
> ReqTrack = desc->track;
> ReqSide = desc->head;
> - do_fd_action( drive );
> + do_fd_action(drive);
>
> wait_for_completion(&format_wait);
>
> redo_fd_request();
> - return( FormatError ? -EIO : 0 );
> + return(FormatError ? -EIO : 0);
> }
>
>
> @@ -723,18 +723,18 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
> * set function to propagate the request down to fd_rwsec_done().
> */
>
> -static void do_fd_action( int drive )
> +static void do_fd_action(int drive)
> {
> DPRINT(("do_fd_action\n"));
> -
> +
> if (UseTrackbuffer && !IsFormatting) {
> repeat:
> - if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
> + if (IS_BUFFERED(drive, ReqSide, ReqTrack)) {
> if (ReqCmd == READ) {
> - copy_buffer( SECTOR_BUFFER(ReqSector), ReqData );
> + copy_buffer( SECTOR_BUFFER(ReqSector), ReqData);
> if (++ReqCnt < blk_rq_cur_sectors(fd_request)) {
> /* read next sector */
> - setup_req_params( drive );
> + setup_req_params(drive);
> goto repeat;
> }
> else {
> @@ -847,7 +847,7 @@ static void fd_seek_done(int status)
> dma_wd.fdc_speed = SUDT->fdc_speed;
> if (status & FDCSTAT_RECNF) {
> printk(KERN_ERR "fd%d: seek error (to track %d)\n",
> - SelectedDrive, ReqTrack );
> + SelectedDrive, ReqTrack);
> /* we don't know exactly which track we are on now! */
> SUD.track = -1;
> fd_error();
> @@ -924,7 +924,7 @@ static void fd_rwsec(void)
> dma_wd.dma_hi = (unsigned char)paddr;
> MFPDELAY();
> local_irq_restore(flags);
> -
> +
> /* Clear FIFO and switch DMA to correct mode */
> dma_wd.dma_mode_status = 0x90 | rwflag;
> MFPDELAY();
> @@ -1251,10 +1251,10 @@ static void fd_times_out(unsigned long dummy)
> FDC_WRITE(FDCREG_CMD, FDCCMD_FORCI);
> udelay(25);
>
> - printk(KERN_ERR "floppy timeout\n" );
> + printk(KERN_ERR "floppy timeout\n");
> fd_error();
> end:
> - atari_enable_irq( IRQ_MFP_FDC );
> + atari_enable_irq(IRQ_MFP_FDC);
> }
>
>
> @@ -1284,7 +1284,7 @@ static void finish_fdc(void)
> }
>
>
> -static void finish_fdc_done( int dummy )
> +static void finish_fdc_done(int dummy)
> {
> unsigned long flags;
>
> @@ -1304,7 +1304,7 @@ static void finish_fdc_done( int dummy )
> local_irq_save(flags);
> stdma_release();
> fdc_busy = 0;
> - wake_up( &fdc_wait );
> + wake_up(&fdc_wait);
> local_irq_restore(flags);
>
> DPRINT(("finish_fdc() finished\n"));
> @@ -1552,7 +1552,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
> switch (cmd) {
> case FDSETPRM:
> case FDDEFPRM:
> - /*
> + /*
> * MSch 7/96: simple 'set geometry' case: just set the
> * 'default' device params (minor == 0).
> * Currently, the drive geometry is cleared after each
> @@ -1566,8 +1566,8 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
> return -EBUSY;
> if (copy_from_user(&setprm, argp, sizeof(setprm)))
> return -EFAULT;
> - /*
> - * first of all: check for floppy change and revalidate,
> + /*
> + * first of all: check for floppy change and revalidate,
> * or the next access will revalidate - and clear UDT :-(
> */
>
> @@ -1585,10 +1585,10 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
> return -EINVAL;
> }
>
> - /*
> + /*
> * type == 0: first look for a matching entry in the type list,
> * and set the UD.disktype field to use the perdefined entry.
> - * TODO: add user-defined format to head of autoprobe list ?
> + * TODO: add user-defined format to head of autoprobe list ?
> * Useful to include the user-type for future autodetection!
> */
>
> @@ -1602,9 +1602,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
> dtp = &atari_disk_type[setidx];
>
> /* found matching entry ?? */
> - if ( dtp->blocks == setprm.size
> + if (dtp->blocks == setprm.size
> && dtp->spt == setprm.sect
> - && dtp->stretch == setprm.stretch ) {
> + && dtp->stretch == setprm.stretch) {
> if (UD.flags & FTD_MSG)
> printk (KERN_INFO "floppy%d: setting %s %p!\n",
> drive, dtp->name, dtp);
> @@ -1619,7 +1619,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
> default_params[drive].fdc_speed = dtp->fdc_speed;
> default_params[drive].stretch = dtp->stretch;
> }
> -
> +
> return 0;
> }
>
> @@ -1715,7 +1715,7 @@ static void __init fd_probe(int drive)
>
> UD.connected = 1;
> UD.track = 0;
> - switch(UserSteprate[drive]) {
> + switch (UserSteprate[drive]) {
> case 2:
> UD.steprate = FDCSTEP_2;
> break;
> --
> 2.5.3
>
Last 3 patch generate some warnings by checkpatch but that warning
already present for actual code . This file was having around 250
warning. and 250 errors. If I would go to solve all lines it will be
difficult to review so I fix them in possible small chunks. I will be
sending further patches soon for this particular file.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/6] block: Remove unneeded variable err for returning 0
2015-10-25 18:48 ` [PATCH 1/6] block: Remove unneeded variable err for returning 0 Punit Vara
@ 2015-10-27 19:11 ` punit vara
0 siblings, 0 replies; 9+ messages in thread
From: punit vara @ 2015-10-27 19:11 UTC (permalink / raw)
To: linux-kernel; +Cc: drbd-user, drbd-dev, Punit Vara
On Mon, Oct 26, 2015 at 12:18 AM, Punit Vara <punitvara@gmail.com> wrote:
> This patch is to the mg_disk.c file that removes unnecessary err
> and fixes following warning reported by coccicheck:
>
> Unneeded variable: "err". Return "0" on line 1077
>
> Signed-off-by: Punit Vara <punitvara@gmail.com>
> ---
> drivers/block/mg_disk.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
> index 145ce2a..d6f3feb 100644
> --- a/drivers/block/mg_disk.c
> +++ b/drivers/block/mg_disk.c
> @@ -1038,7 +1038,6 @@ static int mg_remove(struct platform_device *plat_dev)
> {
> struct mg_drv_data *prv_data = plat_dev->dev.platform_data;
> struct mg_host *host = prv_data->host;
> - int err = 0;
>
> /* delete timer */
> del_timer_sync(&host->timer);
> @@ -1074,7 +1073,7 @@ static int mg_remove(struct platform_device *plat_dev)
> /* free mg_host */
> kfree(host);
>
> - return err;
> + return 0;
> }
>
> static struct platform_driver mg_disk_driver = {
> --
> 2.5.3
>
Anybody going to review this patches please and I dont know who is
maintainer for all these patches
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-10-27 19:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 18:48 [PATCH 0/6] Fix coding style issues Punit Vara
2015-10-25 18:48 ` [PATCH 1/6] block: Remove unneeded variable err for returning 0 Punit Vara
2015-10-27 19:11 ` punit vara
2015-10-25 18:48 ` [PATCH 2/6] block: drbd: Remove unnedded semicolon Punit Vara
2015-10-25 18:48 ` [PATCH 3/6] block: " Punit Vara
2015-10-25 18:48 ` [PATCH 4/6] block: Coding style fix for comma and open , close parenthesis Punit Vara
2015-10-25 18:48 ` [PATCH 5/6] " Punit Vara
2015-10-25 18:48 ` [PATCH 6/6] " Punit Vara
2015-10-25 18:55 ` punit vara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome