From patchwork Thu Jan 28 15:34:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 8151621 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 EF7B7BEEE5 for ; Thu, 28 Jan 2016 15:36:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E74420373 for ; Thu, 28 Jan 2016 15:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3563920364 for ; Thu, 28 Jan 2016 15:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967078AbcA1Pgs (ORCPT ); Thu, 28 Jan 2016 10:36:48 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34410 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967035AbcA1Pfi (ORCPT ); Thu, 28 Jan 2016 10:35:38 -0500 Received: by mail-pa0-f44.google.com with SMTP id uo6so25317136pac.1 for ; Thu, 28 Jan 2016 07:35:38 -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=rHzmP+ukUHleCkL07vwmMgr5zCCghxRgK09lcPtYQ0U=; b=ZdikgHc58CaWaGJS9flv1ESx/N+L12PIRL6aLLSJx825vc7pr/nNyZGPQHe0a+T8jq VW3Rjf+A94JP9tASbed9kvCcyNqCZf37lMrAKyBMuUNNNh8kZxn9VPLg94xqSDUcsGR3 k5+GJy3zpdvqgaHn1zWd7h34D6gjkAeNOK6vo= 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=rHzmP+ukUHleCkL07vwmMgr5zCCghxRgK09lcPtYQ0U=; b=bA3mzHZoi6RzDGixqTgtyEwvk88VcYFQO4uCDWBhTTx7BB1CwUGgMTxkYeeEQmK4NC a4DJKQOL+DTIZjb8cDtKZDOr3kCyBWS0hYZ0qszKaCDToli5VPYRQ8FpFCFx9+4Jz+ys bUz4ft9HmKz3cLojZZixWQGB0LVJLRU1xp3CQIjvKFgv4TWK/ECzAtwkwjdl6xHdd3tX BlcV+F12M7Ernm21IHdNkjmvbSdajjPFB6uQmM8VoIdBGkak4H0ctW6mi0GY+CxkaEOD tB+517F+8Nc9AahIM2AwGywGNERBaBhhXcMb6aGgWv3qTfSdzIjAXH99tBUWlCJ/Yd93 T1IQ== X-Gm-Message-State: AG10YOQaLkCugXUiZ5DrIR/weXJKMQA0nN9VP6Ao3ZXbX5B8Kx7SufQkjlw3hnq5jDqdAFQC X-Received: by 10.66.120.77 with SMTP id la13mr5444459pab.74.1453995337712; Thu, 28 Jan 2016 07:35:37 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id y18sm17231752pfi.84.2016.01.28.07.35.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 07:35:36 -0800 (PST) From: Sumit Saxena To: jbottomley@parallels.com, hch@infradead.org, martin.petersen@oracle.com, thenzl@redhat.com Cc: linux-scsi@vger.kernel.org, kashyap.desai@avagotech.com, sumit.saxena@avagotech.com Subject: [PATCH v2 08/15] megaraid_sas: Code optimization build_and_issue_cmd return-type Date: Thu, 28 Jan 2016 21:04:29 +0530 Message-Id: <1453995276-24955-9-git-send-email-sumit.saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1453995276-24955-1-git-send-email-sumit.saxena@avagotech.com> References: <1453995276-24955-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,RP_MATCHES_RCVD,T_DKIM_INVALID,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. There are no changes in this patch from last time sent patch. 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 8df58c2..edf8911 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 1351cae..f553830 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -2125,7 +2125,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; @@ -2134,7 +2134,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;