mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: linux-kernel@vger.kernel.org
Cc: Marcin Slusarz <marcin.slusarz@gmail.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 08/24] drivers/block/floppy.c: Comment neatening and remove naked ;
Date: Thu, 21 Jan 2010 20:52:38 -0800	[thread overview]
Message-ID: <14ce85f7b5adf5b40e982a5a870c5dd00a2071cb.1264133863.git.joe@perches.com> (raw)
In-Reply-To: <cover.1264133863.git.joe@perches.com>

Spacing, column alignment and a for loop with
a naked semicolon converted to an assign and while

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/block/floppy.c |   55 ++++++++++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 9f7a658..f274aff 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -1262,9 +1262,12 @@ static inline void perpendicular_mode(void)
 		default:
 			DPRINT("Invalid data rate for perpendicular mode!\n");
 			cont->done(0);
-			FDCS->reset = 1;	/* convenient way to return to
-						 * redo without to much hassle (deep
-						 * stack et al. */
+			FDCS->reset = 1;
+					/*
+					 * convenient way to return to
+					 * redo without too much hassle
+					 * (deep stack et al.)
+					 */
 			return;
 		}
 	} else
@@ -1977,8 +1980,8 @@ static void floppy_ready(void)
 #endif
 	if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) &&
 	    disk_change(current_drive) && !DP->select_delay)
-		twaddle();	/* this clears the dcl on certain drive/controller
-				 * combinations */
+		twaddle();	/* this clears the dcl on certain
+				 * drive/controller combinations */
 
 #ifdef fd_chose_dma_mode
 	if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) {
@@ -2806,15 +2809,14 @@ static int make_raw_rw_request(void)
 	    ((CT(COMMAND) == FD_READ ||
 	      (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) &&
 	     max_sector > 2 * max_buffer_sectors + buffer_min &&
-	     max_size + fsector_t > 2 * max_buffer_sectors + buffer_min)
-	    /* not enough space */
-	    ) {
+	     max_size + fsector_t > 2 * max_buffer_sectors + buffer_min)) {
+		/* not enough space */
 		buffer_track = -1;
 		buffer_drive = current_drive;
 		buffer_max = buffer_min = aligned_sector_t;
 	}
 	raw_cmd->kernel_data = floppy_track_buffer +
