From patchwork Fri Jun 12 09:42:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 6596761 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 30BB2C0433 for ; Fri, 12 Jun 2015 09:44:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55EEC2067D for ; Fri, 12 Jun 2015 09:44:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67AA120685 for ; Fri, 12 Jun 2015 09:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932731AbbFLJoX (ORCPT ); Fri, 12 Jun 2015 05:44:23 -0400 Received: from mail-qg0-f53.google.com ([209.85.192.53]:35557 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932720AbbFLJoU (ORCPT ); Fri, 12 Jun 2015 05:44:20 -0400 Received: by qgg3 with SMTP id 3so9783661qgg.2 for ; Fri, 12 Jun 2015 02:44:19 -0700 (PDT) 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=YlrOF1OGc8D1bsjQ3opn+9ApkP3rmbElYQ0sL1kobn8=; b=YmPKkiSRrJ2XL9j+bHELGkDg8VgrTGKee6f2R13agUt+j2OG69uD/FdZnlLi1s5kwe 3t0nT/CyozFpNfFYEW08AjyAFNEKovYChdrtTvS0KRAFBtQ9FpYypQIUtDlASRJmPfxC 3OP1Kpx+QieBFcpFTT7+/dTp9AAt0iyg666/Y= 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=YlrOF1OGc8D1bsjQ3opn+9ApkP3rmbElYQ0sL1kobn8=; b=KbivPU9uG7aiEIYOzAu4ZGNF0R65HwaCeEYqCwNifRFNpI9N2QYkt8ZLAD2bJTwAyC hzveZsKuncdQ88ti+K605tLfLQlYoPC8sLsEtEh1H2eWq6oROcnat4EKTgwRKw0Eaaxt GxiczoMWG5Rc22G/fNX2WbdNM0qvDZuYgKDKjugOu9QOcSAJLGkBSLrzrrqy+2KH0jWk 2PFOUfkIL3e7dw936oQWHVm7fyfZJASYkor/7vPSczhEsYmQYJdveOQWsa91plbJ5ZZp jXOGzC2qPXC2NEQayLTjutXlgYNmc5bUXnRlE56NS7tfw20WmePstmgcXiHzBcOMA+Jd 3RbQ== X-Gm-Message-State: ALoCoQmfpRctwfyZm/wkDjjemY/Ws78ZJSdIGhuMYu9SWp12GcTxeC4cl0UGHugITqnA1mUP7qdB X-Received: by 10.140.44.52 with SMTP id f49mr17001622qga.88.1434102259189; Fri, 12 Jun 2015 02:44:19 -0700 (PDT) Received: from host1.lsi.com ([192.19.239.250]) by mx.google.com with ESMTPSA id 18sm1466219qgh.40.2015.06.12.02.44.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 02:44:18 -0700 (PDT) From: Sreekanth Reddy X-Google-Original-From: Sreekanth Reddy To: jejb@kernel.org, hch@infradead.org Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, JBottomley@Parallels.com, Sathya.Prakash@avagotech.com, linux-kernel@vger.kernel.org, Sreekanth Reddy Subject: [PATCH 18/20] [SCSI] mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API Date: Fri, 12 Jun 2015 15:12:30 +0530 Message-Id: <1434102153-38581-19-git-send-email-Sreekanth.Reddy@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1434102153-38581-1-git-send-email-Sreekanth.Reddy@avagotech.com> References: <1434102153-38581-1-git-send-email-Sreekanth.Reddy@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 Added dma_mapping_error() API after mapping an address with dma_map_single() API. Otherwise when CONFIG_DMA_API_DEBUG is enabled in the kernel, then it complains about mpt3sas driver not calling dma_mapping_error after mapping an address with dma_map_single Signed-off-by: Sreekanth Reddy Reviewed-by: Johannes Thumshirn Reviewed-by: Martin K. Petersen --- drivers/scsi/mpt3sas/mpt3sas_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index 7a7aa68..70fd019 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c @@ -1964,7 +1964,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, } else { dma_addr_out = pci_map_single(ioc->pdev, bio_data(req->bio), blk_rq_bytes(req), PCI_DMA_BIDIRECTIONAL); - if (!dma_addr_out) { + if (pci_dma_mapping_error(ioc->pdev, dma_addr_out)) { pr_info(MPT3SAS_FMT "%s(): DMA Addr out = NULL\n", ioc->name, __func__); rc = -ENOMEM; @@ -1986,7 +1986,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, } else { dma_addr_in = pci_map_single(ioc->pdev, bio_data(rsp->bio), blk_rq_bytes(rsp), PCI_DMA_BIDIRECTIONAL); - if (!dma_addr_in) { + if (pci_dma_mapping_error(ioc->pdev, dma_addr_in)) { pr_info(MPT3SAS_FMT "%s(): DMA Addr in = NULL\n", ioc->name, __func__); rc = -ENOMEM;