All of lore.kernel.org
 help / color / mirror / Atom feed
From: Punit Vara <punitvara@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: drbd-user@lists.linbit.com, drbd-dev@lists.linbit.com,
	Punit Vara <punitvara@gmail.com>
Subject: [PATCH 4/6] block: Coding style fix for comma and open , close parenthesis
Date: Mon, 26 Oct 2015 00:18:35 +0530	[thread overview]
Message-ID: <1445798917-18876-5-git-send-email-punitvara@gmail.com> (raw)
In-Reply-To: <1445798917-18876-1-git-send-email-punitvara@gmail.com>

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


  parent reply	other threads:[~2015-10-25 18:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-28  9:17     ` [Drbd-dev] [DRBD-user] " Roland Kammerer
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 ` Punit Vara [this message]
2015-10-25 18:48 ` [PATCH 5/6] block: Coding style fix for comma and open , close parenthesis Punit Vara
2015-10-25 18:48 ` [PATCH 6/6] " Punit Vara
2015-10-25 18:55   ` punit vara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445798917-18876-5-git-send-email-punitvara@gmail.com \
    --to=punitvara@gmail.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=drbd-user@lists.linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.