From patchwork Tue Jun 30 06:55:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 6693891 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2CBBC9F74E for ; Tue, 30 Jun 2015 06:57:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D1C7205CA for ; Tue, 30 Jun 2015 06:57:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50E70205E5 for ; Tue, 30 Jun 2015 06:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753302AbbF3G5C (ORCPT ); Tue, 30 Jun 2015 02:57:02 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34236 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbbF3G4n (ORCPT ); Tue, 30 Jun 2015 02:56:43 -0400 Received: by pabvl15 with SMTP id vl15so695177pab.1 for ; Mon, 29 Jun 2015 23:56:42 -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=DelIDf6UydIVqZKxLzuCRieHTqJ13mn20MCPxSOHKHc=; b=sg13ml70mnfLyyn+K6b8NJRvFHLREyG0331YO16nQHbUQzn6cpVlsmIE6ft6Bn5OuZ UTGZWJ4Z6q+ZfrclMkMBRBFVd7U30jTcTobPxZvuwZk3eAp5Is7E85mKbiwrvppv9YaT GnKVFVQ3tTc63ZL8KEApWUDy0bWxdusMYSx9w= 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=DelIDf6UydIVqZKxLzuCRieHTqJ13mn20MCPxSOHKHc=; b=lHDHkjGt5/sbeYSmQTcpnr/D6e9uuBrP4XDzPTP4ZqrtjEE5eovU53uIwELltQoEXu 07vUVPn1lT0gpuANtFhaN/JYtR2ycWcgoG9pait6d/DNmvN4A8D388l6FBEOkfzUHG3H htWyzdi+PImFVnyX8hH4ikA5mktgNssJt04bOdILdwUkBJWhcJM0AWfwWsEM8Co8Rez+ wPrqanbHYrzmymTBcjfW00YUcY437c9JNpXLL2vqqUVrpo6R9CQvzPUWaefS6J/kqoW6 5EkcnmNDn67wjcX0KlWR5D66QyLjRe60kytkvxJCC7hOrlwLoqvlXdcnDBMto59AraJ0 eNkg== X-Gm-Message-State: ALoCoQm49L1qI4uc0uxoeefF0SMmvYy1Li15nbqmb8cqLoexhv8IuG4nnC4xLTsvhm3B2KCOAz5v X-Received: by 10.66.140.34 with SMTP id rd2mr4956682pab.13.1435647402079; Mon, 29 Jun 2015 23:56:42 -0700 (PDT) Received: from host1.lsi.com ([192.19.239.250]) by mx.google.com with ESMTPSA id 1sm935543pds.79.2015.06.29.23.56.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Jun 2015 23:56:41 -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, jthumshirn@suse.de, Sreekanth Reddy Subject: [PATCH v2 18/20] [SCSI] mpt3sas: Call dma_mapping_error() API after mapping an address with dma_map_single() API Date: Tue, 30 Jun 2015 12:25:04 +0530 Message-Id: <1435647306-36956-19-git-send-email-Sreekanth.Reddy@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1435647306-36956-1-git-send-email-Sreekanth.Reddy@avagotech.com> References: <1435647306-36956-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=-7.4 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 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 Changes in v2: Patch version change only. Signed-off-by: Sreekanth Reddy Reviewed-by: Martin K. Petersen Reviewed-by: Johannes Thumshirn --- 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;