Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp61361rwb; Mon, 26 Sep 2022 14:46:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48vJhwbeTTC9itnx5FG+QPftEYc7/dIPfG0cQm6gR9utNCJCjC4gb7h7mLzCDT06AMOabx X-Received: by 2002:a17:902:ee52:b0:178:83e8:15da with SMTP id 18-20020a170902ee5200b0017883e815damr23982227plo.174.1664228801219; Mon, 26 Sep 2022 14:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664228801; cv=none; d=google.com; s=arc-20160816; b=vwwSEUj8OGHwhJ187aM3TVGYmJhTCC150+aXfot+ANMDmTz7IudjgBwgnx0YzGeB1Y iHSz7tGOAl8PIhPmQC7P3+JmZ4+nBAOMpYivLoD4s4DfHvywTVTS83x1B/RUMt8XAeEb 2f+gF2AIEPFsVs+6aHm3YvJ00/dJzZulLd3ZgU/S9gh9oKDqqFGrJo1baLFqujXMXM+R dOsbt5GI0l94b5rLco+1mIvSg2ZZtPTQc/yBLzYLVs02u2+BRdEFYSsTHkEAr6iHra82 ZQZfN+eyI5nTRIkCcpFHI7E2W++2rYFhkzy7MgyXUIjo4+MfSFgUI7FfLEnvbP88Qb+A nzwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=GCbrP8zSM2u/l4Tu1PSx31phFK++38+OOqHHJI0a9T8=; b=PcYwSqe27H94bD1IzlZVYJx4v7wfEOgGewKLtX96OyuET/tA/LrMDr1DX9gba9HPag JJPQyKw5Tq4JID+8AELgfSlS/BRPiLlchiQHwjEKzorm+f32+8Fi2ahnQSO5+LxOnwTw jyzpeNcytLjUyzMm9Abe1pq4nPMBexT6r1hRCQz1h/S/VIYjHkCuSl7QaN8dWO+TXdiR 3L+jyMMXeHwfRaHYnkqS23gJxeGP6jRRnLFjDNXD6Ab+VPUxnePxTX4xefNezOkwiilZ N1bL0Yv4n0IVxTdwWVsnDpodjHICtwz+ITn/T6Ccj4kd3JBnUEK4mfXxTJ8jaNN7Rjoc I6hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LdO+D7fr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a170902ce8300b00179cbd4ebbasi9360624plg.210.2022.09.26.14.46.28; Mon, 26 Sep 2022 14:46:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LdO+D7fr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiIZVlH (ORCPT + 99 others); Mon, 26 Sep 2022 17:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbiIZVlE (ORCPT ); Mon, 26 Sep 2022 17:41:04 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F123257557; Mon, 26 Sep 2022 14:41:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 5A973CE13C2; Mon, 26 Sep 2022 21:41:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48BDCC433D6; Mon, 26 Sep 2022 21:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664228460; bh=nJA1vq18hGF5czX+YZ/5cu1/Q/04JTv3WsfWyuNLU98=; h=Date:From:To:Cc:Subject:From; b=LdO+D7fr3NTekOZ9TO67LzdnRndI0bSiPuk/vaSCbQnh5IexuusEDs2JQSzOQX/+h IhZ/2ymVHFA+S68q8XKpPhonAyPaKWHq7ufKKqioe9KIYMYHySV3B/v9jMfAOwBmp6 Y95W2p68e7AzJBWJGNR4xZvU2FJ2UZZambRQ0pz101mm3piun/eEQGp/0AG6VahTll Y1dlozoUohWuLcC4s10H291NHlbNt+IyM1HgtlN6Mkv78emhcQCemBMXXbisPGW2pb qtmwVVJo9KRCKnyk7FpCgNt5bwYuZjPqfPw3gM6Il2YWx/hBp3Cf8dKQsg5RAUS89Q E5sMUgfSVkd3w== Date: Mon, 26 Sep 2022 16:40:55 -0500 From: "Gustavo A. R. Silva" To: Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] ASoC: SOF: control.h: Replace zero-length array with DECLARE_FLEX_ARRAY() helper Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: https://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/211 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva --- include/sound/sof/control.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/sof/control.h b/include/sound/sof/control.h index 7379a33d7247..983d374fe511 100644 --- a/include/sound/sof/control.h +++ b/include/sound/sof/control.h @@ -117,11 +117,11 @@ struct sof_ipc_ctrl_data { /* control data - add new types if needed */ union { /* channel values can be used by volume type controls */ - struct sof_ipc_ctrl_value_chan chanv[0]; + DECLARE_FLEX_ARRAY(struct sof_ipc_ctrl_value_chan, chanv); /* component values used by routing controls like mux, mixer */ - struct sof_ipc_ctrl_value_comp compv[0]; + DECLARE_FLEX_ARRAY(struct sof_ipc_ctrl_value_comp, compv); /* data can be used by binary controls */ - struct sof_abi_hdr data[0]; + DECLARE_FLEX_ARRAY(struct sof_abi_hdr, data); }; } __packed; -- 2.34.1