From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57B55C433EF for ; Thu, 30 Sep 2021 11:48:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41AAE615A2 for ; Thu, 30 Sep 2021 11:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350584AbhI3LuA (ORCPT ); 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CC19C433F5 for ; Thu, 30 Sep 2021 11:49:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DFD16162E for ; Thu, 30 Sep 2021 11:49:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0DFD16162E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7394F1695; Thu, 30 Sep 2021 13:48:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7394F1695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633002557; bh=GYD0ulTbt/g3qX2pqLkxMLDSXqI6bFg1iOCPLKmBXhU=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TV1/+AyI3RWWpCH7CMUDqmvB54KVEG+XoASQg1GvoLpKsa7LQm9SBgbgOcXb8aOI6 zmr16xODrlX+ElLynb/uWVG9ScML15gzz5u9tNHkIo3pX/Eal8zCdHbeFDalP4ZlUx o/5TgSraQiMpckOqVgd+kWNo1nbBTcU+ahZe6rkY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CF1F4F804AD; Thu, 30 Sep 2021 13:48:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E7E0F804BC; Thu, 30 Sep 2021 13:48:25 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 025B7F8032C for ; Thu, 30 Sep 2021 13:48:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 025B7F8032C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Q5XUM5/8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="HJC7FgSz" 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" 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 Cc: alsa-devel@alsa-project.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Takashi Iwai , Anton Yakovlev , virtualization@lists.linux-foundation.org, linux-hardening@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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