From patchwork Wed Mar 7 19:47:03 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: 10267141 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 32E45602C8 for ; Thu, 8 Mar 2018 07:50:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27F7E297EB for ; Thu, 8 Mar 2018 07:50:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26A26297FD; Thu, 8 Mar 2018 07:50:58 +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 C730C297EB for ; Thu, 8 Mar 2018 07:50:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01A986E830; Thu, 8 Mar 2018 07:50:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1437 seconds by postgrey-1.36 at gabe; Wed, 07 Mar 2018 20:33:34 UTC Received: from gateway30.websitewelcome.com (gateway30.websitewelcome.com [192.185.152.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 522286E21D for ; Wed, 7 Mar 2018 20:33:34 +0000 (UTC) Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 3B2B416DB2 for ; Wed, 7 Mar 2018 13:47:05 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id tf1leNTu7cGlptf1leGKUx; Wed, 07 Mar 2018 13:47:05 -0600 Received: from [189.175.117.58] (port=47312 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1etf1k-002IqC-QA; Wed, 07 Mar 2018 13:47:04 -0600 Date: Wed, 7 Mar 2018 13:47:03 -0600 From: "Gustavo A. R. Silva" To: Florian Tobias Schandinat , Bartlomiej Zolnierkiewicz Subject: [PATCH] video: fbdev: via_aux_vt1636: remove VLA usage Message-ID: <20180307194703.GA3862@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: 1etf1k-002IqC-QA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.117.58]:47312 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 4 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_vt1636.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/via/via_aux_vt1636.c b/drivers/video/fbdev/via/via_aux_vt1636.c index 9e015c1..d6273a4 100644 --- a/drivers/video/fbdev/via/via_aux_vt1636.c +++ b/drivers/video/fbdev/via/via_aux_vt1636.c @@ -35,10 +35,10 @@ void via_aux_vt1636_probe(struct via_aux_bus *bus) .addr = 0x40, .name = name}; /* check vendor id and device id */ - const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id); - u8 tmp[len]; + const u8 id[4] = {0x06, 0x11, 0x45, 0x33}; + 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\n", name);