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=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 4EAA8C47257 for ; Sat, 9 May 2020 15:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2EA4E214D8 for ; Sat, 9 May 2020 15:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589039032; bh=o1bX8Zql/kQ5+2VP0PxQWxTrOXX0zwKggYwZhmcqNrs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=q3IjNhNWEyH1anRnLzEF+sTLR8bcjcYVsNOVmpZCHHR+M8/fKAl8gaI+tOBoyOWs7 2igH5avBPcw2/mE+d0jCUfIy8onmUV02TqOsSxYCjUoOPgWSBKxDyZs09eNQz9gKeH sNttGXaPFRf4XJU3lEEaR9ZpWT0hGdXSXokpthMM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbgEIPnt (ORCPT ); Sat, 9 May 2020 11:43:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:39672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbgEIPnt (ORCPT ); Sat, 9 May 2020 11:43:49 -0400 Received: from embeddedor (unknown [189.207.59.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2CEF2063A; Sat, 9 May 2020 15:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589039029; bh=o1bX8Zql/kQ5+2VP0PxQWxTrOXX0zwKggYwZhmcqNrs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DAXEZFtgE82+8ztfFy+75+0SXtIGD9rjTnRytb7gq+fU+tGx4hbaaWmS2NcxsN+Pt jSeaNmSSiVN2iqylQqSMRdrnQ//OygB2q713StgEDppDnCYpiSQumAGbLQaolzFh+k PJ9TtJmxAEV+9tAf+Z7IF89wjHUFlaKH1C2BrKBQ= Date: Sat, 9 May 2020 10:48:18 -0500 From: "Gustavo A. R. Silva" To: Arnd Bergmann Cc: Kalle Valo , "Gustavo A. R. Silva" , Michal Kazior , Kalle Valo , "David S. Miller" , Wen Gong , Erik Stromdahl , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] ath10k: fix gcc-10 zero-length-bounds warnings Message-ID: <20200509154818.GB27779@embeddedor> References: <20200509120707.188595-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200509120707.188595-1-arnd@arndb.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Arnd, On Sat, May 09, 2020 at 02:06:32PM +0200, Arnd Bergmann wrote: > gcc-10 started warning about out-of-bounds access for zero-length > arrays: > > In file included from drivers/net/wireless/ath/ath10k/core.h:18, > from drivers/net/wireless/ath/ath10k/htt_rx.c:8: > drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_htt_rx_tx_fetch_ind': > drivers/net/wireless/ath/ath10k/htt.h:1683:17: warning: array subscript 65535 is outside the bounds of an interior zero-length array 'struct htt_tx_fetch_record[0]' [-Wzero-length-bounds] > 1683 | return (void *)&ind->records[le16_to_cpu(ind->num_records)]; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/wireless/ath/ath10k/htt.h:1676:29: note: while referencing 'records' > 1676 | struct htt_tx_fetch_record records[0]; > | ^~~~~~~ > > Make records[] a flexible array member to allow this, moving it behind > the other zero-length member that is not accessed in a way that gcc > warns about. > > Fixes: 3ba225b506a2 ("treewide: Replace zero-length array with flexible-array member") This treewide patch no longer contains changes for ath10k. I removed them since Monday (05/04/2020). So, this "Fixes" tag does not apply. Thanks -- Gustavo > Fixes: 22e6b3bc5d96 ("ath10k: add new htt definitions") > Signed-off-by: Arnd Bergmann > --- > drivers/net/wireless/ath/ath10k/htt.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h > index 8f3710cf28f4..aa056a186402 100644 > --- a/drivers/net/wireless/ath/ath10k/htt.h > +++ b/drivers/net/wireless/ath/ath10k/htt.h > @@ -1673,8 +1673,8 @@ struct htt_tx_fetch_ind { > __le32 token; > __le16 num_resp_ids; > __le16 num_records; > - struct htt_tx_fetch_record records[0]; > __le32 resp_ids[0]; /* ath10k_htt_get_tx_fetch_ind_resp_ids() */ > + struct htt_tx_fetch_record records[]; > } __packed; > > static inline void * > -- > 2.26.0 >