Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp284616pxb; Thu, 30 Sep 2021 06:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTSYxhqDe+n3MafMLR8NaCFEu1N9dyVlWhWppZDAuZgV5qhfOc7ifr3Lt5TpS9lXmlcAbo X-Received: by 2002:a62:6d07:0:b0:446:c141:7d2d with SMTP id i7-20020a626d07000000b00446c1417d2dmr4194038pfc.28.1633007260860; Thu, 30 Sep 2021 06:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633007260; cv=none; d=google.com; s=arc-20160816; b=lrWk4bzafGNo63rzBFX/Lidxd6+jr2f6pSsB7bcihGh4O4NEYKu06AXBS+vuUKPska syk8JsBzu8aVTOXYTp3mwRt8qv1gg7ZkQJS+26Cp9To5Y7bDpSp9bo+L1ae/fDAUuOgx MQI6EL2OiXqVTk90HFqrojn1XifIvBvMGEZAKC3nOnIA4w1YmAtBFStE3uQqWsp3Dsvd ybwK45eHND6R9CzaaZP2oU+uDMqDjO9DWkaeDHE6ogYjJdMyLt/zMXfoME14aq5wb4Cj JwTxK1Ni4asfFX5PxcHqm7f446sj++BpI/g7jdoOXRhYd+K2+Xbw0J8/v4j0/2X4MnZU R2Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature; bh=ODCAoKormRMtsWMKmm9fOWai9zDZSbllUaXvae+Mu9A=; b=MWngY1Hn9luEX+8SfZcD/gcSgSf6J4AzkULjpILnobMz51bpz2p0AKWO+e8Id2UajT VR+ZK7+COtUrS1db/KBwurSSRsVi/vfLK9YgOBfMWEtTf65JLVTCX6uXduTvQ+E6zMGJ nlRw2xS28AuZV5iMskgIssK3+IzfChwhkTrr16gfZ32NWx3HnZlKahL1UXPGle0gd47O QfaAN/372ngJnLrWoKlmg3hPuPPVnnhckDGO/fZLAzlGXZmuYeEJ/mhUn/67qPYk30rY 9e1lettvAM4dcosx5qkSUkPEG+zpmHbtOMGF0MrPimkQXEYpHqPY5O49Tc1wXccDJKZh oYEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Q5XUM5/8"; dkim=neutral (no key) header.i=@suse.de header.b=HJC7FgSz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 202si3468730pfz.310.2021.09.30.06.07.23; Thu, 30 Sep 2021 06:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Q5XUM5/8"; dkim=neutral (no key) header.i=@suse.de header.b=HJC7FgSz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350577AbhI3LuA (ORCPT + 99 others); Thu, 30 Sep 2021 07:50:00 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:58050 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350490AbhI3Lt7 (ORCPT ); Thu, 30 Sep 2021 07:49:59 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id F2C7A2247F; Thu, 30 Sep 2021 11:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1633002496; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ODCAoKormRMtsWMKmm9fOWai9zDZSbllUaXvae+Mu9A=; b=Q5XUM5/8K8nVicS+NqiAuTRhwfflSUGx82yCKJOFw3KAB8txn61CdplSvuiNUhbsEHjenK X0ZVOqLAdK5H/Hiv87KmPH7r5Qf91pHjM+M80TabVHhjuV/Hdus6XvUUMXMQt/Fza3vIUI laz22shLmoeHBy50vnbXrzgs1nh74Z4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1633002496; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ODCAoKormRMtsWMKmm9fOWai9zDZSbllUaXvae+Mu9A=; b=HJC7FgSzY9LlldTNKeChZ0JmUqI1pfI3d4ZSSGpzRuA1aRBC55Mrr8CLDNs5eGKwciAc2L 7/C7CtHnLrhDY2AQ== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id E9FDBA3B93; Thu, 30 Sep 2021 11:48:15 +0000 (UTC) Date: Thu, 30 Sep 2021 13:48:15 +0200 Message-ID: From: Takashi Iwai To: "Gustavo A. R. Silva" Cc: Anton Yakovlev , "Michael S. Tsirkin" , Jaroslav Kysela , Takashi Iwai , virtualization@lists.linux-foundation.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] ALSA: virtio: Replace zero-length array with flexible-array member In-Reply-To: <20210929191504.GA337268@embeddedor> References: <20210929191504.GA337268@embeddedor> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Sep 2021 21:15:04 +0200, Gustavo A. R. Silva wrote: > > There is a regular need in the kernel to provide a way to declare > having a dynamically sized set of trailing elements in a structure. > Kernel code should always use “flexible array members”[1] for these > cases. The older style of one-element or zero-length arrays should > no longer be used[2]. > > Also, make use of the struct_size() helper in kzalloc(). > > [1] https://en.wikipedia.org/wiki/Flexible_array_member > [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays > > Link: https://github.com/KSPP/linux/issues/78 > Signed-off-by: Gustavo A. R. Silva Thanks, applied. Takashi