mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
swim: Clean up whitespace
No functional changes. Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Finn Thain <fthain@linux-m68k.org> Tested-by: Stan Johnson <userm57@yahoo.com> Link: https://patch.msgid.link/d33238b1b2c4a444ed3ae59d4444fafebb550921.1788513997.git.fthain@linux-m68k.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
7d7c6d91f5
commit
e97cbb470c
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* Driver for SWIM (Sander Woz Integrated Machine) floppy controller
|
||||
*
|
||||
* Copyright (C) 2004,2008 Laurent Vivier <Laurent@lvivier.info>
|
||||
* Copyright (C) 2004, 2008 Laurent Vivier <Laurent@lvivier.info>
|
||||
*
|
||||
* based on Alastair Bridgewater SWIM analysis, 2001
|
||||
* based on SWIM3 driver (c) Paul Mackerras, 1996
|
||||
|
|
@ -69,7 +69,7 @@ struct swim {
|
|||
REG(read_handshake)
|
||||
} __attribute__((packed));
|
||||
|
||||
#define swim_write(base, reg, v) out_8(&(base)->write_##reg, (v))
|
||||
#define swim_write(base, reg, v) out_8(&(base)->write_##reg, (v))
|
||||
#define swim_read(base, reg) in_8(&(base)->read_##reg)
|
||||
|
||||
/* IWM registers */
|
||||
|
|
@ -93,7 +93,7 @@ struct iwm {
|
|||
REG(q7H)
|
||||
} __attribute__((packed));
|
||||
|
||||
#define iwm_write(base, reg, v) out_8(&(base)->reg, (v))
|
||||
#define iwm_write(base, reg, v) out_8(&(base)->reg, (v))
|
||||
#define iwm_read(base, reg) in_8(&(base)->reg)
|
||||
|
||||
/* Bits in phase register */
|
||||
|
|
@ -165,23 +165,23 @@ struct floppy_state {
|
|||
/* physical properties */
|
||||
|
||||
enum drive_location location; /* internal or external drive */
|
||||
int head_number; /* single- or double-sided drive */
|
||||
int head_number; /* single- or double-sided drive */
|
||||
|
||||
/* media */
|
||||
|
||||
int disk_in;
|
||||
int ejected;
|
||||
enum media_type type;
|
||||
int write_protected;
|
||||
int disk_in;
|
||||
int ejected;
|
||||
enum media_type type;
|
||||
int write_protected;
|
||||
|
||||
unsigned int total_secs;
|
||||
unsigned int secpercyl;
|
||||
unsigned int secpertrack;
|
||||
unsigned int total_secs;
|
||||
unsigned int secpercyl;
|
||||
unsigned int secpertrack;
|
||||
|
||||
/* in-use information */
|
||||
|
||||
int track;
|
||||
int ref_count;
|
||||
int track;
|
||||
int ref_count;
|
||||
bool registered;
|
||||
|
||||
struct gendisk *disk;
|
||||
|
|
@ -216,6 +216,7 @@ extern int swim_read_sector_data(struct swim __iomem *base,
|
|||
unsigned char *data);
|
||||
|
||||
static DEFINE_MUTEX(swim_mutex);
|
||||
|
||||
static void set_swim_mode(struct swim __iomem *base, int enable)
|
||||
{
|
||||
struct iwm __iomem *iwm_base = (struct iwm __iomem *)base;
|
||||
|
|
@ -402,7 +403,7 @@ static int swim_seek(struct swim __iomem *base, int step)
|
|||
if (step == 0)
|
||||
return 0;
|
||||
|
||||
for ( ; step > 0; step--) {
|
||||
for (; step > 0; step--) {
|
||||
if (swim_step(base))
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -413,7 +414,7 @@ static int swim_seek(struct swim __iomem *base, int step)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int swim_track(struct floppy_state *fs, int track)
|
||||
static int swim_track(struct floppy_state *fs, int track)
|
||||
{
|
||||
struct swim __iomem *base = fs->swd->base;
|
||||
int ret;
|
||||
|
|
@ -555,10 +556,10 @@ static blk_status_t swim_queue_rq(struct blk_mq_hw_ctx *hctx,
|
|||
}
|
||||
|
||||
static struct floppy_struct floppy_type[4] = {
|
||||
{ 0, 0, 0, 0, 0, 0x00, 0x00, 0x00, 0x00, NULL }, /* no testing */
|
||||
{ 0, 0, 0, 0, 0, 0x00, 0x00, 0x00, 0x00, NULL }, /* no testing */
|
||||
{ 720, 9, 1, 80, 0, 0x2A, 0x02, 0xDF, 0x50, NULL }, /* 360KB SS 3.5"*/
|
||||
{ 1440, 9, 2, 80, 0, 0x2A, 0x02, 0xDF, 0x50, NULL }, /* 720KB 3.5" */
|
||||
{ 2880, 18, 2, 80, 0, 0x1B, 0x00, 0xCF, 0x6C, NULL }, /* 1.44MB 3.5" */
|
||||
{ 1440, 9, 2, 80, 0, 0x2A, 0x02, 0xDF, 0x50, NULL }, /* 720KB 3.5" */
|
||||
{ 2880, 18, 2, 80, 0, 0x1B, 0x00, 0xCF, 0x6C, NULL }, /* 1.44MB 3.5" */
|
||||
};
|
||||
|
||||
static int get_floppy_geometry(struct floppy_state *fs, int type,
|
||||
|
|
@ -585,10 +586,11 @@ static void setup_medium(struct floppy_state *fs)
|
|||
|
||||
if (swim_readbit(base, DISK_IN)) {
|
||||
struct floppy_struct *g;
|
||||
|
||||
fs->disk_in = 1;
|
||||
fs->write_protected = swim_readbit(base, WRITE_PROT);
|
||||
fs->type = swim_readbit(base, TWOMEG_MEDIA) ?
|
||||
HD_MEDIA : DD_MEDIA;
|
||||
HD_MEDIA : DD_MEDIA;
|
||||
fs->head_number = swim_readbit(base, SINGLE_SIDED) ? 1 : 2;
|
||||
get_floppy_geometry(fs, 0, &g);
|
||||
fs->total_secs = g->size;
|
||||
|
|
@ -690,7 +692,7 @@ static int floppy_ioctl(struct block_device *bdev, blk_mode_t mode,
|
|||
int err;
|
||||
|
||||
if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
return -EPERM;
|
||||
|
||||
switch (cmd) {
|
||||
case FDEJECT:
|
||||
|
|
@ -809,7 +811,7 @@ static int swim_floppy_init(struct platform_device *pdev)
|
|||
bool *data = pdev->dev.platform_data;
|
||||
bool fast_fclk = data && *data;
|
||||
struct queue_limits lim = {
|
||||
.features = BLK_FEAT_ROTATIONAL,
|
||||
.features = BLK_FEAT_ROTATIONAL,
|
||||
};
|
||||
int err;
|
||||
int drive;
|
||||
|
|
@ -961,7 +963,7 @@ static void swim_remove(struct platform_device *dev)
|
|||
static struct platform_driver swim_driver = {
|
||||
.probe = swim_probe,
|
||||
.remove = swim_remove,
|
||||
.driver = {
|
||||
.driver = {
|
||||
.name = CARDNAME,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* needs assembly language because is very timing dependent
|
||||
* this controller exists only on macintosh 680x0 based
|
||||
*
|
||||
* Copyright (C) 2004,2008 Laurent Vivier <Laurent@lvivier.info>
|
||||
* Copyright (C) 2004, 2008 Laurent Vivier <Laurent@lvivier.info>
|
||||
*
|
||||
* based on Alastair Bridgewater SWIM analysis, 2001
|
||||
* based on netBSD IWM driver (c) 1997, 1998 Hauke Fath.
|
||||
|
|
@ -110,7 +110,6 @@ sector_data_mark:
|
|||
/* read header */
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
amark0: tstb %a2@
|
||||
dbmi %d2, amark0
|
||||
bpl signal_nonyb
|
||||
|
|
@ -118,7 +117,6 @@ amark0: tstb %a2@
|
|||
moveb %a5@, %a4@(o_track)
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
amark1: tstb %a2@
|
||||
dbmi %d2, amark1
|
||||
bpl signal_nonyb
|
||||
|
|
@ -126,7 +124,6 @@ amark1: tstb %a2@
|
|||
moveb %a5@, %a4@(o_side)
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
amark2: tstb %a2@
|
||||
dbmi %d2, amark2
|
||||
bpl signal_nonyb
|
||||
|
|
@ -134,7 +131,6 @@ amark2: tstb %a2@
|
|||
moveb %a5@, %a4@(o_sector)
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
amark3: tstb %a2@
|
||||
dbmi %d2, amark3
|
||||
bpl signal_nonyb
|
||||
|
|
@ -142,7 +138,6 @@ amark3: tstb %a2@
|
|||
moveb %a5@, %a4@(o_size)
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
crc0: tstb %a2@
|
||||
dbmi %d2, crc0
|
||||
bpl signal_nonyb
|
||||
|
|
@ -150,7 +145,6 @@ crc0: tstb %a2@
|
|||
moveb %a5@, %a4@(o_crc0)
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
crc1: tstb %a2@
|
||||
dbmi %d2, crc1
|
||||
bpl signal_nonyb
|
||||
|
|
@ -197,13 +191,14 @@ mfm_read_data:
|
|||
|
||||
/* read data */
|
||||
|
||||
movel #sector_size-1, %d4 /* sector size */
|
||||
movel #sector_size - 1, %d4 /* sector size */
|
||||
movew #max_retry, %d2
|
||||
read_data_loop:
|
||||
moveb %a2@, %d5
|
||||
andb #(.Lhr_fifo_1byte + .Lhr_fifo_2bytes), %d5
|
||||
dbne %d2, read_data_loop
|
||||
beq data_exit
|
||||
|
||||
moveq #max_retry, %d2
|
||||
moveb %a5@, %d3
|
||||
bsr .Lmaybe_store
|
||||
|
|
@ -219,7 +214,6 @@ read_data_loop:
|
|||
|
||||
movew #max_retry, %d2
|
||||
data_crc0:
|
||||
|
||||
tstb %a2@
|
||||
dbmi %d2, data_crc0
|
||||
bpl data_exit
|
||||
|
|
@ -227,9 +221,7 @@ data_crc0:
|
|||
moveb %a5@, %d5
|
||||
|
||||
moveq #max_retry, %d2
|
||||
|
||||
data_crc1:
|
||||
|
||||
tstb %a2@
|
||||
dbmi %d2, data_crc1
|
||||
bpl data_exit
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user