diff options
author | Ondrej Zary <linux@zary.sk> | 2023-02-18 23:01:23 +0100 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2023-03-23 10:29:24 +0900 |
commit | e02c625de580a1bc8166c5f95f23a50fa59ee1bf (patch) | |
tree | f5922ac2d4319371c2d2c6c018b0e8bfd7b4c136 /drivers | |
parent | 4f747dc1af38fe0f9db9d49e76c303c42eef1dbe (diff) |
ata: pata_parport: Remove pi_swab16 and pi_swab32
Convert comm and kbic drivers to use standard swab16.
Remove pi_swab16 and pi_swab32.
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Ondrej Zary <linux@zary.sk>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/pata_parport/comm.c | 7 | ||||
-rw-r--r-- | drivers/ata/pata_parport/kbic.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/ata/pata_parport/comm.c b/drivers/ata/pata_parport/comm.c index 1775e7ed9336..11ed9fb57744 100644 --- a/drivers/ata/pata_parport/comm.c +++ b/drivers/ata/pata_parport/comm.c @@ -165,11 +165,14 @@ static void comm_write_block( PIA *pi, char * buf, int count ) break; case 3: w3(0x48); (void)r1(); - for (k=0;k<count/2;k++) w4w(pi_swab16(buf,k)); + for (k = 0; k < count / 2; k++) + w4w(swab16(((u16 *)buf)[k])); break; case 4: w3(0x48); (void)r1(); - for (k=0;k<count/4;k++) w4l(pi_swab32(buf,k)); + for (k = 0; k < count / 4; k++) + w4l(swab16(((u16 *)buf)[2 * k]) | + swab16(((u16 *)buf)[2 * k + 1]) << 16); break; diff --git a/drivers/ata/pata_parport/kbic.c b/drivers/ata/pata_parport/kbic.c index f0960eb68635..93430ca32a52 100644 --- a/drivers/ata/pata_parport/kbic.c +++ b/drivers/ata/pata_parport/kbic.c @@ -213,12 +213,15 @@ static void kbic_write_block( PIA *pi, char * buf, int count ) break; case 4: w0(0xa0); w2(4); w2(6); w2(4); w3(0); - for(k=0;k<count/2;k++) w4w(pi_swab16(buf,k)); + for (k = 0; k < count / 2; k++) + w4w(swab16(((u16 *)buf)[k])); w2(4); w2(0); w2(4); break; case 5: w0(0xa0); w2(4); w2(6); w2(4); w3(0); - for(k=0;k<count/4;k++) w4l(pi_swab32(buf,k)); + for (k = 0; k < count / 4; k++) + w4l(swab16(((u16 *)buf)[2 * k]) | + swab16(((u16 *)buf)[2 * k + 1]) << 16); w2(4); w2(0); w2(4); break; |