Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp557186lqs; Tue, 5 Mar 2024 09:24:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUhAMOOj3MHqerESGeq9KtCvSbQKuqi2muhzmSbEzaS+1VsT1NXcR5QnGFmueAGDsB/qJefzg9UW/2ciptd5O/oY/xsXRMTJyfyIaW0YQ== X-Google-Smtp-Source: AGHT+IFSF6DncUmu3lMRh2cSlLTHC8PWEIsJhMguwlKOy6qH7CNK96PgChpy4elSs5hJMayV/ujA X-Received: by 2002:a17:906:d148:b0:a45:67ce:5264 with SMTP id br8-20020a170906d14800b00a4567ce5264mr3668899ejb.56.1709659468062; Tue, 05 Mar 2024 09:24:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709659468; cv=pass; d=google.com; s=arc-20160816; b=H+Z4ejmxRScM0djlkxiKXf35IBsRF9GRPyVhoKFtQctff4BJnbwsnN9VkYT3BInMA0 FpdgVvs5kR1aE3AOif3WKPeyKpdz1+Nt0X09MZc2LA3sOi7+RR5jAo4KZ0AEqXrCraVr IIXy/CajWl0/kUpD61WoASH3//NX+1wLR4D7I9A+l6gX47YvzMZNx8OaKXRJ4vpI1fjC hR5iMXeVtS0SYhpg+zK56R/vOyB2Lh5ywYC4Bs9baSgsfjcSCsC2PmAT4bhm/Asdv0yo pKiKe1dp7ek8nuBfkXqDj5bzzog2JjNPJYvYYT2HX7WtChE91+4UFtBsA00q5q5IzFfE vG0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=bOTCjT58QEMYtV8iwWCa7GEUT6SQbdSXNpg0matb29s=; fh=LJWY4oSh86Wd8Or+RSp++FMvcH22XBXBZbHk1iLjC04=; b=q/wPzcjM+XQ4HtGs8MBL1kRyKZwzxUxLvxvzyt8VVyTrYtGprAWVdoAfbN2v0izPJv grNvc9gxCpotjN9gHCIiIcGfYR1sf8XHQtLOxfmsr/uqmeB58G0Z7iJydMRMcs6yGtv3 7NlNlCq3oLUJgKgzHjJoSO7gBRewQGr93iynVfZrSJj8RZPog9tVt8Wqz4PI+MNRftec xd5stc/oBN2+EwwAGvVWNrg2WM7EZsVBP68h9C/FkQT2KZE0YrYrbbUj2hbvAwxJSAJq RurjWWzftlsVGZ7OTCLA0uI5zjK0ZrJMUd/I+/AhmL9SxneMtRlbTxWyZSpPxgMG0xfl i48w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QrNdYMDP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e25-20020a1709062c1900b00a4452b31420si4852652ejh.246.2024.03.05.09.24.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 09:24:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QrNdYMDP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C6C8C1F24B61 for ; Tue, 5 Mar 2024 17:24:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34F0115491; Tue, 5 Mar 2024 17:24:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QrNdYMDP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 596CB944F; Tue, 5 Mar 2024 17:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709659459; cv=none; b=qrA8qMkyX558VbRh60H2uVwaAkkpESuwPGrDncUMHw9ar0ma1WI3WACOfCFRTcJlIcDy7+il9MzFrwOyiBZIGZmqA5r1QGXa7jl/iqxT4rJUjUBwm3lv3ACptjUTGhjloQpcFzYvJbmzCR9qWu2Hnv9w2FedHErTeNjeJQRJHmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709659459; c=relaxed/simple; bh=ulWrTp+lCV+gMNzuEsMt7+NdH9m0bIisaeuCfQ/H8QE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=flSugAaGgIw4eTyqox2Vbdeh/ORZ+IUHUGZSoTfWEo5CgEMVKw+KNQF59XwsK9XgfWKPYa2p/PeK1D1GVmR//KPsNN46HeWMa0MIV/s78jb3erV8BfnBaSJnK4fOeROPhNfYD/XqVFGAMPO9J44Y14NpCbfivDgz49WXlPJ3yKY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QrNdYMDP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE591C433F1; Tue, 5 Mar 2024 17:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709659458; bh=ulWrTp+lCV+gMNzuEsMt7+NdH9m0bIisaeuCfQ/H8QE=; h=Date:From:To:Cc:Subject:From; b=QrNdYMDPC/2tFJec41XasQKtNc041wNjuL5OO8PQ1hxCSb/ldGPYzjb0+xAueLtB5 QyGGFFB3eXPzuD8MP59Xwfh4Q5HbPZ8mqASpYcTd/uywW43rD4H0J6Y2l6jP+aH9Uz 03CnagADHeI4OrUvpjlxgEASx3VuVKCwrrhQOEKaV79BM2FUL/npnEXTRwFEVStAk+ KZDzeX71Cfeehmxe/IkcDIVpGK5wnQChaFYQc8HqYHKfZqCElrcT+MmF5Kd+FYfu1c Q3jROYzeJxzSaf9T4pG53d9VHi2Cy9BP1G15pbrsOa9L7MgDEd0WXxq/+tRS7S1poW iu/QSAT4pDzlA== Date: Tue, 5 Mar 2024 11:24:15 -0600 From: "Gustavo A. R. Silva" To: Takashi Sakamoto , Clemens Ladisch , Jaroslav Kysela , Takashi Iwai Cc: Kees Cook , linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux1394-devel@lists.sourceforge.net Subject: [PATCH 0/2][next] firewire: Avoid -Wflex-array-member-not-at-end warnings Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. So, we are deprecating flexible-array members in the middle of another struct. There are currently a couple of local structures (`u` and `template`) that are using a flexible `struct fw_iso_packet` as header for a couple of on-stack arrays. We make use of the `struct_group_tagged()` helper to separate the flexible array from the rest of the members in the flexible structure, and, with this, we can now declare objects of the type of the tagged struct, without embedding the flexible array in the middle of another struct. We also use `container_of()` whenever we need to retrieve a pointer to the flexible structure, through which the flexible-array member can be accessed. With these changes, we fix a couple of -Wflex-array-member-not-at-end warnings. Gustavo A. R. Silva (2): firewire: Avoid -Wflex-array-member-not-at-end warning ALSA: firewire-lib: Avoid -Wflex-array-member-not-at-end warning drivers/firewire/core-cdev.c | 9 +++++---- include/linux/firewire.h | 16 +++++++++------- sound/firewire/amdtp-stream.c | 8 +++++--- 3 files changed, 19 insertions(+), 14 deletions(-) -- 2.34.1