From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hO0X2-0003eJ-UF for ath10k@lists.infradead.org; Tue, 07 May 2019 13:53:42 +0000 MIME-Version: 1.0 Subject: Re: [PATCH][next] ath10k: coredump: use struct_size() helper From: Kalle Valo In-Reply-To: <20190403190636.GA9827@embeddedor> References: <20190403190636.GA9827@embeddedor> Message-Id: <20190507135320.78AEE60DB3@smtp.codeaurora.org> Date: Tue, 7 May 2019 13:53:14 +0000 (UTC) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: "Gustavo A. R. Silva" Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, "David S. Miller" "Gustavo A. R. Silva" wrote: > Make use of the struct_size() helper instead of an open-coded version > in order to avoid any potential type mistakes, in particular in the > context in which this code is being used. > > So, replace code of the following form: > > sizeof(*ce_hdr) + CE_COUNT * sizeof(ce_hdr->entries[0]) > > with: > > struct_size(ce_hdr, entries, CE_COUNT) > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 4f735cd73650 ath10k: coredump: use struct_size() helper -- https://patchwork.kernel.org/patch/10884377/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k