Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp997721pxb; Thu, 19 Nov 2020 20:55:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLeph07vpvv4pag77fMsD2fSJTcXu3kVYeM3mRDaUkvNEb8Abui1sP7QanKJd5smzvUVQA X-Received: by 2002:a17:906:8282:: with SMTP id h2mr32504535ejx.50.1605848130639; Thu, 19 Nov 2020 20:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605848130; cv=none; d=google.com; s=arc-20160816; b=jrxBK8WMK93tiYsraGIhP3vzD3zFopBjeNfkYOhcwjzzrSIQ/Ppm5PMgtPOpemguD8 oXps37EvEiSQsO9Z9rVwNlcRbRC/qt6jHMYM0O3uYf3orjWTeTZpQlFcCGjvIew5gKRn 3r/N8NwgkfVMzKP7BCH4oUkoE3E45+ZOojLXC2oyj0kT69Jfn/DDFRLD1QhimNrbY/qt hREt4rDl3ZBDZFCbifXxFm35qZvXeherUIqiwTfQzDZueWIA3TG0x2klJK9k+QywhJF1 ntJUrKONEUHJqdDaxU27ui/yIRPfBQwHSIMT6vzFqIJFItkeKS7SfMITXvCD9nJDwuoH Wa6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:subject:from:message-id:cc:to; bh=Re8+0Z6rcMlSD/DxG73di4ui8dCdRUoakWQTrVDpOIE=; b=L56wLcF+3nZnnHK1r/lUnDR2TN7sd9g6ej5bJhHn10X73KUuUUJhOWT5B7WoRFdZAo 7V69g9k7dbmGxoOnIjfTytUDoLbM25l/0zME6v0Av+865oAFVCyhnClk2x3v0gVIJJ+a EL68ZgNSfpPkAGSItpugio7M39uVLFRB18wccZDf3u2WcBpjI7H6ekAuk4m5rVCH9Smj zmJ9RlNljo69qNtR8HeEXbbGng1Zd2HmoHMcopXSV1ZNeeJiNCPOC352I3C1P6kjYFeC 9Qn2MGf7lHjI8TLvwAN+1eKChsXJyIlF7iIgUap0FJEYnqsbL88D4MEcHMNVLW6q2KgG POOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si1090558eje.225.2020.11.19.20.54.51; Thu, 19 Nov 2020 20:55:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbgKTEvi (ORCPT + 99 others); Thu, 19 Nov 2020 23:51:38 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:52672 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbgKTEvg (ORCPT ); Thu, 19 Nov 2020 23:51:36 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id BE34E2A452; Thu, 19 Nov 2020 23:51:35 -0500 (EST) To: Michael Schmitz , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: From: Finn Thain Subject: [PATCH] scsi/NCR5380: Reduce NCR5380_maybe_release_dma_irq() call sites Date: Fri, 20 Nov 2020 15:39:56 +1100 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor to avoid needless calls to NCR5380_maybe_release_dma_irq(). This makes the machine code smaller and the source more readable. Signed-off-by: Finn Thain --- drivers/scsi/NCR5380.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index ea4b5749e7da..d597d7493a62 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -725,7 +725,6 @@ static void NCR5380_main(struct work_struct *work) if (!NCR5380_select(instance, cmd)) { dsprintk(NDEBUG_MAIN, instance, "main: select complete\n"); - maybe_release_dma_irq(instance); } else { dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES, instance, "main: select failed, returning %p to queue\n", cmd); @@ -737,8 +736,10 @@ static void NCR5380_main(struct work_struct *work) NCR5380_information_transfer(instance); done = 0; } - if (!hostdata->connected) + if (!hostdata->connected) { NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); + maybe_release_dma_irq(instance); + } spin_unlock_irq(&hostdata->lock); if (!done) cond_resched(); @@ -1844,7 +1845,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) */ NCR5380_write(TARGET_COMMAND_REG, 0); - maybe_release_dma_irq(instance); return; case MESSAGE_REJECT: /* Accept message by clearing ACK */ @@ -1976,7 +1976,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) hostdata->busy[scmd_id(cmd)] &= ~(1 << cmd->device->lun); cmd->result = DID_ERROR << 16; complete_cmd(instance, cmd); - maybe_release_dma_irq(instance); return; } msgout = NOP; @@ -2312,7 +2311,6 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) } queue_work(hostdata->work_q, &hostdata->main_task); - maybe_release_dma_irq(instance); spin_unlock_irqrestore(&hostdata->lock, flags); return result; @@ -2368,7 +2366,6 @@ static void bus_reset_cleanup(struct Scsi_Host *instance) hostdata->dma_len = 0; queue_work(hostdata->work_q, &hostdata->main_task); - maybe_release_dma_irq(instance); } /** -- 2.26.2