From patchwork Tue Dec 22 21:09:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11987337 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=-20.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 7CCC0C433DB for ; Tue, 22 Dec 2020 21:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3461C22ADC for ; Tue, 22 Dec 2020 21:10:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727960AbgLVVKC (ORCPT ); Tue, 22 Dec 2020 16:10:02 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:27192 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727954AbgLVVKB (ORCPT ); Tue, 22 Dec 2020 16:10:01 -0500 X-IronPort-AV: E=Sophos;i="5.78,440,1599516000"; d="scan'208";a="368372272" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2020 22:09:19 +0100 Date: Tue, 22 Dec 2020 22:09:18 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , "Rafael J. Wysocki" , Len Brown , linux-nvdimm@lists.01.org cc: linux-acpi@vger.kernel.org, Denis Efremov , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI: NFIT: fix flexible_array.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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: 7b36c1398fb6 ("coccinelle: misc: add flexible_array.cocci script") CC: Denis Efremov 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/torvalds/linux.git master head: 148842c98a24e508aecb929718818fbf4c2a6ff3 commit: 7b36c1398fb63f9c38cc83dc75f143d2e5995062 coccinelle: misc: add flexible_array.cocci script :::::: branch date: 20 hours ago :::::: commit date: 2 months ago core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2268,7 +2268,7 @@ struct nfit_set_info { u64 region_offset; u32 serial_number; u32 pad; - } mapping[0]; + } mapping[]; }; struct nfit_set_info2 { @@ -2279,7 +2279,7 @@ struct nfit_set_info2 { u16 manufacturing_date; u8 manufacturing_location; u8 reserved[31]; - } mapping[0]; + } mapping[]; }; static size_t sizeof_nfit_set_info(int num_mappings)