From patchwork Tue Mar 7 22:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 65944 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp10059wrd; Tue, 7 Mar 2023 15:03:04 -0800 (PST) X-Google-Smtp-Source: AK7set88jTLVpTIMYKbNSqcnRK2XOCWvCDlQwjeQPr9NALVYRYFdvo8o1LUNM/DNMMKvx/48Nq2+ X-Received: by 2002:aa7:d683:0:b0:4af:75fd:8214 with SMTP id d3-20020aa7d683000000b004af75fd8214mr12606545edr.38.1678230184499; Tue, 07 Mar 2023 15:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678230184; cv=none; d=google.com; s=arc-20160816; b=ah5n+obLzVlg2rA1U1MsI1cPDHOIUJfUTm4o0h4tHXgdz3gBnGlVlJ6h4zRuQvLG+A QDawC++/MU/tYjgBO6nVCjA6YGRKK36bxIKLCAex22iQAWqWV3t9s+NwnOwpJ8+79tmM JbWFi+rZKmcn6ifLFBO1d36s0F11QVakG3D60ngjsXGT7+SNEHRFAnaZacoUSYocy7WA z/bRnTbHUoDQDUWRpdCdnfVta3ykQ+rNEYraBWixNVtiOaw2rbXiw2HVH97DLGNPMFen e1jBLKyin63PViQ0fSuIrjfCebtOjLa31rU9QFsTn5BWe6ZY8uWQJhfwIRP+ZeGKVSYv Hw/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LqD/j2TxIJQHb+0JuJCnwFMmHzxIUclLpn4lkbjUiu0=; b=piIVSFAVmS6s1ODaRyFQ5x+vfOLFV3x0f3wAP90evuN7MtR0JhXl8arD4SdPrK4h5s 8lY9NMYQ6CjSzoNsKMBp2sE3wK4ekmY4iOVP33bmAVTW8Hp9bWSuHjWswmS0s9V+N5cQ XC0svZD/iiCANAp5h+2IH4r15t6pimFSXWIFbQJBHRCYfkEQp3jNnFR+4TjpyW6thKmh D8lX/j7ftWOTOntADAelz/hs97/4MybjmeiwtwfIyasHJ0potQwltGqceG6zLaDOokQo vrKNaJdyyF48+cb3DEidhiuqur4UWzg5OLFt2mOVnw2WlEO0ODPInb1F07ymWNa8wsqv pkZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020aa7d484000000b004acc575090fsi3925307edr.36.2023.03.07.15.02.40; Tue, 07 Mar 2023 15:03:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbjCGWr5 (ORCPT + 99 others); Tue, 7 Mar 2023 17:47:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbjCGWrH (ORCPT ); Tue, 7 Mar 2023 17:47:07 -0500 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4D9E84EE4; Tue, 7 Mar 2023 14:47:00 -0800 (PST) Received: from gsql.ggedos.sk (off-20.infotel.telecom.sk [212.5.213.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id 5F2977A05BD; Tue, 7 Mar 2023 23:46:48 +0100 (CET) From: Ondrej Zary To: Damien Le Moal , Sudip Mukherjee Cc: Christoph Hellwig , Sergey Shtylyov , Jens Axboe , Tim Waugh , linux-block@vger.kernel.org, linux-parport@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/32] pata_parport-bpck6: remove lpt_addr from struct ppc_storage Date: Tue, 7 Mar 2023 23:46:00 +0100 Message-Id: <20230307224627.28011-6-linux@zary.sk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230307224627.28011-1-linux@zary.sk> References: <20230307224627.28011-1-linux@zary.sk> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759751894096354846?= X-GMAIL-MSGID: =?utf-8?q?1759751894096354846?= lpt_addr duplicates pi->port. Remove it. Signed-off-by: Ondrej Zary Reviewed-by: Sergey Shtylyov --- drivers/ata/pata_parport/bpck6.c | 1 - drivers/ata/pata_parport/ppc6lnx.c | 153 ++++++++++++++--------------- 2 files changed, 76 insertions(+), 78 deletions(-) diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c index bc128a2c444e..50d313fc529e 100644 --- a/drivers/ata/pata_parport/bpck6.c +++ b/drivers/ata/pata_parport/bpck6.c @@ -78,7 +78,6 @@ static int bpck6_test_port(struct pi_adapter *pi) /* check for 8-bit port */ /*copy over duplicate stuff.. initialize state info*/ ppc->ppc_id = pi->unit; - ppc->lpt_addr = pi->port; /* look at the parport device to see what modes we can use */ if (pi->pardev->port->modes & PARPORT_MODE_EPP) diff --git a/drivers/ata/pata_parport/ppc6lnx.c b/drivers/ata/pata_parport/ppc6lnx.c index f12bb019fc61..c00e561cc833 100644 --- a/drivers/ata/pata_parport/ppc6lnx.c +++ b/drivers/ata/pata_parport/ppc6lnx.c @@ -65,7 +65,6 @@ //*************************************************************************** struct ppc_storage { - u16 lpt_addr; // LPT base address u8 ppc_id; u8 mode; // operating mode // 0 = PPC Uni SW @@ -124,65 +123,65 @@ static int ppc6_select(struct pi_adapter *pi) struct ppc_storage *ppc = (void *)(pi->private); u8 i, j, k; - i = inb(ppc->lpt_addr + 1); + i = inb(pi->port + 1); if (i & 1) - outb(i, ppc->lpt_addr + 1); + outb(i, pi->port + 1); - ppc->org_data = inb(ppc->lpt_addr); + ppc->org_data = inb(pi->port); - ppc->org_ctrl = inb(ppc->lpt_addr + 2) & 0x5F; // readback ctrl + ppc->org_ctrl = inb(pi->port + 2) & 0x5F; // readback ctrl ppc->cur_ctrl = ppc->org_ctrl; ppc->cur_ctrl |= port_sel; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); if (ppc->org_data == 'b') - outb('x', ppc->lpt_addr); + outb('x', pi->port); - outb('b', ppc->lpt_addr); - outb('p', ppc->lpt_addr); - outb(ppc->ppc_id, ppc->lpt_addr); - outb(~ppc->ppc_id,ppc->lpt_addr); + outb('b', pi->port); + outb('p', pi->port); + outb(ppc->ppc_id, pi->port); + outb(~ppc->ppc_id, pi->port); ppc->cur_ctrl &= ~port_sel; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); ppc->cur_ctrl = (ppc->cur_ctrl & port_int) | port_init; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); i = ppc->mode & 0x0C; if (i == 0) i = (ppc->mode & 2) | 1; - outb(i, ppc->lpt_addr); + outb(i, pi->port); ppc->cur_ctrl |= port_sel; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); // DELAY ppc->cur_ctrl |= port_afd; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); j = ((i & 0x08) << 4) | ((i & 0x07) << 3); - k = inb(ppc->lpt_addr + 1) & 0xB8; + k = inb(pi->port + 1) & 0xB8; if (j == k) { ppc->cur_ctrl &= ~port_afd; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); - k = (inb(ppc->lpt_addr + 1) & 0xB8) ^ 0xB8; + k = (inb(pi->port + 1) & 0xB8) ^ 0xB8; if (j == k) { @@ -191,15 +190,15 @@ static int ppc6_select(struct pi_adapter *pi) else // PPC/ECP ppc->cur_ctrl &= ~port_sel; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); return(1); } } - outb(ppc->org_ctrl, ppc->lpt_addr + 2); + outb(ppc->org_ctrl, pi->port + 2); - outb(ppc->org_data, ppc->lpt_addr); + outb(ppc->org_data, pi->port); return(0); // FAIL } @@ -214,13 +213,13 @@ static void ppc6_deselect(struct pi_adapter *pi) else // PPC/ECP ppc->cur_ctrl |= port_sel; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); - outb(ppc->org_data, ppc->lpt_addr); + outb(ppc->org_data, pi->port); - outb((ppc->org_ctrl | port_sel), ppc->lpt_addr + 2); + outb((ppc->org_ctrl | port_sel), pi->port + 2); - outb(ppc->org_ctrl, ppc->lpt_addr + 2); + outb(ppc->org_ctrl, pi->port + 2); } //*************************************************************************** @@ -235,11 +234,11 @@ static void ppc6_send_cmd(struct pi_adapter *pi, u8 cmd) case PPCMODE_BI_SW : case PPCMODE_BI_FW : { - outb(cmd, ppc->lpt_addr); + outb(cmd, pi->port); ppc->cur_ctrl ^= cmd_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } @@ -248,7 +247,7 @@ static void ppc6_send_cmd(struct pi_adapter *pi, u8 cmd) case PPCMODE_EPP_WORD : case PPCMODE_EPP_DWORD : { - outb(cmd, ppc->lpt_addr + 3); + outb(cmd, pi->port + 3); break; } @@ -267,11 +266,11 @@ static void ppc6_wr_data_byte(struct pi_adapter *pi, u8 data) case PPCMODE_BI_SW : case PPCMODE_BI_FW : { - outb(data, ppc->lpt_addr); + outb(data, pi->port); ppc->cur_ctrl ^= data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } @@ -280,7 +279,7 @@ static void ppc6_wr_data_byte(struct pi_adapter *pi, u8 data) case PPCMODE_EPP_WORD : case PPCMODE_EPP_DWORD : { - outb(data, ppc->lpt_addr + 4); + outb(data, pi->port + 4); break; } @@ -301,21 +300,21 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi) { ppc->cur_ctrl = (ppc->cur_ctrl & ~port_stb) ^ data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); // DELAY - data = inb(ppc->lpt_addr + 1); + data = inb(pi->port + 1); data = ((data & 0x80) >> 1) | ((data & 0x38) >> 3); ppc->cur_ctrl |= port_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); // DELAY - data |= inb(ppc->lpt_addr + 1) & 0xB8; + data |= inb(pi->port + 1) & 0xB8; break; } @@ -325,21 +324,21 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi) { ppc->cur_ctrl |= port_dir; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); ppc->cur_ctrl = (ppc->cur_ctrl | port_stb) ^ data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); - data = inb(ppc->lpt_addr); + data = inb(pi->port); ppc->cur_ctrl &= ~port_stb; - outb(ppc->cur_ctrl,ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); ppc->cur_ctrl &= ~port_dir; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } @@ -348,11 +347,11 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi) case PPCMODE_EPP_WORD : case PPCMODE_EPP_DWORD : { - outb((ppc->cur_ctrl | port_dir),ppc->lpt_addr + 2); + outb((ppc->cur_ctrl | port_dir), pi->port + 2); - data = inb(ppc->lpt_addr + 4); + data = inb(pi->port + 4); - outb(ppc->cur_ctrl,ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } @@ -395,21 +394,21 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) ppc->cur_ctrl = (ppc->cur_ctrl & ~port_stb) ^ data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); // DELAY - d = inb(ppc->lpt_addr + 1); + d = inb(pi->port + 1); d = ((d & 0x80) >> 1) | ((d & 0x38) >> 3); ppc->cur_ctrl |= port_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); // DELAY - d |= inb(ppc->lpt_addr + 1) & 0xB8; + d |= inb(pi->port + 1) & 0xB8; *data++ = d; count--; @@ -423,7 +422,7 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) { ppc->cur_ctrl |= port_dir; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); ppc->cur_ctrl |= port_stb; @@ -431,84 +430,84 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) { ppc->cur_ctrl ^= data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); - *data++ = inb(ppc->lpt_addr); + *data++ = inb(pi->port); count--; } ppc->cur_ctrl &= ~port_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); ppc->cur_ctrl &= ~port_dir; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } case PPCMODE_EPP_BYTE : { - outb((ppc->cur_ctrl | port_dir), ppc->lpt_addr + 2); + outb((ppc->cur_ctrl | port_dir), pi->port + 2); // DELAY while(count) { - *data++ = inb(ppc->lpt_addr + 4); + *data++ = inb(pi->port + 4); count--; } - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } case PPCMODE_EPP_WORD : { - outb((ppc->cur_ctrl | port_dir), ppc->lpt_addr + 2); + outb((ppc->cur_ctrl | port_dir), pi->port + 2); // DELAY while(count > 1) { - *((u16 *)data) = inw(ppc->lpt_addr + 4); + *((u16 *)data) = inw(pi->port + 4); data += 2; count -= 2; } while(count) { - *data++ = inb(ppc->lpt_addr + 4); + *data++ = inb(pi->port + 4); count--; } - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } case PPCMODE_EPP_DWORD : { - outb((ppc->cur_ctrl | port_dir),ppc->lpt_addr + 2); + outb((ppc->cur_ctrl | port_dir), pi->port + 2); // DELAY while(count > 3) { - *((u32 *)data) = inl(ppc->lpt_addr + 4); + *((u32 *)data) = inl(pi->port + 4); data += 4; count -= 4; } while(count) { - *data++ = inb(ppc->lpt_addr + 4); + *data++ = inb(pi->port + 4); count--; } - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); break; } @@ -526,7 +525,7 @@ static void ppc6_wait_for_fifo(struct pi_adapter *pi) if (ppc->ppc_flags & fifo_wait) { for(i=0; i<20; i++) - inb(ppc->lpt_addr + 1); + inb(pi->port + 1); } } @@ -542,11 +541,11 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) { while(count--) { - outb(*data++, ppc->lpt_addr); + outb(*data++, pi->port); ppc->cur_ctrl ^= data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); } break; @@ -561,11 +560,11 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) ppc->cur_ctrl |= port_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); last = *data; - outb(last, ppc->lpt_addr); + outb(last, pi->port); while(count) { @@ -576,11 +575,11 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) { ppc->cur_ctrl ^= data_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); } else { - outb(this, ppc->lpt_addr); + outb(this, pi->port); last = this; } @@ -588,7 +587,7 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) ppc->cur_ctrl &= ~port_stb; - outb(ppc->cur_ctrl, ppc->lpt_addr + 2); + outb(ppc->cur_ctrl, pi->port + 2); ppc6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_FASTWR); @@ -599,7 +598,7 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) { while(count) { - outb(*data++,ppc->lpt_addr + 4); + outb(*data++, pi->port + 4); count--; } @@ -612,14 +611,14 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) { while(count > 1) { - outw(*((u16 *)data),ppc->lpt_addr + 4); + outw(*((u16 *)data), pi->port + 4); data += 2; count -= 2; } while(count) { - outb(*data++,ppc->lpt_addr + 4); + outb(*data++, pi->port + 4); count--; } @@ -632,14 +631,14 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) { while(count > 3) { - outl(*((u32 *)data),ppc->lpt_addr + 4); + outl(*((u32 *)data), pi->port + 4); data += 4; count -= 4; } while(count) { - outb(*data++,ppc->lpt_addr + 4); + outb(*data++, pi->port + 4); count--; }