Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp706146pxv; Thu, 15 Jul 2021 14:01:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAk7w6O2kFAHbjK3Y3PBkuMa/pBheZNt6eP9NdKW05r3/YzrGDlIg/O68+zHWWofQORfUQ X-Received: by 2002:a05:6402:3192:: with SMTP id di18mr9976270edb.186.1626382900294; Thu, 15 Jul 2021 14:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626382900; cv=none; d=google.com; s=arc-20160816; b=kVneZIIlSMk3d7BBIggd2bK6XNvPFRn7nS8S38iXjLeHTIBM9bCBCkSrA0r1eHYcIr MZp0AXytzXoqOTaMuY4vI8MXh38AUgCDoAfj+mroaV4OZTAre51uyzcSdxceRo0le5we dnTGdPexnV0lifgBS8hsoqrk9aFIzhDqhbYCN7hKdgAnOSn7BXenSEvPVY73tkt4l5EL 3DHBeiEMCmv11iiYvWENBPFXGtSjlYkCmif9HNtYe5C9QqG0CNr+LOXZ2g8sXuOLrsiq LTUbwo0DcbKbVg7Zg/t5R9EaP2/ETRBxFhJKQzrgIdexx1qq2PU2Tmlv32ciXder6RVH abXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=0So9SX+KFL5UGdS3JALTvYX2o53SL7VRdq+tjhsTXy0=; b=dNK09jA+8R5uc4JJcboZ6+uMVxjTXcYKEEIuMEXidjww01mGIok6jFm4/R2KqhEZHu nkFFJhIvrqjtagWUj3X9zPAslAKp9TQvn9y7FXSHGkFI6leTAThzhHTfk9MbLqt9bLT2 U/ctVV6XfejC3lngAP1jYZ3S73GhHbNMIx3+lARkE1UltYI4WbSUU6ARvi0kIS035nwr TEJc5VLcn+4EQqmHMt8VMHAcr5B4wa1TQ8VgHwbqp8vfLEeIwZttHt30IDOu3vRklic7 e+wTVKpyRmAMSW3b2yzM9cr0G+idTnPDaunVpK4z73nOy1QeWp9kuu1wHcMwebK+6snh ECwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=qqMKc5x7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si10112608ejt.504.2021.07.15.14.01.16; Thu, 15 Jul 2021 14:01:40 -0700 (PDT) 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; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=qqMKc5x7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234196AbhGOQtH (ORCPT + 99 others); Thu, 15 Jul 2021 12:49:07 -0400 Received: from ale.deltatee.com ([204.191.154.188]:49880 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbhGOQtD (ORCPT ); Thu, 15 Jul 2021 12:49:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=0So9SX+KFL5UGdS3JALTvYX2o53SL7VRdq+tjhsTXy0=; b=qqMKc5x7fyfRQyjp0HyOD1Z32b DzGFv9RbC3msHd0ahDXPw6wy/yg5LcJhCW0PDTt60LcgK0yaxWJRDYUVEm/BNElgrmC778Yy4Khxj aGJNkzEKcjYnH6edz8QuY+Tl8ve0CET9q0fadSAO5DDasNAoLugMijemySMaOpn9ulPDTRsV+Y6sH ukyJlT3fpoGKBhHlDl8EmUzR85XGF5eaXP1qG0RIxxvD17WUPvJycMMY1U/NB0pUxw6WhGIM2m2HT NoOWnt3ovvM0FRkgn+ygXT/NEfD/bqrFzfZTrmI0qK2wUhAUcbPNhILjW59tthQAwZmnqq++rIsqH kN3efVfw==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m44Ur-0001yd-1a; Thu, 15 Jul 2021 10:46:01 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1m44Un-0001nB-Re; Thu, 15 Jul 2021 10:45:57 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, iommu@lists.linux-foundation.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Stephen Bates , Martin Oliveira , Logan Gunthorpe Date: Thu, 15 Jul 2021 10:45:30 -0600 Message-Id: <20210715164544.6827-3-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210715164544.6827-1-logang@deltatee.com> References: <20210715164544.6827-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, sbates@raithlin.com, martin.oliveira@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_NO_TEXT autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH v1 02/16] dma-direct: Return appropriate error code from dma_direct_map_sg() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the map_sg() op expects error codes instead of return zero on error, convert dma_direct_map_sg() to return an error code. The only error to return presently is EINVAL if a page could not be mapped. Signed-off-by: Logan Gunthorpe --- kernel/dma/direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index f737e3347059..803ee9321170 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -411,7 +411,7 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents, out_unmap: dma_direct_unmap_sg(dev, sgl, i, dir, attrs | DMA_ATTR_SKIP_CPU_SYNC); - return 0; + return -EINVAL; } dma_addr_t dma_direct_map_resource(struct device *dev, phys_addr_t paddr, -- 2.20.1