From patchwork Wed Mar 7 19:54:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10267139 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 9903360211 for ; Thu, 8 Mar 2018 07:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D2A029808 for ; Thu, 8 Mar 2018 07:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81F8B29803; Thu, 8 Mar 2018 07:50:54 +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=-2.9 required=2.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, 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 124AF29801 for ; Thu, 8 Mar 2018 07:50:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E10786E823; Thu, 8 Mar 2018 07:50:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1221 seconds by postgrey-1.36 at gabe; Wed, 07 Mar 2018 20:14:38 UTC Received: from gateway20.websitewelcome.com (gateway20.websitewelcome.com [192.185.55.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1AC46E22E for ; Wed, 7 Mar 2018 20:14:38 +0000 (UTC) Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 5789F400E63E8 for ; Wed, 7 Mar 2018 13:54:16 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id tf8ieZgV5z8j4tf8ieg1NH; Wed, 07 Mar 2018 13:54:16 -0600 Received: from [189.175.117.58] (port=47330 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1etf8h-002QFN-Ti; Wed, 07 Mar 2018 13:54:16 -0600 Date: Wed, 7 Mar 2018 13:54:15 -0600 From: "Gustavo A. R. Silva" To: Florian Tobias Schandinat , Bartlomiej Zolnierkiewicz Subject: [PATCH] video: fbdev: via_aux_vt1632: remove VLA usage Message-ID: <20180307195415.GA666@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.freedesktop.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.117.58 X-Source-L: No X-Exim-ID: 1etf8h-002QFN-Ti X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.117.58]:47330 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 9 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-Mailman-Approved-At: Thu, 08 Mar 2018 07:50:48 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Also, remove variable 'len'. Notice that no new IDs have been added in seven years. Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/via/via_aux_vt1632.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c index d24f4cd..0cd0d2a 100644 --- a/drivers/video/fbdev/via/via_aux_vt1632.c +++ b/drivers/video/fbdev/via/via_aux_vt1632.c @@ -35,10 +35,10 @@ static void probe(struct via_aux_bus *bus, u8 addr) .addr = addr, .name = name}; /* check vendor id and device id */ - const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id); - u8 tmp[len]; + const u8 id[4] = {0x06, 0x11, 0x92, 0x31}; + u8 tmp[4]; - if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) + if (!via_aux_read(&drv, 0x00, tmp, 4) || memcmp(id, tmp, 4)) return; printk(KERN_INFO "viafb: Found %s at address 0x%x\n", name, addr);