mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Marcin Slusarz <marcin.slusarz@gmail.com>
Subject: [PATCH 10/13] drivers/block/floppy.c: Convert int initialising to bool initialized
Date: Tue,  1 Dec 2009 22:07:50 -0800	[thread overview]
Message-ID: <bef8ad74f2bd5b3c6703f10f26801a45bad9fcc2.1259733457.git.joe@perches.com> (raw)
In-Reply-To: <cover.1259733456.git.joe@perches.com>

Don't initialize initialized either.  Default is false

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

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index cc76f3d..4a9cb15 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -290,13 +290,13 @@ static inline void fallback_on_nodma_alloc(char **addr, size_t l)
 /* End dma memory related stuff */
 
 static unsigned long fake_change;
-static int initialising = 1;
+static bool initialized;
 
 #define ITYPE(x) (((x) >> 2) & 0x1f)
 #define TOMINOR(x) ((x & 3) | ((x & 4) << 5))
-#define UNIT(x) ((x) & 0x03)	/* drive on fdc */
+#define UNIT(x) ((x) & 0x03)		/* drive on fdc */
 #define FDC(x) (((x) & 0x04) >> 2)	/* fdc of drive */
-	/* reverse mapping from unit and fdc to drive */
+				/* reverse mapping from unit and fdc to drive */
 #define REVDRIVE(fdc, unit) ((unit) + ((fdc) << 2))
 
 #define DP	(&drive_params[current_drive])
@@ -1672,7 +1672,7 @@ static int wait_til_ready(void)
 		if (status & STATUS_READY)
 			return status;
 	}
-	if (!initialising) {
+	if (initialized) {
 		DPRINT("Getstatus times out (%x) on fdc %d\n", status, fdc);
 		show_floppy();
 	}
@@ -1699,7 +1699,7 @@ static int output_byte(char byte)
 		return 0;
 	}
 	FDCS->reset = 1;
-	if (!initialising) {
+	if (initialized) {
 		DPRINT("Unable to send byte %x to FDC. Fdc=%x Status=%x\n",
 		       byte, fdc, status);
 		show_floppy();
@@ -1730,10 +1730,9 @@ static int result(void)
 		else
 			break;
 	}
-	if (!initialising) {
-		DPRINT
-		    ("get result error. Fdc=%d Last status=%x Read bytes=%d\n",
-		     fdc, status, i);
+	if (initialized) {
+		DPRINT("get result error. Fdc=%d Last status=%x Read bytes=%d\n",
+		       fdc, status, i);
 		show_floppy();
 	}
 	FDCS->reset = 1;
@@ -2281,7 +2280,7 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
 	 * activity.
 	 */
 
-	do_print = !handler && print_unex && !initialising;
+	do_print = !handler && print_unex && initialized;
 
 	inr = result();
 	if (do_print)
@@ -2409,7 +2408,7 @@ static void floppy_shutdown(unsigned long data)
 {
 	unsigned long flags;
 
-	if (!initialising)
+	if (initialized)
 		show_floppy();
 	cancel_activity();
 
@@ -2421,7 +2420,7 @@ static void floppy_shutdown(unsigned long data)
 
 	/* avoid dma going to a random drive after shutdown */
 
-	if (!initialising)
+	if (initialized)
 		DPRINT("floppy timeout called\n");
 	FDCS->reset = 1;
 	if (cont) {
@@ -5024,7 +5023,7 @@ static int __init floppy_init(void)
 	fdc = 0;
 	del_timer(&fd_timeout);
 	current_drive = 0;
-	initialising = 0;
+	initialized = true;
 	if (have_no_fdc) {
 		DPRINT("no floppy controllers found\n");
 		err = have_no_fdc;
-- 
1.6.6.rc0.57.gad7a


  parent reply	other threads:[~2009-12-02  6:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02  6:07 [PATCH 00/13] drivers/block/floppy.c: More cleanups Joe Perches
2009-12-02  6:07 ` [PATCH 01/13] drivers/block/floppy.c: Remove macro LOCK_FDC Joe Perches
2009-12-02  6:07 ` [PATCH 02/13] drivers/block/floppy.c: Add debug_dcl(...) macro Joe Perches
2009-12-02  6:07 ` [PATCH 03/13] drivers/block/floppy.c: Remove [U]CLEARF, [U]SETF, and [U]TESTF macros Joe Perches
2009-12-02  6:07 ` [PATCH 04/13] drivers/block/floppy.c: Remove most uses of CALL and ECALL macros Joe Perches
2009-12-02  6:07 ` [PATCH 05/13] drivers/block/floppy.c: remove [_]COPYIN [_]COPYOUT " Joe Perches
2009-12-02  6:07 ` [PATCH 06/13] drivers/block/floppy.c: remove macros CALL, WAIT and IWAIT Joe Perches
2009-12-02  6:07 ` [PATCH 07/13] drivers/block/floppy.c: convert int 1/0 to bool true/false Joe Perches
2009-12-02  6:07 ` [PATCH 08/13] drivers/block/floppy.c: Move leading && and || to preceding line Joe Perches
2009-12-02  6:07 ` [PATCH 09/13] drivers/block/floppy.c: remove #define DEVICE_NAME "floppy" Joe Perches
2009-12-02  6:07 ` Joe Perches [this message]
2009-12-02  6:07 ` [PATCH 11/13] drivers/block/floppy.c: Add function is_ready_state Joe Perches
2009-12-02  6:07 ` [PATCH 12/13] drivers/block/floppy.c: Readd SunOS eject cmd comment Joe Perches
2009-12-02  6:07 ` [PATCH 13/13] drivers/block/floppy.c: Remove unnecessary return and braces Joe Perches
2009-12-02 17:05 ` [PATCH 00/13] drivers/block/floppy.c: More cleanups Marcin Slusarz
2009-12-02 19:03 ` Stephen Hemminger
2009-12-02 20:05   ` Joe Perches

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=bef8ad74f2bd5b3c6703f10f26801a45bad9fcc2.1259733457.git.joe@perches.com \
    --to=joe@perches.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®