lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230307224627.28011-19-linux@zary.sk>
Date:   Tue,  7 Mar 2023 23:46:13 +0100
From:   Ondrej Zary <linux@...y.sk>
To:     Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
        Sudip Mukherjee <sudipm.mukherjee@...il.com>
Cc:     Christoph Hellwig <hch@....de>,
        Sergey Shtylyov <s.shtylyov@....ru>,
        Jens Axboe <axboe@...nel.dk>, Tim Waugh <tim@...erelk.net>,
        linux-block@...r.kernel.org, linux-parport@...ts.infradead.org,
        linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 18/32] pata_parport-bpck6: merge ppc6_rd_port16_blk into bpck6_read_block

ppc6_rd_port16_blk is only called by bpck6_read_block. Merge
ppc6_rd_port16_blk into bpck6_read_block.

Signed-off-by: Ondrej Zary <linux@...y.sk>
---
 drivers/ata/pata_parport/bpck6.c   | 10 +++++++++-
 drivers/ata/pata_parport/ppc6lnx.c | 21 ---------------------
 2 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c
index 8e0094e3b02b..aaf6737891a5 100644
--- a/drivers/ata/pata_parport/bpck6.c
+++ b/drivers/ata/pata_parport/bpck6.c
@@ -42,7 +42,15 @@ static void bpck6_write_block(struct pi_adapter *pi, char *buf, int len)
 
 static void bpck6_read_block(struct pi_adapter *pi, char *buf, int len)
 {
-	ppc6_rd_port16_blk(pi, ATA_REG_DATA, buf, (u32)len>>1);
+	ppc6_send_cmd(pi, REG_BLKSIZE | ACCESS_REG | ACCESS_WRITE);
+	ppc6_wr_data_byte(pi, (u8)len);
+	ppc6_wr_data_byte(pi, (u8)(len >> 8));
+	ppc6_wr_data_byte(pi, 0);
+
+	ppc6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_IO16 | PREFIX_BLK);
+	ppc6_send_cmd(pi, ATA_REG_DATA | ACCESS_PORT | ACCESS_READ);
+	ppc6_rd_data_blk(pi, buf, len);
+	ppc6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_IO16 | PREFIX_BLK);
 }
 
 static void bpck6_connect(struct pi_adapter *pi)
diff --git a/drivers/ata/pata_parport/ppc6lnx.c b/drivers/ata/pata_parport/ppc6lnx.c
index 35427742e4d3..ac336ce1695b 100644
--- a/drivers/ata/pata_parport/ppc6lnx.c
+++ b/drivers/ata/pata_parport/ppc6lnx.c
@@ -75,7 +75,6 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi);
 static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count);
 static void ppc6_wait_for_fifo(struct pi_adapter *pi);
 static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count);
-static void ppc6_rd_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length);
 static void ppc6_wr_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length);
 static void ppc6_wr_extout(struct pi_adapter *pi, u8 regdata);
 static int ppc6_open(struct pi_adapter *pi);
@@ -479,26 +478,6 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count)
 
 //***************************************************************************
 
-static void ppc6_rd_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length)
-{
-	length = length << 1;
-
-	ppc6_send_cmd(pi, REG_BLKSIZE | ACCESS_REG | ACCESS_WRITE);
-	ppc6_wr_data_byte(pi, (u8)length);
-	ppc6_wr_data_byte(pi, (u8)(length >> 8));
-	ppc6_wr_data_byte(pi, 0);
-
-	ppc6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_IO16 | PREFIX_BLK);
-
-	ppc6_send_cmd(pi, port | ACCESS_PORT | ACCESS_READ);
-
-	ppc6_rd_data_blk(pi, data, length);
-
-	ppc6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_IO16 | PREFIX_BLK);
-}
-
-//***************************************************************************
-
 static void ppc6_wr_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length)
 {
 	length = length << 1;
-- 
Ondrej Zary

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