Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187142
b: refs/heads/master
c: 57584c5
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Mar 12, 2010
1 parent 8c4ad9f commit a977f29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29f1c7848feb3954939b52fd5b7dca30dbce9426
refs/heads/master: 57584c5a3824a15f65d2b065d9f453fc1ae1dab7
19 changes: 15 additions & 4 deletions trunk/drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,12 @@ static inline int is_selected(int dor, int unit)
return ((dor & (0x10 << unit)) && (dor & 3) == unit);
}

static bool is_ready_state(int status)
{
int state = status & (STATUS_READY | STATUS_DIR | STATUS_DMA);
return state == STATUS_READY;
}

static int set_dor(int fdc, char mask, char data)
{
unsigned char unit;
Expand Down Expand Up @@ -823,8 +829,10 @@ static void twaddle(void)
DRS->select_date = jiffies;
}

/* reset all driver information about the current fdc. This is needed after
* a reset, and after a raw command. */
/*
* Reset all driver information about the current fdc.
* This is needed after a reset, and after a raw command.
*/
static void reset_fdc_info(int mode)
{
int drive;
Expand Down Expand Up @@ -1162,7 +1170,8 @@ static int output_byte(char byte)

if (status < 0)
return -1;
if ((status & (STATUS_READY | STATUS_DIR | STATUS_DMA)) == STATUS_READY) {

if (is_ready_state(status)) {
fd_outb(byte, FD_DATA);
#ifdef FLOPPY_SANITY_CHECK
output_log[output_log_pos].data = byte;
Expand Down Expand Up @@ -1221,8 +1230,10 @@ static int need_more_output(void)

if (status < 0)
return -1;
if ((status & (STATUS_READY | STATUS_DIR | STATUS_DMA)) == STATUS_READY)

if (is_ready_state(status))
return MORE_OUTPUT;

return result();
}

Expand Down

0 comments on commit a977f29

Please sign in to comment.