Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp529639imm; Fri, 12 Oct 2018 02:20:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV61/gG5BTE7XxMRTymLsKwhbXwxpm6wmT+J0Ev2jAO0AXiEuOfCRqVrqE0f7cWfdisJV25Vw X-Received: by 2002:a17:902:40d:: with SMTP id 13-v6mr5122995ple.257.1539336044475; Fri, 12 Oct 2018 02:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539336044; cv=none; d=google.com; s=arc-20160816; b=p9DY2bwXiGc0ok0e31XNQE2ntx3MNBUbTPnbKq65/J983BrQxuTyOTMAJzEFyb8O2k HYWnnvaET7+pP5ezy2n5dqSjXICSmA13bdIxWXH9ja1bNZwZy4yJQdj8nbPufJK2RvWZ Z9BSHFH2W1CWIAi/itqTIw86i2rMgudCIhx1ze/R+pRtQHUi9WrYjVE9N76fIVLvB0uE Av/2djT13tZ/6e7yO1Dtnix4kptkP86daKBjMHjYDJN8Mjes5SvKUZPsg/gNnuhW1Qmc jke29W72yBnu2kq016iQatFnNTmHwIC0GuEkdbfP8uiRWQZ4zCy3CCPAxWELdR9qq6tq lAfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=rJH0dagyMoUnPAmavYcDKlUhI/LfMK23K1YlfiKcvE8=; b=hQ1BhYQqoovjrjaROiqQXta/dZNqStEPfVukGCGm5Q1KeC5q8f4IZFnwGuHTSW7k3G pz59ty29csK1HIIqrvTNtnyaRluR7TtHkzYbjqB4lXN15EM4SPbfmt8eG6gZRn3IrN6H mRHWqq80Gzibmx6MtzlmlE5gjyflwhlznfUvOICKi4pqKAoDUOkD5Pq2QOvGWmFIJoQm mugQzUQVEZzKfRY1RcMWRkILUxlldAlhkb+wexS+2fxUA7Gj/VRkbydzyHTeHtg6PmuQ /mWzUi0jr2omQ2qw96HqYctknNXkSXK6UEWBAgFrlktfFU+HCWj60uG9ungoEzVgJ+75 IwpA== 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 1-v6si726347plr.72.2018.10.12.02.20.29; Fri, 12 Oct 2018 02:20:44 -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 S1728098AbeJLQvi (ORCPT + 99 others); Fri, 12 Oct 2018 12:51:38 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:36274 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727808AbeJLQvi (ORCPT ); Fri, 12 Oct 2018 12:51:38 -0400 Received: by mail-qt1-f193.google.com with SMTP id u34-v6so13130450qth.3 for ; Fri, 12 Oct 2018 02:20:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rJH0dagyMoUnPAmavYcDKlUhI/LfMK23K1YlfiKcvE8=; b=ernCfpC+earYa9Y68jUnLP72LiNVSt+/JdpdwUlKZv3bIHz4952ZHEi+d36iuSmTrF 9veOXKnMCPo5KN8LDpZfLzPWelQI+bf8jxUDReMn3QrGP08+IQUl3+FMcbvSan6X54Xa cwYLZPI11HltMbr80/S/R9nzcsJh8CKo4H6I28aD/LyQ9d+lcrn9SrBs/YnORavUxRLe zxOUTz+2lecXTad3FzlUfnS+BZ2W10ggxXVOSjhg41zM2qivUaZoM3kSKuJSpM+0j/VH DoUr6V4hsQjLq/EOxfXlDUymn5K4zzCZjhNat2msQmX81MQiJwwXj+tmGtvlMDlTeaJD Xfnw== X-Gm-Message-State: ABuFfohxj3N2vLPyhLLGWAPx1MtKZNIbAAOUjPVbZ3uUR0NckxjYKn3e /RF9NApxpAWM9tvWkns4EUkfdZg7K9uYRR9MhT8= X-Received: by 2002:aed:2aa1:: with SMTP id t30-v6mr4783004qtd.319.1539336008859; Fri, 12 Oct 2018 02:20:08 -0700 (PDT) MIME-Version: 1.0 References: <20181010184533.691620-1-arnd@arndb.de> <20181012111603.0d03e043@bbrezillon> In-Reply-To: <20181012111603.0d03e043@bbrezillon> From: Arnd Bergmann Date: Fri, 12 Oct 2018 11:19:52 +0200 Message-ID: Subject: Re: [PATCH] mtd: sa1100: avoid VLA in sa1100_setup_mtd To: Boris Brezillon Cc: David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-mtd , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Arnd