From nobody Mon Jun 22 13:26:33 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16A5DC433F5 for ; Wed, 23 Mar 2022 21:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344942AbiCWVbn (ORCPT ); Wed, 23 Mar 2022 17:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240867AbiCWVbh (ORCPT ); Wed, 23 Mar 2022 17:31:37 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6154D36B57; Wed, 23 Mar 2022 14:30:06 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C3F325C029B; Wed, 23 Mar 2022 17:30:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 23 Mar 2022 17:30:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:date:date:from:from:in-reply-to :message-id:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Eg8kCh 35bVgzNqBT37lXPEWFs7WWvLSoJufdqAzozYM=; b=KjC61Z+8+N3rkj2QhOZM80 IDj/Y70UJ5x8pQTF+iUZyVBMLRHE0l8774w8w3nsSrMr5hp5NtF5SWt5uyImugYO 5U7ObGwGxqiOAHIjaIcyi9SYy5vhLEHKRKvNxXfwoH1P73zRXbOJnl3vqEe0uBj5 ek8vUv7iDqY/x6k7Bv3VKa96YUEwnEeS6z+8AnTLSFHYNTFf2bZMNBIamjZGWAvS 4u9loPsb18F0LAgWp4TlzKBZmGSP+yHKsD5pd02hrnYTYcabO635Y4CGs9EH+OZ5 c/QCs3KDM2mdQ8FnoQwIDkN94kQdz+cGerjqliVV8Tk516Z1Ia4xPMUlBf9OHUSw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegjedgudeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefvkffhufffsedttdertddttddtnecuhfhrohhmpefhihhnnhcuvfhhrghi nhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrghtthgvrh hnpedtleetkeelkeekvdeujeehkefgvddtheehhfetieethfetfeeghfduheevveelleen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfthhhrg hinheslhhinhhugidqmheikehkrdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Mar 2022 17:30:02 -0400 (EDT) To: "Juergen E. Fischer" , "James E.J. Bottomley" , "Martin K. Petersen" Cc: "Christoph Hellwig" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: From: Finn Thain Subject: [PATCH] aha152x: Stop using struct scsi_pointer Date: Thu, 24 Mar 2022 08:29:37 +1100 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove aha152x_cmd_priv.scsi_pointer by moving the necessary members into aha152x_cmd_priv proper. Tested with an Adaptec SlimSCSI APA-1460A card. Cc: Christoph Hellwig Suggested-by: Christoph Hellwig Signed-off-by: Finn Thain Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/scsi/aha152x.c | 235 ++++++++++++++++++++--------------------- 1 file changed, 113 insertions(+), 122 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 5f554a3a0f62..35cd04f7be5c 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -317,14 +317,18 @@ enum { }; =20 struct aha152x_cmd_priv { - struct scsi_pointer scsi_pointer; + char *ptr; + int this_residual; + struct scatterlist *buffer; + int status; + int message; + int sent_command; + int phase; }; =20 -static struct scsi_pointer *aha152x_scsi_pointer(struct scsi_cmnd *cmd) +static struct aha152x_cmd_priv *aha152x_priv(struct scsi_cmnd *cmd) { - struct aha152x_cmd_priv *acmd =3D scsi_cmd_priv(cmd); - - return &acmd->scsi_pointer; + return scsi_cmd_priv(cmd); } =20 MODULE_AUTHOR("J\ufffd\ufffdrgen Fischer"); @@ -890,17 +894,16 @@ void aha152x_release(struct Scsi_Host *shpnt) static int setup_expected_interrupts(struct Scsi_Host *shpnt) { if(CURRENT_SC) { - struct scsi_pointer *scsi_pointer =3D - aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 - scsi_pointer->phase |=3D 1 << 16; + acp->phase |=3D 1 << 16; =20 - if (scsi_pointer->phase & selecting) { + if (acp->phase & selecting) { SETPORT(SSTAT1, SELTO); SETPORT(SIMODE0, ENSELDO | (DISCONNECTED_SC ? ENSELDI : 0)); SETPORT(SIMODE1, ENSELTIMO); } else { - SETPORT(SIMODE0, (scsi_pointer->phase & spiordy) ? ENSPIORDY : 0); + SETPORT(SIMODE0, (acp->phase & spiordy) ? ENSPIORDY : 0); SETPORT(SIMODE1, ENPHASEMIS | ENSCSIRST | ENSCSIPERR | ENBUSFREE); } } else if(STATE=3D=3Dseldi) { @@ -924,17 +927,16 @@ static int setup_expected_interrupts(struct Scsi_Host= *shpnt) static int aha152x_internal_queue(struct scsi_cmnd *SCpnt, struct completion *complete, int phase) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(SCpnt); + struct aha152x_cmd_priv *acp =3D aha152x_priv(SCpnt); struct Scsi_Host *shpnt =3D SCpnt->device->host; unsigned long flags; =20 - scsi_pointer->phase =3D not_issued | phase; - scsi_pointer->Status =3D 0x1; /* Ilegal status by SCSI standard */ - scsi_pointer->Message =3D 0; - scsi_pointer->have_data_in =3D 0; - scsi_pointer->sent_command =3D 0; + acp->phase =3D not_issued | phase; + acp->status =3D 0x1; /* Ilegal status by SCSI standard */ + acp->message =3D 0; + acp->sent_command =3D 0; =20 - if (scsi_pointer->phase & (resetting | check_condition)) { + if (acp->phase & (resetting | check_condition)) { if (!SCpnt->host_scribble || SCSEM(SCpnt) || SCNEXT(SCpnt)) { scmd_printk(KERN_ERR, SCpnt, "cannot reuse command\n"); return FAILED; @@ -957,15 +959,15 @@ static int aha152x_internal_queue(struct scsi_cmnd *S= Cpnt, SCp.phase : current state of the command */ =20 if ((phase & resetting) || !scsi_sglist(SCpnt)) { - scsi_pointer->ptr =3D NULL; - scsi_pointer->this_residual =3D 0; + acp->ptr =3D NULL; + acp->this_residual =3D 0; scsi_set_resid(SCpnt, 0); - scsi_pointer->buffer =3D NULL; + acp->buffer =3D NULL; } else { scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); - scsi_pointer->buffer =3D scsi_sglist(SCpnt); - scsi_pointer->ptr =3D SG_ADDRESS(scsi_pointer->buffer); - scsi_pointer->this_residual =3D scsi_pointer->buffer->length; + acp->buffer =3D scsi_sglist(SCpnt); + acp->ptr =3D SG_ADDRESS(acp->buffer); + acp->this_residual =3D acp->buffer->length; } =20 DO_LOCK(flags); @@ -1015,7 +1017,7 @@ static void reset_done(struct scsi_cmnd *SCpnt) =20 static void aha152x_scsi_done(struct scsi_cmnd *SCpnt) { - if (aha152x_scsi_pointer(SCpnt)->phase & resetting) + if (aha152x_priv(SCpnt)->phase & resetting) reset_done(SCpnt); else scsi_done(SCpnt); @@ -1101,7 +1103,7 @@ static int aha152x_device_reset(struct scsi_cmnd * SC= pnt) =20 DO_LOCK(flags); =20 - if (aha152x_scsi_pointer(SCpnt)->phase & resetted) { + if (aha152x_priv(SCpnt)->phase & resetted) { HOSTDATA(shpnt)->commands--; if (!HOSTDATA(shpnt)->commands) SETPORT(PORTA, 0); @@ -1395,31 +1397,30 @@ static void busfree_run(struct Scsi_Host *shpnt) SETPORT(SSTAT1, CLRBUSFREE); =20 if(CURRENT_SC) { - struct scsi_pointer *scsi_pointer =3D - aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 #if defined(AHA152X_STAT) action++; #endif - scsi_pointer->phase &=3D ~syncneg; + acp->phase &=3D ~syncneg; =20 - if (scsi_pointer->phase & completed) { + if (acp->phase & completed) { /* target sent COMMAND COMPLETE */ - done(shpnt, scsi_pointer->Status, DID_OK); + done(shpnt, acp->status, DID_OK); =20 - } else if (scsi_pointer->phase & aborted) { - done(shpnt, scsi_pointer->Status, DID_ABORT); + } else if (acp->phase & aborted) { + done(shpnt, acp->status, DID_ABORT); =20 - } else if (scsi_pointer->phase & resetted) { - done(shpnt, scsi_pointer->Status, DID_RESET); + } else if (acp->phase & resetted) { + done(shpnt, acp->status, DID_RESET); =20 - } else if (scsi_pointer->phase & disconnected) { + } else if (acp->phase & disconnected) { /* target sent DISCONNECT */ #if defined(AHA152X_STAT) HOSTDATA(shpnt)->disconnections++; #endif append_SC(&DISCONNECTED_SC, CURRENT_SC); - scsi_pointer->phase |=3D 1 << 16; + acp->phase |=3D 1 << 16; CURRENT_SC =3D NULL; =20 } else { @@ -1438,24 +1439,23 @@ static void busfree_run(struct Scsi_Host *shpnt) action++; #endif =20 - if (aha152x_scsi_pointer(DONE_SC)->phase & check_condition) { + if (aha152x_priv(DONE_SC)->phase & check_condition) { struct scsi_cmnd *cmd =3D HOSTDATA(shpnt)->done_SC; struct aha152x_scdata *sc =3D SCDATA(cmd); =20 scsi_eh_restore_cmnd(cmd, &sc->ses); =20 - aha152x_scsi_pointer(cmd)->Status =3D SAM_STAT_CHECK_CONDITION; + aha152x_priv(cmd)->status =3D SAM_STAT_CHECK_CONDITION; =20 HOSTDATA(shpnt)->commands--; if (!HOSTDATA(shpnt)->commands) SETPORT(PORTA, 0); /* turn led off */ - } else if (aha152x_scsi_pointer(DONE_SC)->Status =3D=3D - SAM_STAT_CHECK_CONDITION) { + } else if (aha152x_priv(DONE_SC)->status =3D=3D SAM_STAT_CHECK_CONDITION= ) { #if defined(AHA152X_STAT) HOSTDATA(shpnt)->busfree_with_check_condition++; #endif =20 - if(!(aha152x_scsi_pointer(DONE_SC)->phase & not_issued)) { + if (!(aha152x_priv(DONE_SC)->phase & not_issued)) { struct aha152x_scdata *sc; struct scsi_cmnd *ptr =3D DONE_SC; DONE_SC=3DNULL; @@ -1480,7 +1480,7 @@ static void busfree_run(struct Scsi_Host *shpnt) if (!HOSTDATA(shpnt)->commands) SETPORT(PORTA, 0); /* turn led off */ =20 - if (!(aha152x_scsi_pointer(ptr)->phase & resetting)) { + if (!(aha152x_priv(ptr)->phase & resetting)) { kfree(ptr->host_scribble); ptr->host_scribble=3DNULL; } @@ -1503,13 +1503,12 @@ static void busfree_run(struct Scsi_Host *shpnt) DO_UNLOCK(flags); =20 if(CURRENT_SC) { - struct scsi_pointer *scsi_pointer =3D - aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 #if defined(AHA152X_STAT) action++; #endif - scsi_pointer->phase |=3D selecting; + acp->phase |=3D selecting; =20 /* clear selection timeout */ SETPORT(SSTAT1, SELTO); @@ -1537,13 +1536,13 @@ static void busfree_run(struct Scsi_Host *shpnt) */ static void seldo_run(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 SETPORT(SCSISIG, 0); SETPORT(SSTAT1, CLRBUSFREE); SETPORT(SSTAT1, CLRPHASECHG); =20 - scsi_pointer->phase &=3D ~(selecting | not_issued); + acp->phase &=3D ~(selecting | not_issued); =20 SETPORT(SCSISEQ, 0); =20 @@ -1558,12 +1557,12 @@ static void seldo_run(struct Scsi_Host *shpnt) =20 ADDMSGO(IDENTIFY(RECONNECT, CURRENT_SC->device->lun)); =20 - if (scsi_pointer->phase & aborting) { + if (acp->phase & aborting) { ADDMSGO(ABORT); - } else if (scsi_pointer->phase & resetting) { + } else if (acp->phase & resetting) { ADDMSGO(BUS_DEVICE_RESET); } else if (SYNCNEG=3D=3D0 && SYNCHRONOUS) { - scsi_pointer->phase |=3D syncneg; + acp->phase |=3D syncneg; MSGOLEN +=3D spi_populate_sync_msg(&MSGO(MSGOLEN), 50, 8); SYNCNEG=3D1; /* negotiation in progress */ } @@ -1578,7 +1577,7 @@ static void seldo_run(struct Scsi_Host *shpnt) */ static void selto_run(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp; =20 SETPORT(SCSISEQ, 0); SETPORT(SSTAT1, CLRSELTIMO); @@ -1586,9 +1585,10 @@ static void selto_run(struct Scsi_Host *shpnt) if (!CURRENT_SC) return; =20 - scsi_pointer->phase &=3D ~selecting; + acp =3D aha152x_priv(CURRENT_SC); + acp->phase &=3D ~selecting; =20 - if (scsi_pointer->phase & aborted) + if (acp->phase & aborted) done(shpnt, SAM_STAT_GOOD, DID_ABORT); else if (TESTLO(SSTAT0, SELINGO)) done(shpnt, SAM_STAT_GOOD, DID_BUS_BUSY); @@ -1616,10 +1616,9 @@ static void seldi_run(struct Scsi_Host *shpnt) SETPORT(SSTAT1, CLRPHASECHG); =20 if(CURRENT_SC) { - struct scsi_pointer *scsi_pointer =3D - aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 - if (!(scsi_pointer->phase & not_issued)) + if (!(acp->phase & not_issued)) scmd_printk(KERN_ERR, CURRENT_SC, "command should not have been issued yet\n"); =20 @@ -1676,7 +1675,7 @@ static void seldi_run(struct Scsi_Host *shpnt) static void msgi_run(struct Scsi_Host *shpnt) { for(;;) { - struct scsi_pointer *scsi_pointer; + struct aha152x_cmd_priv *acp; int sstat1 =3D GETPORT(SSTAT1); =20 if(sstat1 & (PHASECHG|PHASEMIS|BUSFREE) || !(sstat1 & REQINIT)) @@ -1714,9 +1713,9 @@ static void msgi_run(struct Scsi_Host *shpnt) continue; } =20 - scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); - scsi_pointer->Message =3D MSGI(0); - scsi_pointer->phase &=3D ~disconnected; + acp =3D aha152x_priv(CURRENT_SC); + acp->message =3D MSGI(0); + acp->phase &=3D ~disconnected; =20 MSGILEN=3D0; =20 @@ -1724,8 +1723,8 @@ static void msgi_run(struct Scsi_Host *shpnt) continue; } =20 - scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); - scsi_pointer->Message =3D MSGI(0); + acp =3D aha152x_priv(CURRENT_SC); + acp->message =3D MSGI(0); =20 switch (MSGI(0)) { case DISCONNECT: @@ -1733,11 +1732,11 @@ static void msgi_run(struct Scsi_Host *shpnt) scmd_printk(KERN_WARNING, CURRENT_SC, "target was not allowed to disconnect\n"); =20 - scsi_pointer->phase |=3D disconnected; + acp->phase |=3D disconnected; break; =20 case COMMAND_COMPLETE: - scsi_pointer->phase |=3D completed; + acp->phase |=3D completed; break; =20 case MESSAGE_REJECT: @@ -1867,11 +1866,9 @@ static void msgi_end(struct Scsi_Host *shpnt) */ static void msgo_init(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); - if(MSGOLEN=3D=3D0) { - if ((scsi_pointer->phase & syncneg) && SYNCNEG=3D=3D2 && - SYNCRATE=3D=3D0) { + if ((aha152x_priv(CURRENT_SC)->phase & syncneg) && + SYNCNEG =3D=3D 2 && SYNCRATE =3D=3D 0) { ADDMSGO(IDENTIFY(RECONNECT, CURRENT_SC->device->lun)); } else { scmd_printk(KERN_INFO, CURRENT_SC, @@ -1888,7 +1885,7 @@ static void msgo_init(struct Scsi_Host *shpnt) */ static void msgo_run(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 while(MSGO_Iphase |=3D identified; + acp->phase |=3D identified; =20 if (MSGO(MSGO_I)=3D=3DABORT) - scsi_pointer->phase |=3D aborted; + acp->phase |=3D aborted; =20 if (MSGO(MSGO_I)=3D=3DBUS_DEVICE_RESET) - scsi_pointer->phase |=3D resetted; + acp->phase |=3D resetted; =20 SETPORT(SCSIDAT, MSGO(MSGO_I++)); } @@ -1936,7 +1933,7 @@ static void msgo_end(struct Scsi_Host *shpnt) */ static void cmd_init(struct Scsi_Host *shpnt) { - if (aha152x_scsi_pointer(CURRENT_SC)->sent_command) { + if (aha152x_priv(CURRENT_SC)->sent_command) { scmd_printk(KERN_ERR, CURRENT_SC, "command already sent\n"); done(shpnt, SAM_STAT_GOOD, DID_ERROR); @@ -1967,7 +1964,7 @@ static void cmd_end(struct Scsi_Host *shpnt) "command sent incompletely (%d/%d)\n", CMD_I, CURRENT_SC->cmd_len); else - aha152x_scsi_pointer(CURRENT_SC)->sent_command++; + aha152x_priv(CURRENT_SC)->sent_command++; } =20 /* @@ -1979,7 +1976,7 @@ static void status_run(struct Scsi_Host *shpnt) if (TESTLO(SSTAT0, SPIORDY)) return; =20 - aha152x_scsi_pointer(CURRENT_SC)->Status =3D GETPORT(SCSIDAT); + aha152x_priv(CURRENT_SC)->status =3D GETPORT(SCSIDAT); =20 } =20 @@ -2003,7 +2000,7 @@ static void datai_init(struct Scsi_Host *shpnt) =20 static void datai_run(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer; + struct aha152x_cmd_priv *acp; unsigned long the_time; int fifodata, data_count; =20 @@ -2041,36 +2038,35 @@ static void datai_run(struct Scsi_Host *shpnt) fifodata =3D GETPORT(FIFOSTAT); } =20 - scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); - if (scsi_pointer->this_residual > 0) { - while (fifodata > 0 && scsi_pointer->this_residual > 0) { - data_count =3D fifodata > scsi_pointer->this_residual ? - scsi_pointer->this_residual : - fifodata; + acp =3D aha152x_priv(CURRENT_SC); + if (acp->this_residual > 0) { + while (fifodata > 0 && acp->this_residual > 0) { + data_count =3D fifodata > acp->this_residual ? + acp->this_residual : fifodata; fifodata -=3D data_count; =20 if (data_count & 1) { SETPORT(DMACNTRL0, ENDMA|_8BIT); - *scsi_pointer->ptr++ =3D GETPORT(DATAPORT); - scsi_pointer->this_residual--; + *acp->ptr++ =3D GETPORT(DATAPORT); + acp->this_residual--; DATA_LEN++; SETPORT(DMACNTRL0, ENDMA); } =20 if (data_count > 1) { data_count >>=3D 1; - insw(DATAPORT, scsi_pointer->ptr, data_count); - scsi_pointer->ptr +=3D 2 * data_count; - scsi_pointer->this_residual -=3D 2 * data_count; + insw(DATAPORT, acp->ptr, data_count); + acp->ptr +=3D 2 * data_count; + acp->this_residual -=3D 2 * data_count; DATA_LEN +=3D 2 * data_count; } =20 - if (scsi_pointer->this_residual =3D=3D 0 && - !sg_is_last(scsi_pointer->buffer)) { + if (acp->this_residual =3D=3D 0 && + !sg_is_last(acp->buffer)) { /* advance to next buffer */ - scsi_pointer->buffer =3D sg_next(scsi_pointer->buffer); - scsi_pointer->ptr =3D SG_ADDRESS(scsi_pointer->buffer); - scsi_pointer->this_residual =3D scsi_pointer->buffer->length; + acp->buffer =3D sg_next(acp->buffer); + acp->ptr =3D SG_ADDRESS(acp->buffer); + acp->this_residual =3D acp->buffer->length; } } } else if (fifodata > 0) { @@ -2138,15 +2134,15 @@ static void datao_init(struct Scsi_Host *shpnt) =20 static void datao_run(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); unsigned long the_time; int data_count; =20 /* until phase changes or all data sent */ - while (TESTLO(DMASTAT, INTSTAT) && scsi_pointer->this_residual > 0) { + while (TESTLO(DMASTAT, INTSTAT) && acp->this_residual > 0) { data_count =3D 128; - if (data_count > scsi_pointer->this_residual) - data_count =3D scsi_pointer->this_residual; + if (data_count > acp->this_residual) + data_count =3D acp->this_residual; =20 if(TESTLO(DMASTAT, DFIFOEMP)) { scmd_printk(KERN_ERR, CURRENT_SC, @@ -2157,26 +2153,25 @@ static void datao_run(struct Scsi_Host *shpnt) =20 if(data_count & 1) { SETPORT(DMACNTRL0,WRITE_READ|ENDMA|_8BIT); - SETPORT(DATAPORT, *scsi_pointer->ptr++); - scsi_pointer->this_residual--; + SETPORT(DATAPORT, *acp->ptr++); + acp->this_residual--; CMD_INC_RESID(CURRENT_SC, -1); SETPORT(DMACNTRL0,WRITE_READ|ENDMA); } =20 if(data_count > 1) { data_count >>=3D 1; - outsw(DATAPORT, scsi_pointer->ptr, data_count); - scsi_pointer->ptr +=3D 2 * data_count; - scsi_pointer->this_residual -=3D 2 * data_count; + outsw(DATAPORT, acp->ptr, data_count); + acp->ptr +=3D 2 * data_count; + acp->this_residual -=3D 2 * data_count; CMD_INC_RESID(CURRENT_SC, -2 * data_count); } =20 - if (scsi_pointer->this_residual =3D=3D 0 && - !sg_is_last(scsi_pointer->buffer)) { + if (acp->this_residual =3D=3D 0 && !sg_is_last(acp->buffer)) { /* advance to next buffer */ - scsi_pointer->buffer =3D sg_next(scsi_pointer->buffer); - scsi_pointer->ptr =3D SG_ADDRESS(scsi_pointer->buffer); - scsi_pointer->this_residual =3D scsi_pointer->buffer->length; + acp->buffer =3D sg_next(acp->buffer); + acp->ptr =3D SG_ADDRESS(acp->buffer); + acp->this_residual =3D acp->buffer->length; } =20 the_time=3Djiffies + 100*HZ; @@ -2192,7 +2187,7 @@ static void datao_run(struct Scsi_Host *shpnt) =20 static void datao_end(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); + struct aha152x_cmd_priv *acp =3D aha152x_priv(CURRENT_SC); =20 if(TESTLO(DMASTAT, DFIFOEMP)) { u32 datao_cnt =3D GETSTCNT(); @@ -2211,10 +2206,9 @@ static void datao_end(struct Scsi_Host *shpnt) sg =3D sg_next(sg); } =20 - scsi_pointer->buffer =3D sg; - scsi_pointer->ptr =3D SG_ADDRESS(scsi_pointer->buffer) + done; - scsi_pointer->this_residual =3D scsi_pointer->buffer->length - - done; + acp->buffer =3D sg; + acp->ptr =3D SG_ADDRESS(acp->buffer) + done; + acp->this_residual =3D acp->buffer->length - done; } =20 SETPORT(SXFRCTL0, CH1|CLRCH1|CLRSTCNT); @@ -2229,7 +2223,6 @@ static void datao_end(struct Scsi_Host *shpnt) */ static int update_state(struct Scsi_Host *shpnt) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(CURRENT_SC); int dataphase=3D0; unsigned int stat0 =3D GETPORT(SSTAT0); unsigned int stat1 =3D GETPORT(SSTAT1); @@ -2244,7 +2237,7 @@ static int update_state(struct Scsi_Host *shpnt) } else if (stat0 & SELDI && PREVSTATE =3D=3D busfree) { STATE=3Dseldi; } else if (stat0 & SELDO && CURRENT_SC && - (scsi_pointer->phase & selecting)) { + (aha152x_priv(CURRENT_SC)->phase & selecting)) { STATE=3Dseldo; } else if(stat1 & SELTO) { STATE=3Dselto; @@ -2376,8 +2369,7 @@ static void is_complete(struct Scsi_Host *shpnt) SETPORT(SXFRCTL0, CH1); SETPORT(DMACNTRL0, 0); if(CURRENT_SC) - aha152x_scsi_pointer(CURRENT_SC)->phase &=3D - ~spiordy; + aha152x_priv(CURRENT_SC)->phase &=3D ~spiordy; } =20 /* @@ -2399,8 +2391,7 @@ static void is_complete(struct Scsi_Host *shpnt) SETPORT(DMACNTRL0, 0); SETPORT(SXFRCTL0, CH1|SPIOEN); if(CURRENT_SC) - aha152x_scsi_pointer(CURRENT_SC)->phase |=3D - spiordy; + aha152x_priv(CURRENT_SC)->phase |=3D spiordy; } =20 /* @@ -2490,7 +2481,7 @@ static void disp_enintr(struct Scsi_Host *shpnt) */ static void show_command(struct scsi_cmnd *ptr) { - const int phase =3D aha152x_scsi_pointer(ptr)->phase; + const int phase =3D aha152x_priv(ptr)->phase; =20 scsi_print_command(ptr); scmd_printk(KERN_DEBUG, ptr, @@ -2538,8 +2529,8 @@ static void show_queues(struct Scsi_Host *shpnt) =20 static void get_command(struct seq_file *m, struct scsi_cmnd * ptr) { - struct scsi_pointer *scsi_pointer =3D aha152x_scsi_pointer(ptr); - const int phase =3D scsi_pointer->phase; + struct aha152x_cmd_priv *acp =3D aha152x_priv(ptr); + const int phase =3D acp->phase; int i; =20 seq_printf(m, "%p: target=3D%d; lun=3D%d; cmnd=3D( ", @@ -2549,8 +2540,8 @@ static void get_command(struct seq_file *m, struct sc= si_cmnd * ptr) seq_printf(m, "0x%02x ", ptr->cmnd[i]); =20 seq_printf(m, "); resid=3D%d; residual=3D%d; buffers=3D%d; phase |", - scsi_get_resid(ptr), scsi_pointer->this_residual, - sg_nents(scsi_pointer->buffer) - 1); + scsi_get_resid(ptr), acp->this_residual, + sg_nents(acp->buffer) - 1); =20 if (phase & not_issued) seq_puts(m, "not issued|"); --=20 2.32.0