From patchwork Wed Sep 21 07:28:00 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: 9342983 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 844346077A for ; Wed, 21 Sep 2016 07:28:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71BFB2A1CA for ; Wed, 21 Sep 2016 07:28:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 611FD2A1CB; Wed, 21 Sep 2016 07:28:18 +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 6EC262A1CD for ; Wed, 21 Sep 2016 07:28:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E3D956E7B3; Wed, 21 Sep 2016 07:28:14 +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.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BDF06E7B3 for ; Wed, 21 Sep 2016 07:28:11 +0000 (UTC) Received: from [192.168.1.2] ([77.182.212.253]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Md4le-1bUWrj1QWY-00IDly; Wed, 21 Sep 2016 09:28:01 +0200 Subject: [PATCH 4/5] GPU-DRM-nouveau: Adjust a kzalloc() call in gt215_ram_new() To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, Ben Skeggs , David Airlie , Martin Peres , Roy Spliet References: <5bcff2ec-f3bd-ab9c-e13d-3a4f5cf7c73b@users.sourceforge.net> From: SF Markus Elfring Message-ID: <0d8628f4-7254-2600-9ee4-e72b4e0ee6f6@users.sourceforge.net> Date: Wed, 21 Sep 2016 09:28:00 +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: <5bcff2ec-f3bd-ab9c-e13d-3a4f5cf7c73b@users.sourceforge.net> X-Provags-ID: V03:K0:7rjrv9e1d/OJi3LZ+Wzs1it5I4eEAbQsRskrPh1qI3YB83DcVCE M3qozgSGIi6q7CeZf7FiMQI3b/32qmVsKXcrwB0aPsdencpEIDB1Ju1pDdfjx0ci/1Kd6kc 5ZwxfyICSK7gX3tHfRCq8k1Y5sTKLcSoeztIrAzBr1nlsGsO7VQEtSte+Rb1193bFva/7gX 6kjMI9D/QlO0fxXZX6+0Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:ffgeooE+OuM=:b7XkVW+tLLrcx8UqNG6CWc SPMC+7izwKc3Q73f1GdWGzw98tclOQjrkbTSq4Va7I1+fAqrEoYFUWGVRvx6IRaE3x3mt/12H ZUd/9jEFZZ4A6OuTqHR7VzPKaoWFB3b8ywwaf7V8eDgUZiIp2Ab9kWXAnEWLlRzvOqJSk1H/u WBeVuT8MZMuVQr5Zq8BnjR8d4AIH/C6qtrmKDL6QGteNk/5A6114iqeDr/lpY/ntKoHWVvw7D N9EWHT6qrPeYiqXTd2IuTsaXzIlSS6hHRUhxM7z9oNDbp56E49l0tfmiyKNxUmwgQz/Ix7ciQ DZ20TCocjqCIw+eNwnUEf51IG7bA9QdbbUtRMjrz5U9uMrWnX7XVMdJvUsnS9707YT4F1AuI3 DMgrgXMmxdg8N5OmO0d7Mv64wedOOME6WrPk7T86FolxcWhdghE5IYNG1hCAPVpoYqxTFNEW5 I/jdSL3zzOzstUt91O0dvkwwm4X8GsDFWQFBzeS9PFKnItHWYE3U2iTrcNxIcThJR4AtJqjZC vca2mjdofYQT3zXd8Rqa3C7FAzgR8H+J6GOA4j+47aPP1eqd1TdSiAbd6AyUtEBo03q08XJ62 CR5gqoIysK0ZjJ2Ssr4s2sqHgYvFI9IB/noebs1oAXHnnXONstJsa6PmvkRixPao3enzfpAfp Spm/1Jtp11uyjbW26Pkx4C364cXXj5TRgHbRBQ6GVNjAM/hV1QIjanjpL4zeyikZuaX/h3gdD dhSvp3Z8a9Al9aBFuPhiPUhREJMLvY1QTI9wJG2s012q7VS9QwqWp9h88quH2prP0NOAGyXRO XXKrE7q Cc: trivial@kernel.org, kernel-janitors@vger.kernel.org, LKML , Julia Lawall 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: Wed, 21 Sep 2016 08:44:38 +0200 The script "checkpatch.pl" can point out that assignments should usually not be performed within condition checks. Thus move the assignment for one local variable to a separate statement in this function. Signed-off-by: Markus Elfring --- drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c index cb50539..edbe8e4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c @@ -940,7 +940,8 @@ gt215_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) struct gt215_ram *ram; int ret, i; - if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL))) + ram = kzalloc(sizeof(*ram), GFP_KERNEL); + if (!ram) return -ENOMEM; *pram = &ram->base;