From patchwork Fri Dec 3 09:44:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12654565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0425C433EF for ; Fri, 3 Dec 2021 09:45:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44E5D6B0072; Fri, 3 Dec 2021 04:44:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FCD56B0074; Fri, 3 Dec 2021 04:44:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EC356B0075; Fri, 3 Dec 2021 04:44:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id 1F6466B0072 for ; Fri, 3 Dec 2021 04:44:57 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DE15389D4D for ; Fri, 3 Dec 2021 09:44:46 +0000 (UTC) X-FDA: 78875998572.07.370F8C6 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by imf19.hostedemail.com (Postfix) with ESMTP id 34E3BB0000A5 for ; Fri, 3 Dec 2021 09:44:45 +0000 (UTC) IronPort-Data: A9a23:ewDhkK6Yx6AvaCeURWuN7AxRtH3GchMFZxGqfqrLsXjdYENSgzdUzmZKWWuOPP+CNjajeI0kbNiyp0MAsMODmoM1GQY5pCpnJ55ogZqcVI7Bdi8cHAvLc5adFBo/hykmh2ipwPkcFhcwnT/wdOi+xZVA/fvQHOOlUraeYnsZqTJME0/NtzoywobVvaY42bBVMyvV0T/Di5W31G2Ng1aYAUpIg063ky6Didyp0N8uUvPSUtgQ1LPWvyF94JvyvshdJVOgKmVfNrbSq+ouUNiEEm3lExcFUrtJk577e0EQQ7PUVeSMoioLHfbyxEEY/2prjf1T2Pk0MC+7jx2LgtRwwZNJvIO5TQMBP6vWme1bXQMw/yRWbfQdoeKcexBTtuTWlSUqaUDE3fB/EEcnPqUd8/xpDGVKs/cfLVglbRqehua6hbu/TsFoh98/N4+zZcUYoH4I5TXYC+s2BJXGa6bU7NRbmjAqiahmBvvEZ8sILzBobRfHSxhGIEkaDJZ4l+Ct7lHjeD1fslSEpIIy6nLNwQh1lrPqNbL9ecGATO1Wk1yeq2aA+H72ajkcOcCTxCSt7H2hnKnMkDn9VYZUE6e3ntZugVuO1ikQBQcQWF+Tv/a0kAi9VshZJkhS/TAhxZXeXmTDosLVBkLj5ife51hCC5wATqsg5R/L0aTOpQCUGgA5ovd6QIROnKcLqfYCjDdlR+/UOAE= IronPort-HdrOrdr: A9a23:SAs6O6ifFRbQn3FR4TTqWRlBx3BQX4x13DAbv31ZSRFFG/Fws/re7cjzsiWEwQr5OUtQ0exoXZPwJU80mqQFm7X5V43OYODZghriEGgP1/qU/9SCIVyBygc+79YcT0EkMqyFMbESt6+Ti2XWYrRQpajhgcbY/JanvgxQoBlRGsJdBmFCe3Cm+2JNNUN77PECZemhD6R81kadkDgsH7uG7rhsZZmwm/T70LbvYRsDDxliwBCWljW25LO/OwXw5GZvb9vBqY1ShFQt/jaS2oyT986W8SL9/Uf3q7Ru3OP8wsBKA9GNjcRQChiEsGiVTbUkZJG4gRAeiMTqyG9vqvPlhDANEq1Iik/5TyWLjSDR+yPJ9XIP0jvZ0FedxUHop9f0LQhbN/Z8 X-IronPort-AV: E=Sophos;i="5.87,283,1631570400"; d="scan'208";a="8131532" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2021 10:44:44 +0100 Date: Fri, 3 Dec 2021 10:44:43 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Volodymyr Mytnyk cc: kbuild-all@lists.01.org, Linux Memory Management List , Serhiy Boiko , Taras Chornyi , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: prestera: fix flexible_array.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 34E3BB0000A5 X-Stat-Signature: ue6j7tyh61o3qu55jnqsqzfao5iz4yhz Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of julia.lawall@inria.fr designates 192.134.164.83 as permitted sender) smtp.mailfrom=julia.lawall@inria.fr; dmarc=none X-HE-Tag: 1638524685-806493 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: kernel test robot Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead. Generated by: scripts/coccinelle/misc/flexible_array.cocci Fixes: 6e36c7bcb461 ("net: prestera: add counter HW API") CC: Volodymyr Mytnyk Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 9606f9efb1cec7f8f5912326f182fbfbcad34382 commit: 6e36c7bcb4611414b339173cdc33fdcb55c08f9e [4129/4921] net: prestera: add counter HW API :::::: branch date: 19 hours ago :::::: commit date: 3 days ago Please take the patch only if it's a positive warning. Thanks! prestera_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/marvell/prestera/prestera_hw.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_hw.c @@ -443,7 +443,7 @@ struct prestera_msg_counter_resp { __le32 offset; __le32 num_counters; __le32 done; - struct prestera_msg_counter_stats stats[0]; + struct prestera_msg_counter_stats stats[]; }; struct prestera_msg_span_req {