From patchwork Thu Dec 10 16:17:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 11967493 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=-12.0 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,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 24573C4361B for ; Fri, 11 Dec 2020 08:16:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C9A0223ECD for ; Fri, 11 Dec 2020 08:16:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9A0223ECD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2A3D6EC95; Fri, 11 Dec 2020 08:16:09 +0000 (UTC) X-Greylist: delayed 452 seconds by postgrey-1.36 at gabe; Thu, 10 Dec 2020 16:24:45 UTC Received: from mout.web.de (mout.web.de [212.227.17.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id E9ACF6EA9B for ; Thu, 10 Dec 2020 16:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1607617484; bh=RbB5v5ckMmMVLBuO4h4nv0LaMyl22jZh7Yg7N1OraqU=; h=X-UI-Sender-Class:To:Cc:From:Subject:Date; b=djgmsxXDV0RCgahwRsCEHs48FntQ67P3QVnJr2MfaTvich8tTI8ysNKzdG5dHuZZ1 Bk7BsuLbyqtezafX8mBx/28VFSAMori4ysw6ow4p+od0tuHA4bd5ZEDq0RIQW3n+HB 9ycPmKffH8Jd+6lsDorYodIzGxMcmPcUXBqh+k3Y= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([78.48.143.229]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MMEzJ-1kmaLo2uYH-0085qM; Thu, 10 Dec 2020 17:17:09 +0100 To: linux-hyperv@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Haiyang Zhang , "K. Y. Srinivasan" , Stephen Hemminger , Wei Liu From: Markus Elfring Subject: =?utf-8?b?W1BBVENIXSB2aWRlbzogaHlwZXJ2X2ZiOiBSZWR1Y2Ugc2NvcGUgZm9y?= =?utf-8?b?IHRoZSB2YXJpYWJsZSDigJxwYWdl4oCdIGluIGh2ZmJfZ2V0X3BoeW1lbSgp?= Message-ID: Date: Thu, 10 Dec 2020 17:17:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K1:wtWOaEAAK/7ggzXbYs2wm3X81hOMSW+pDL/XqRmybj3L0m1GbdC 0fUFgF2f8jyUu0WdYScQdLo83nEd4E2nw5TZzXPgWR4I8dIYGE5QoqkNSnqfioQDSgAqMva cmspeQP9dm3zcwFUKHfVGgdrGN0WxWefnJLW0rDjKglDuQdgj3SlUfc5i3TFnTe2e4h0FRi E121pMYJ/T6++mpVHOxLQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Cx+zacpPxug=:U32SO3VZOCW8mX03iKCpD/ GxW+tdUVm4OANqyiUt9z5YlWyK5vKXuNtTrXHCCeiOfgaVlxi0tu5LusGBI+U5JhgLCBdHfyo 8X3q4FtMFBaanp2rXDnuDqFURAN21ZKJn7wRoHfrA+/YM2ekZXJqROLmYSV8EkfucPXJHuGS9 dfg/h+tGDyMp7Hx90l4mWvIDev1XKIkxsBdO4nI3n39xDL1IDRyURh1T/PnN7wzAP5UdiCf8Q 9oNgErYIbZ9E9gt/+MCeZtWp49KCnljU8IRU3qfWZO4jVEUjlPSRMHxTxBbt8cY1U9iCRyPtI t4i2Dx9vol+EWwkB2qDizO37R8JYl5WGS9P85ADhHAB0EIdtg6IWMUaw7e7koXU9Tay6LyR/C new2ZaH3clslOS8/72LBd334jsQV+t6fEsdx+pYNRIhw+d1kmejiyEbALJ90O0xPSIQlxP0c2 VKLm96DrN2OIPAzIK+MY5kbfuivjgQgwud7fjUeisdsKITxHAzI92O2BEEwkE8Gfs+OWYMxUb DzD0/VaOzLIV6z6XC31H/CV4cdTgO1I4329irZfLGDjEPyva4W7n0Er6Qdw3DFsLjm1d9T4yx yIQdt53NlNTMCHRqA5vQ4CfsQy87SucWuWb/Jl1paKREn4tZc+CPogyt8D+kfUaK1HxMK7Hm8 M29IGzQDEMw6WWFPEI/sy4g83evsr8VVUzn+GDdYtD3Vm5n0lFPblx23YObjULGct445DVOwt UzLo3HXM6VkxUUhpCDhKerYcxb/CfP5GkrXpOURL9Lxs8ArSubCEuSxNOXlLYYQkbqkH+TJMM 3uwRjPnkL4EfAJMjEKmgk6y/m/WrAJsN5UaIlb9iNvWFsMGWgOxoqqL7z6oQuGh92/W5qnFU6 byf+stGCsO/KAk7dyVdQ== X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Markus Elfring Date: Thu, 10 Dec 2020 17:00:13 +0100 A local variable was used only within an if branch. Thus move the definition for the variable “page” into the corresponding code block. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/video/fbdev/hyperv_fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.29.2 diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c index c8b0ae676809..e18fa8793608 100644 --- a/drivers/video/fbdev/hyperv_fb.c +++ b/drivers/video/fbdev/hyperv_fb.c @@ -961,7 +961,6 @@ static void hvfb_get_option(struct fb_info *info) static phys_addr_t hvfb_get_phymem(struct hv_device *hdev, unsigned int request_size) { - struct page *page = NULL; dma_addr_t dma_handle; void *vmem; phys_addr_t paddr = 0; @@ -972,7 +971,7 @@ static phys_addr_t hvfb_get_phymem(struct hv_device *hdev, if (order < MAX_ORDER) { /* Call alloc_pages if the size is less than 2^MAX_ORDER */ - page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order); + struct page *page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order); if (!page) return -1;