From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 52B70C47254 for ; Tue, 5 May 2020 15:44:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32ED0206B9 for ; Tue, 5 May 2020 15:44:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="SMiFsUzX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730655AbgEEPo4 (ORCPT ); Tue, 5 May 2020 11:44:56 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:60585 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730627AbgEEPoz (ORCPT ); Tue, 5 May 2020 11:44:55 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588693494; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=S242E4d9Q+x3WazT0LfEblmsx0Y/I8PQEL3G5k/rxP8=; b=SMiFsUzXh4h2q5v09w6VK/z4KlFQPDbXK/TMlE/yYfm4E1NkEverc1F1ynYP/fDXe6ivG8BP t1SbpUl6hptrm43o+wCtPksYoMGPhr5yPKClCNTW7mtiNNAf2fGsyllUCRzaqxVevG4yfH7Z 73feyFL2CX6FS41dviYSjT31g6E= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5eb189e5.7fcd01fa8c38-smtp-out-n03; Tue, 05 May 2020 15:44:37 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 03FD1C44788; Tue, 5 May 2020 15:44:36 +0000 (UTC) Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6992FC433F2; Tue, 5 May 2020 15:44:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6992FC433F2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Arnd Bergmann Cc: Maya Erez , "David S. Miller" , Dedy Lansky , Ahmad Masri , Alexei Avshalom Lazar , Tzahi Sabo , "Gustavo A. R. Silva" , Lior David , linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] wil6210: avoid gcc-10 zero-length-bounds warning References: <20200505143332.1398524-1-arnd@arndb.de> Date: Tue, 05 May 2020 18:44:31 +0300 In-Reply-To: <20200505143332.1398524-1-arnd@arndb.de> (Arnd Bergmann's message of "Tue, 5 May 2020 16:33:24 +0200") Message-ID: <877dxqcrog.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Arnd Bergmann writes: > gcc-10 warns about accesses inside of a zero-length array: > > drivers/net/wireless/ath/wil6210/cfg80211.c: In function 'wil_cfg80211_scan': > drivers/net/wireless/ath/wil6210/cfg80211.c:970:23: error: array > subscript 255 is outside the bounds of an interior zero-length array > 'struct [0]' [-Werror=zero-length-bounds] > 970 | cmd.cmd.channel_list[cmd.cmd.num_channels++].channel = ch - 1; > | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ > In file included from drivers/net/wireless/ath/wil6210/wil6210.h:17, > from drivers/net/wireless/ath/wil6210/cfg80211.c:11: > drivers/net/wireless/ath/wil6210/wmi.h:477:4: note: while referencing 'channel_list' > 477 | } channel_list[0]; > | ^~~~~~~~~~~~ > > Turn this into a flexible array to avoid the warning. > > Signed-off-by: Arnd Bergmann > --- > Gustavo has a patch to do it for all arrays in this file, and that > should get merged as well, but this simpler patch is sufficient > to shut up the warning. I don't see Gustavo's patch yet so I'll take this one first. -- https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches