Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp532367imm; Fri, 12 Oct 2018 02:24:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV62gbPAVo35Bi5iF5wo3lSVvMoA0SMw8PbMg6v6zLtYHqJqyA42L0+CIPHaDw/iaOXJnL4Un X-Received: by 2002:a65:6249:: with SMTP id q9-v6mr4757355pgv.392.1539336255456; Fri, 12 Oct 2018 02:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539336255; cv=none; d=google.com; s=arc-20160816; b=H3hNlWML6Cf4bHqO4bob/l+dN8uyy9X+SbIRF385oqg36YIVb/vnccdw5IZAz0LnvN fGpPa/JtBxxPWE0fF/1WPLQ0Ogi/vpHOAa1SeQyDTwDZwvhqH1/r5TSpChePs95E8K6L oLHlJLUfiKcdf3IOPB8JwgbT3+WQkDpX5e/aEV5LxpjZNgc5jChtJ6zQZckKlaN+47OK 6dk7tnOI4MZRBBw5zsN1F1erBrVNxrDK0Eeo6M+3Sf9+UhZKki+T1AJivKPrhOkY5/jo juG7rPE0kbyhIKYY07GJCQjgE+iMNzG1wpbrStYeDb7pWtDwCOn9jlu9v99vamUzLZvR h84w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Lf2NIEFPyyycASwxmgeyvVlIJ+24UxoRUqqHqnZTFBE=; b=tHZfv/wf6qsSXQLBNcYKV4JAXHWRLE4tnqrsoSYvirKORsbeHlhUdfcEMcwXR4yS9o PcQkq2dDMh4BI9ZdSmPBdLMyBDzgPDHoGTmmYqasZb+aFNORgdTzGBO70CDLCYlNp68a PuevIudB09mlLqzk77EdwfmtwsfXlU6e+DIckZXJSBCfn0KMF9kEfW7hdNUrVsYu1De0 iP7Pfl+l50TAvUl39CXsZW0RvVAK8X9qH9SGpsryHz/8r9/e7YiB5HQOnMLEMbEOm50T IwuhA1B3/AFV7enA7FU7/gD9TrE0mR4NBr1rRfLLLaA8Plybh04JdfXWpEwU4S+hOOEC eLtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a186-v6si693888pge.55.2018.10.12.02.24.00; Fri, 12 Oct 2018 02:24:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728247AbeJLQzG (ORCPT + 99 others); Fri, 12 Oct 2018 12:55:06 -0400 Received: from mail.bootlin.com ([62.4.15.54]:44700 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728036AbeJLQzF (ORCPT ); Fri, 12 Oct 2018 12:55:05 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 8AA2A207BB; Fri, 12 Oct 2018 11:23:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-7-245.w90-88.abo.wanadoo.fr [90.88.129.245]) by mail.bootlin.com (Postfix) with ESMTPSA id 41B5F20898; Fri, 12 Oct 2018 11:22:58 +0200 (CEST) Date: Fri, 12 Oct 2018 11:22:59 +0200 From: Boris Brezillon To: Arnd Bergmann Cc: David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd , Linux Kernel Mailing List Subject: Re: [PATCH] mtd: sa1100: avoid VLA in sa1100_setup_mtd Message-ID: <20181012112259.56f3c44f@bbrezillon> In-Reply-To: References: <20181010184533.691620-1-arnd@arndb.de> <20181012111603.0d03e043@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Oct 2018 11:19:52 +0200 Arnd Bergmann wrote: > On Fri, Oct 12, 2018 at 11:16 AM Boris Brezillon > wrote: > > > > Hi Arnd, > > > > On Wed, 10 Oct 2018 20:44:50 +0200 > > Arnd Bergmann wrote: > > > > > Enabling -Wvla found another variable-length array with randconfig > > > testing: > > > > > > drivers/mtd/maps/sa1100-flash.c: In function 'sa1100_setup_mtd': > > > drivers/mtd/maps/sa1100-flash.c:224:10: error: ISO C90 forbids variable length array 'cdev' [-Werror=vla] > > > > > > As far as I can tell, there is an upper bound on the number of resources > > > that can be passed, based on the number of CS lines on the bus. > > > In practice, all boards we support have either one or two resources, > > > but using six to be on the safe side has no extra cost. > > > > Why not dynamically allocate cdev instead? That removes any kind of > > guessing on the max value, and it shouldn't hurt much since this code is > > in the probe path. > > Fine with me as well, If you prefer that one, please just add > Reported-by: Arnd Bergmann Oh, I thought I'd let you send a v2, but I can do it if you prefer.