aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2018-04-11 20:50:14 -0400
committerJens Axboe <axboe@kernel.dk>2018-04-16 23:49:35 -0400
commit56a1c5ee54f69dd767fb61d301883dc919ddc259 (patch)
tree43a16181138097f465de8aee19a8cd31a5e92b54
parent8e2ab5a4efaac77fb93e5b5b109d0b3976fdd3a0 (diff)
block/swim: Rename macros to avoid inconsistent inverted logic
The Sony drive status bits use active-low logic. The swim_readbit() function converts that to 'C' logic for readability. Hence, the sense of the names of the status bit macros should not be inverted. Mostly they are correct. However, the TWOMEG_DRIVE, MFM_MODE and TWOMEG_MEDIA macros have inverted sense (like MkLinux). Fix this inconsistency and make the following patches less confusing. The same problem affects swim3.c so fix that too. No functional change. The FDHD drive status bits are documented in sonydriv.cpp from MAME and in swimiii.h from MkLinux. Cc: Laurent Vivier <lvivier@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: linuxppc-dev@lists.ozlabs.org Cc: Jens Axboe <axboe@kernel.dk> Cc: stable@vger.kernel.org # v4.14+ Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/swim.c8
-rw-r--r--drivers/block/swim3.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 7b847170cf71..d1ee4670666a 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -110,7 +110,7 @@ struct iwm {
110/* Select values for swim_select and swim_readbit */ 110/* Select values for swim_select and swim_readbit */
111 111
112#define READ_DATA_0 0x074 112#define READ_DATA_0 0x074
113#define TWOMEG_DRIVE 0x075 113#define ONEMEG_DRIVE 0x075
114#define SINGLE_SIDED 0x076 114#define SINGLE_SIDED 0x076
115#define DRIVE_PRESENT 0x077 115#define DRIVE_PRESENT 0x077
116#define DISK_IN 0x170 116#define DISK_IN 0x170
@@ -118,9 +118,9 @@ struct iwm {
118#define TRACK_ZERO 0x172 118#define TRACK_ZERO 0x172
119#define TACHO 0x173 119#define TACHO 0x173
120#define READ_DATA_1 0x174 120#define READ_DATA_1 0x174
121#define MFM_MODE 0x175 121#define GCR_MODE 0x175
122#define SEEK_COMPLETE 0x176 122#define SEEK_COMPLETE 0x176
123#define ONEMEG_MEDIA 0x177 123#define TWOMEG_MEDIA 0x177
124 124
125/* Bits in handshake register */ 125/* Bits in handshake register */
126 126
@@ -612,7 +612,7 @@ static void setup_medium(struct floppy_state *fs)
612 struct floppy_struct *g; 612 struct floppy_struct *g;
613 fs->disk_in = 1; 613 fs->disk_in = 1;
614 fs->write_protected = swim_readbit(base, WRITE_PROT); 614 fs->write_protected = swim_readbit(base, WRITE_PROT);
615 fs->type = swim_readbit(base, ONEMEG_MEDIA); 615 fs->type = swim_readbit(base, TWOMEG_MEDIA);
616 616
617 if (swim_track00(base)) 617 if (swim_track00(base))
618 printk(KERN_ERR 618 printk(KERN_ERR
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index af51015d056e..469541c1e51e 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -148,7 +148,7 @@ struct swim3 {
148#define MOTOR_ON 2 148#define MOTOR_ON 2
149#define RELAX 3 /* also eject in progress */ 149#define RELAX 3 /* also eject in progress */
150#define READ_DATA_0 4 150#define READ_DATA_0 4
151#define TWOMEG_DRIVE 5 151#define ONEMEG_DRIVE 5
152#define SINGLE_SIDED 6 /* drive or diskette is 4MB type? */ 152#define SINGLE_SIDED 6 /* drive or diskette is 4MB type? */
153#define DRIVE_PRESENT 7 153#define DRIVE_PRESENT 7
154#define DISK_IN 8 154#define DISK_IN 8
@@ -156,9 +156,9 @@ struct swim3 {
156#define TRACK_ZERO 10 156#define TRACK_ZERO 10
157#define TACHO 11 157#define TACHO 11
158#define READ_DATA_1 12 158#define READ_DATA_1 12
159#define MFM_MODE 13 159#define GCR_MODE 13
160#define SEEK_COMPLETE 14 160#define SEEK_COMPLETE 14
161#define ONEMEG_MEDIA 15 161#define TWOMEG_MEDIA 15
162 162
163/* Definitions of values used in writing and formatting */ 163/* Definitions of values used in writing and formatting */
164#define DATA_ESCAPE 0x99 164#define DATA_ESCAPE 0x99