-	    ((aligned_sector_t - buffer_min) << 9);
+		((aligned_sector_t - buffer_min) << 9);
 
 	if (CT(COMMAND) == FD_WRITE) {
 		/* copy write buffer to track buffer.
@@ -3171,11 +3173,12 @@ static inline int raw_cmd_copyout(int cmd, char __user *param,
 		COPYOUT(*ptr);
 		param += sizeof(struct floppy_raw_cmd);
 		if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) {
-			if (ptr->length >= 0
-			    && ptr->length <= ptr->buffer_length)
-				ECALL(fd_copyout
-				      (ptr->data, ptr->kernel_data,
-				       ptr->buffer_length - ptr->length));
+			if (ptr->length >= 0 &&
+			    ptr->length <= ptr->buffer_length) {
+				long length = ptr->buffer_length - ptr->length;
+				ECALL(fd_copyout(ptr->data, ptr->kernel_data,
+						 length));
+			}
 		}
 		ptr = ptr->next;
 	}
@@ -3827,8 +3830,7 @@ static int check_floppy_change(struct gendisk *disk)
  * a disk in the drive, and whether that disk is writable.
  */
 
-static void floppy_rb0_complete(struct bio *bio,
-			       int err)
+static void floppy_rb0_complete(struct bio *bio, int err)
 {
 	complete((struct completion *)bio->bi_private);
 }
@@ -4120,9 +4122,9 @@ static int __init floppy_setup(char *str)
 				else
 					param = config_params[i].def_param;
 				if (config_params[i].fn)
-					config_params[i].
-					    fn(ints, param,
-					       config_params[i].param2);
+					config_params[i].fn(ints, param,
+							    config_params[i].
+							    param2);
 				if (config_params[i].var) {
 					DPRINT("%s=%d\n", str, param);
 					*config_params[i].var = param;
@@ -4180,8 +4182,8 @@ static const struct dev_pm_ops floppy_pm_ops = {
 
 static struct platform_driver floppy_driver = {
 	.driver = {
-		.name = "floppy",
-		.pm = &floppy_pm_ops,
+		   .name = "floppy",
+		   .pm = &floppy_pm_ops,
 	},
 };
 
@@ -4429,8 +4431,10 @@ static int floppy_request_regions(int fdc)
 	const struct io_region *p;
 
 	for (p = io_regions; p < ARRAY_END(io_regions); p++) {
-		if (!request_region(FDCS->address + p->offset, p->size, "floppy")) {
-			DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset);
+		if (!request_region(FDCS->address + p->offset,
+				    p->size, "floppy")) {
+			DPRINT("Floppy io-port 0x%04lx in use\n",
+			       FDCS->address + p->offset);
 			floppy_release_allocated_regions(fdc, p);
 			return -EBUSY;
 		}
@@ -4586,8 +4590,9 @@ static void __init parse_floppy_cfg_string(char *cfg)
 	char *ptr;
 
 	while (*cfg) {
-		for (ptr = cfg; *cfg && *cfg != ' ' && *cfg != '\t'; cfg++)
-			;
+		ptr = cfg;
+		while (*cfg && *cfg != ' ' && *cfg != '\t')
+			cfg++;
 		if (*cfg) {
 			*cfg = '\0';
 			cfg++;
-- 
1.6.6.rc0.57.gad7a


  parent reply	other threads:[~2010-01-22  4:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22  4:52 [PATCH 00/24] drivers/block/floppy.c cleanups Joe Perches
2010-01-22  4:52 ` [PATCH 01/24] drivers/block/floppy.c: Convert some #include <asm/ to #include <linux/ Joe Perches
2010-01-22  4:52 ` [PATCH 02/24] drivers/block/floppy.c: #define space and column neatening Joe Perches
2010-01-22  4:52 ` [PATCH 03/24] drivers/block/floppy.c: Use pr_<level> Joe Perches
2010-01-22  4:52 ` [PATCH 04/24] drivers/block/floppy.c: Remove unnecessary braces Joe Perches
2010-01-22  4:52 ` [PATCH 05/24] drivers/block/floppy.c: Remove used once CHECK_READY macro Joe Perches
2010-01-22  4:52 ` [PATCH 06/24] drivers/block/floppy.c: Hoist assigns from if()s, neatening Joe Perches
2010-01-22  4:52 ` [PATCH 07/24] drivers/block/floppy.c: Remove LAST_OUT macro Joe Perches
2010-01-22  4:52 ` Joe Perches [this message]
2010-01-22  4:52 ` [PATCH 09/24] drivers/block/floppy.c: Remove CLEARSTRUCT macro, use memset Joe Perches
2010-01-22  4:52 ` [PATCH 10/24] drivers/block/floppy.c: Indent a comment Joe Perches
2010-01-22  4:52 ` [PATCH 11/24] drivers/block/floppy.c: Remove IN/OUT macros, indent switch/case Joe Perches
2010-01-22  4:52 ` [PATCH 12/24] drivers/block/floppy.c: Remove a few spaces from function casts Joe Perches
2010-01-22  4:52 ` [PATCH 13/24] drivers/block/floppy.c: Remove macro LOCK_FDC Joe Perches
2010-01-22  4:52 ` [PATCH 14/24] drivers/block/floppy.c: Add debug_dcl(...) macro Joe Perches
2010-01-22  4:52 ` [PATCH 15/24] drivers/block/floppy.c: Remove [U]CLEARF, [U]SETF, and [U]TESTF macros Joe Perches
2010-01-22  4:52 ` [PATCH 16/24] drivers/block/floppy.c: Remove most uses of CALL and ECALL macros Joe Perches
2010-01-22  4:52 ` [PATCH 17/24] drivers/block/floppy.c: remove [_]COPYIN [_]COPYOUT " Joe Perches
2010-01-22  4:52 ` [PATCH 18/24] drivers/block/floppy.c: remove macros CALL, WAIT and IWAIT Joe Perches
2010-01-22  4:52 ` [PATCH 19/24] drivers/block/floppy.c: convert int 1/0 to bool true/false Joe Perches
2010-01-22  4:52 ` [PATCH 20/24] drivers/block/floppy.c: Move leading && and || to preceding line Joe Perches
2010-01-22  4:52 ` [PATCH 21/24] drivers/block/floppy.c: remove #define DEVICE_NAME "floppy" Joe Perches
2010-01-22  4:52 ` [PATCH 22/24] drivers/block/floppy.c: Convert int initialising to bool initialized Joe Perches
2010-01-22  4:52 ` [PATCH 23/24] drivers/block/floppy.c: Add function is_ready_state Joe Perches
2010-01-22  4:52 ` [PATCH 24/24] drivers/block/floppy.c: Remove unnecessary return and braces Joe Perches
2010-01-22 10:47 ` [PATCH 00/24] drivers/block/floppy.c cleanups Andi Kleen
2010-01-22 11:46   ` Alan Cox
2010-01-22 17:04     ` Stephen Hemminger

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=14ce85f7b5adf5b40e982a5a870c5dd00a2071cb.1264133863.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=bzolnier@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=shemminger@vyatta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®