From patchwork Thu Sep 22 17:43:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9346089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FCE2607D0 for ; Thu, 22 Sep 2016 17:43:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 873782AA1F for ; Thu, 22 Sep 2016 17:43:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77AE22AC0A; Thu, 22 Sep 2016 17:43:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C5182AA1F for ; Thu, 22 Sep 2016 17:43:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56D3F6E91B; Thu, 22 Sep 2016 17:43:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FC326E91B for ; Thu, 22 Sep 2016 17:43:09 +0000 (UTC) Received: from [192.168.1.2] ([77.182.99.72]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0Lc8rF-1b4U4C1G1l-00jVb4; Thu, 22 Sep 2016 19:43:05 +0200 Subject: [PATCH 11/14] GPU-DRM-TTM: Return an error code only as a constant in ttm_dma_pool_init() To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Emil Velikov References: <566ABCD9.1060404@users.sourceforge.net> <4d34446f-05ad-c3ce-5d33-8fb4f25af25c@users.sourceforge.net> From: SF Markus Elfring Message-ID: <7e8a9893-8f1f-189a-4f19-d105c9502747@users.sourceforge.net> Date: Thu, 22 Sep 2016 19:43:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <4d34446f-05ad-c3ce-5d33-8fb4f25af25c@users.sourceforge.net> X-Provags-ID: V03:K0:cDYx0c7wgBjl8q0yZPbsoYPetfGKR+zKnClTHuEC+AULJ0mZdY0 Z66dfvS8UuGieiDc5o8Aa0/g0IZjkmf3bsL+PcBlMZwOfD+Xxp1lXtQs2ji3CZRM1idVe6e qy8QEF3jasCmHOXrfVTcOLU/N30gURG5JzDKwbaK0CSol4Sy1lJdd7oySMliz3VaFXB1nkT qQBm4I2o/oncvoM1XZDKg== X-UI-Out-Filterresults: notjunk:1; V01:K0:x9r/1fGVuF8=:yO4Kdm52D/Y4QWC2BVX3kD /3I43bZXdGPmXRUNRRvfrM1Jc++GOReQNzvfmwfQMRgh69JmmHZ/Pluq63J0BvDQ6LrT3ZAJE vQrX30aHr32desug6coK1B9J86hkC/COjPT2J7X2PPInymyZLe1c+T5QMEt8crfYLVZnEFzD5 +lXqkWhwG2YyGfqIsDUuA6l2uQuh6w0iym5lzQhWdP2UmHx9rmtRgJc2BTIkLAey50QikBXzO BEfzT/Jbg1lzYpCwrhq1SjgC8Ue8dHuMV7IFpqKZXgWXWLOFxsWkoW7QI+qxRgnXijUWqZuOu ZNFZGn/THTGkB2SX9L4/qJE+WsvMV2iEvZkyaxrRYkpC5ENl93hOl8Gi+JL/IM3L/X3ofLp1Y BxvnRzBQyUqwWASZvMNTbNBnHbM+TeEYFK1OKS3pKo8FZCRfC/XITckV2fJlPIUOYLGaZvV6A XeRsSEdmcUk7X+lhFRExyHGi78+A+TpkatUUyhhIIP1uDFHvB5TlPPjU9tKb7ujjLR3sNbjjQ BUcbx6byRHZ2OTz9nUMBVq27/MBO1AkUBxC3LMSL3v/RQyyNTqnqOl1muaIjIsagvoGkOIX7f +IODNmTRW2bjtKqIE9i49LmYzsYSJJOytLvZG4VS+UWUM9PKmxWM3xLmT4B6bKOffZKRn03ya b79QjMDRv+oWv8DVPRCRiqNwZ5SgNYmDQVJBh+QVvSbU8jd31YCx10pdfHytRZKkipHX+AgNh TI301/h06mY2ij2ByyBxjQeenMSQwQCILurkaat4x++SQvvyMkMQZYe41Ydwo4ZI18eqRAli2 RhuITRq Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 22 Sep 2016 17:17:19 +0200 * Return an error code without storing it in a local variable. * Delete the local variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index c21f45f..d5f41ed 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -579,7 +579,6 @@ static struct dma_pool *ttm_dma_pool_init(struct device *dev, gfp_t flags, struct device_pools *sec_pool = NULL; struct dma_pool *pool = NULL, **ptr; unsigned i; - int ret = -ENODEV; char *p; if (!dev) @@ -589,8 +588,6 @@ static struct dma_pool *ttm_dma_pool_init(struct device *dev, gfp_t flags, if (!ptr) return NULL; - ret = -ENOMEM; - pool = kmalloc_node(sizeof(struct dma_pool), GFP_KERNEL, dev_to_node(dev)); if (!pool) @@ -644,7 +641,7 @@ err_mem: devres_free(ptr); kfree(sec_pool); kfree(pool); - return ERR_PTR(ret); + return ERR_PTR(-ENOMEM); } static struct dma_pool *ttm_dma_find_pool(struct device *dev,