From patchwork Fri Dec 18 13:27:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 7883901 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20C0DBEEE5 for ; Fri, 18 Dec 2015 13:28:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CB862049D for ; Fri, 18 Dec 2015 13:28:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50F63204A9 for ; Fri, 18 Dec 2015 13:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932322AbbLRN2X (ORCPT ); Fri, 18 Dec 2015 08:28:23 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36399 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932270AbbLRN2W (ORCPT ); Fri, 18 Dec 2015 08:28:22 -0500 Received: by mail-pa0-f50.google.com with SMTP id q3so40570666pav.3 for ; Fri, 18 Dec 2015 05:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uo3HTX+ATXffW/rhPMQt9H1n1BOUvCMMoLVEQtX+pJ4=; b=XkORBnMykm9WEZfGoiODXBYYLoHtwr1dLK4BNoaDHSFSZvfMiu700Scmlailh+rN0m KzRmJ65r8DHhLMt7vmmExKbAUVJfKtaeSgGm4kNGSRhsDResTcDrcovze16r+zGbDoZX s6vLxwRMlMPU9G/VSZJTOd+TxblWzNfM6g3Zg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Uo3HTX+ATXffW/rhPMQt9H1n1BOUvCMMoLVEQtX+pJ4=; b=mgYoMfgwEz1Tn0IBHjvsRL3tdhA2HQvQEBPjZjuTHvDDScni9Nka0qckUmjGrVoYo9 YcexKi2Q4ufScmuQ8lJ0VydTT61ZXWV+GJOtziN2Vka70OX1EgXR7Ec6GFORpYULj+5D 7+M+WFbbGvS17e3dsQUTyHaE+fXCvKSHqnFqK1tsf9CkFHjUb+5I2kkAiojR0AkQAPgx nWdWmw24ES7kjH37a6nDZDrvhZoVtWrzYrNBRj3z41/5O2WfpIQsyNjdrIC1ClaNLQZf Wn6JkJzJgYc0fux+1mXW2bVnV5a/wD4g5LgzDoUBfUIZP3WCs8oVXoQ1K9UJ1jokYkcW LCzg== X-Gm-Message-State: ALoCoQloQd2wfKMto4ofDcEMsavrngOfrPhzYsNy+t3UPCPZRbK62ysUR4zaAlTfnDwjHjHCdyDa3nT2tyYq9qGjip2ixxXl3w== X-Received: by 10.66.191.9 with SMTP id gu9mr5251094pac.72.1450445301355; Fri, 18 Dec 2015 05:28:21 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id 2sm18089348pfl.56.2015.12.18.05.28.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 05:28:20 -0800 (PST) From: Sumit Saxena X-Google-Original-From: Sumit Saxena To: jbottomley@parallels.com, hch@infradead.org, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, kashyap.desai@avagotech.com, sumit.saxena@avagotech.com Subject: [PATCH 08/15] megaraid_sas: Code optimization build_and_issue_cmd return-type Date: Fri, 18 Dec 2015 18:57:01 +0530 Message-Id: <1450445228-26571-9-git-send-email-Sumit.Saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1450445228-26571-1-git-send-email-Sumit.Saxena@avagotech.com> References: <1450445228-26571-1-git-send-email-Sumit.Saxena@avagotech.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP build_and_issue_cmd should return SCSI_MLQUEUE_HOST_BUSY for few error case instead of returning 1. Signed-off-by: Sumit Saxena Reviewed-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 9 ++------- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index a3b63fa..3454c5e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1636,7 +1636,7 @@ megasas_build_and_issue_cmd(struct megasas_instance *instance, return 0; out_return_cmd: megasas_return_cmd(instance, cmd); - return 1; + return SCSI_MLQUEUE_HOST_BUSY; } @@ -1728,12 +1728,7 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd) break; } - if (instance->instancet->build_and_issue_cmd(instance, scmd)) { - dev_err(&instance->pdev->dev, "Err returned from build_and_issue_cmd\n"); - return SCSI_MLQUEUE_HOST_BUSY; - } - - return 0; + return instance->instancet->build_and_issue_cmd(instance, scmd); out_done: scmd->scsi_done(scmd); diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index aca0cd3..9ad779d 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2123,7 +2123,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance, req_desc = megasas_get_request_descriptor(instance, index-1); if (!req_desc) - return 1; + return SCSI_MLQUEUE_HOST_BUSY; req_desc->Words = 0; cmd->request_desc = req_desc; @@ -2132,7 +2132,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance, megasas_return_cmd_fusion(instance, cmd); dev_err(&instance->pdev->dev, "Error building command\n"); cmd->request_desc = NULL; - return 1; + return SCSI_MLQUEUE_HOST_BUSY; } req_desc = cmd->request_desc;