From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AAE4C4361B for ; Sun, 13 Dec 2020 20:47:22 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCB8922262 for ; Sun, 13 Dec 2020 20:47:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCB8922262 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=laposte.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CvGmR2XPczDqSd for ; Mon, 14 Dec 2020 07:47:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=laposte.net (client-ip=160.92.124.102; helo=smtp-outgoing.laposte.net; envelope-from=vincent.stehle@laposte.net; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=laposte.net Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=laposte.net header.i=@laposte.net header.a=rsa-sha256 header.s=lpn-wlmd header.b=eqPlee6n; dkim-atps=neutral X-Greylist: delayed 7239 seconds by postgrey-1.36 at bilbo; Mon, 14 Dec 2020 07:28:31 AEDT Received: from smtp-outgoing.laposte.net (smtp-outgoing.laposte.net [160.92.124.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CvGLl5Kf0zDqQK for ; Mon, 14 Dec 2020 07:28:21 +1100 (AEDT) X-mail-filterd: {"version":"1.2.0", "queueID":"4CvCg925zrz10MQY", "contextId":"65b9d905-9a9e-4f5c-9967-0d45e91ce3a2"} Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0103.laposte.net (SMTP Server) with ESMTP id 4CvCg925zrz10MQY; Sun, 13 Dec 2020 19:27:33 +0100 (CET) X-mail-filterd: {"version":"1.2.0", "queueID":"4CvCf7035Dz10MQV", "contextId":"b7eefe2d-5cd9-468a-9753-f7e7ca878663"} X-lpn-mailing: LEGIT X-lpn-spamrating: 36 X-lpn-spamlevel: not-spam X-lpn-spamcause: OK, (-100)(0000)gggruggvucftvghtrhhoucdtuddrgedujedrudekiedguddufecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfntefrqffuvffgpdfqfgfvpdggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpeggihhntggvnhhtucfuthgvhhhlrocuoehvihhntggvnhhtrdhsthgvhhhlvgeslhgrphhoshhtvgdrnhgvtheqnecuggftrfgrthhtvghrnhepteeivdehieejtdfgledvgffhvedtveejhefftdeukeeuieduudetjeektdeuffetnecukfhppeekkedruddvuddrudegledrgeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheprhhomhhurghlugdrsggvrhhgvghrihgvpdhinhgvthepkeekrdduvddurddugeelrdegledpmhgrihhlfhhrohhmpehvihhntggvnhhtrdhsthgvhhhlvgeslhgrphhoshhtvgdrnhgvthdprhgtphhtthhopehgvghofhhfsehinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepvhhinhgtvghnthdrshhtvghhlhgvsehlrghpohhsthgvrdhnvghtpdhrtghpthhtoheplhhinhhugihpphgtqdguvghvsehlihhsthhsrdhoiihlrggsshdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh Received: from romuald.bergerie (unknown [88.121.149.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mlpnf0103.laposte.net (SMTP Server) with ESMTPSA id 4CvCf7035Dz10MQV; Sun, 13 Dec 2020 19:26:36 +0100 (CET) Received: from radicelle.bergerie (radicelle.bergerie [192.168.124.12]) by romuald.bergerie (Postfix) with ESMTPS id 1BD413DF32AF; Sun, 13 Dec 2020 19:26:36 +0100 (CET) Received: from vincent by radicelle.bergerie with local (Exim 4.94) (envelope-from ) id 1koW4p-00060T-P4; Sun, 13 Dec 2020 19:26:35 +0100 From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/ps3: use dma_mapping_error() Date: Sun, 13 Dec 2020 19:26:22 +0100 Message-Id: <20201213182622.23047-1-vincent.stehle@laposte.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=lpn-wlmd; t=1607891296; bh=YIAg0xdLhTfsQSKbEzRITi543Hxi26DWrI5pNv7EPQE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding; b=eqPlee6n1jjiOK8BI6U4pdPfCdtwMul3SDeBCp2YLo4qOdB4uw4nvN2jOwAHcB3EoOFbB1+/XGq01mEvTjH4WmECLwLJeMzwiarvY9Zwb4pYCRzvTiZdagJgkDSSZ79SLNqj+eiyhq03n+Nm3eFow3DShNmF2WFYXSbFiizoPv4QyqaSHu4Syn2T3kdL6gOKx6cgp1/OAHNx5aYLfo8ZjMXc5XVANh0Bg8Vu86pNmIrKWVe1inlpWdV+jDP8TUuJJWh4W3wO4CA2+bL68roW7iE1GGlzL25tNz6Yab8sv+nRLJYr3p3RdeFK5k/H1pXOSuyREGTJBTZr1xpbYogwGA==; X-Mailman-Approved-At: Mon, 14 Dec 2020 07:43:52 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geoff Levand , Geert Uytterhoeven , =?UTF-8?q?Vincent=20Stehl=C3=A9?= Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" The DMA address returned by dma_map_single() should be checked with dma_mapping_error(). Fix the ps3stor_setup() function accordingly. Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core") Signed-off-by: Vincent Stehl=C3=A9 Cc: Geoff Levand Cc: Geert Uytterhoeven --- drivers/ps3/ps3stor_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c index 333ba83006e48..a12a1ad9b5fe3 100644 --- a/drivers/ps3/ps3stor_lib.c +++ b/drivers/ps3/ps3stor_lib.c @@ -189,7 +189,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, irq= _handler_t handler) dev->bounce_lpar =3D ps3_mm_phys_to_lpar(__pa(dev->bounce_buf)); dev->bounce_dma =3D dma_map_single(&dev->sbd.core, dev->bounce_buf, dev->bounce_size, DMA_BIDIRECTIONAL); - if (!dev->bounce_dma) { + if (dma_mapping_error(&dev->sbd.core, dev->bounce_dma)) { dev_err(&dev->sbd.core, "%s:%u: map DMA region failed\n", __func__, __LINE__); error =3D -ENODEV; --=20 2.29.2