From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 E0A87277C9D; Wed, 29 Apr 2026 20:28:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777494486; cv=none; b=ebjCjvliTeUvEIP0MLAMVD6KhMkdYWPnDT5Ay8qiRXgg3KW29dmJXQ1x28nZc1+qrRDMWbVSsAFo7GNKeXNDSV2UjfZO+PvqnzLUy7HH+ACHrvy+gttb2Dt6mT2o+fLHybnTyJFDzD2JQoc+8qKoalUcox+vqHxm69paiZLtHG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777494486; c=relaxed/simple; bh=1WhgM7s9T8lW6CepEqkpok80KW4t2frLj0MmsJ97CGw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qJXaQsv2OtWKSo/tzWkYiqSeb1Q2kL7VJmFBo3pPDv+aToqK3SCrVdgiukP9KeZad8ZSJX1egqkcganjCth8LMB4KEa0vZyOVnPbt11FnlRK6lkf+SyT4i7Ri8SIwq+IWzs16fgjO7hdW+cRvSy6F3dwXmpqCht44ts8p73dofk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=hvZv2WbP; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hvZv2WbP" Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8B06C4BB; Wed, 29 Apr 2026 22:26:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1777494379; bh=1WhgM7s9T8lW6CepEqkpok80KW4t2frLj0MmsJ97CGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hvZv2WbPUcj8PXY4U2VeLOPhprcqJVhV0mf63yTHq3/7DHMi7MiAURSCj7kI4DwDb PcSqqViBPLyq1gloP1XHV1zMaCeqyQWq1MIxGJlApnoQBu72uQrHe1IwT8eJYXygy/ aGIQUBrxyO2GZkwTFigfUPxYqi+WHZE/9odR2Elk= Date: Wed, 29 Apr 2026 23:28:01 +0300 From: Laurent Pinchart To: "Gustavo A. R. Silva" Cc: Mauro Carvalho Chehab , Michal Simek , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Tomi Valkeinen Subject: Re: [PATCH][next] media: xilinx: Avoid -Wflex-array-member-not-at-end warning Message-ID: <20260429202801.GB132396@killaraus.ideasonboard.com> References: <20260429202449.GA132396@killaraus.ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260429202449.GA132396@killaraus.ideasonboard.com> I forgot to ask, how do you want to get this merged? Will you collect all similar patches and send a tree-wide pull request, or should they be merged by individual subsystems ? In the latter case, Tomi, could you please handle this with other Xilinx patches ? On Wed, Apr 29, 2026 at 11:24:50PM +0300, Laurent Pinchart wrote: > CC'ing Tomi Valkeinen. > > On a side note, Tomi, can I send a patch to add you to the "XILINX VIDEO > IP CORES" section of MAINTAINERS ? > > On Wed, Apr 29, 2026 at 01:55:27PM -0600, Gustavo A. R. Silva wrote: > > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > > getting ready to enable it, globally. > > > > Use the TRAILING_OVERLAP() helper to fix the following warning: > > > > drivers/media/platform/xilinx/xilinx-dma.h:99:41: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > > > > This helper creates a union between a flexible-array member (FAM) > > and a set of members that would otherwise follow it. This overlays > > the trailing members onto the FAM while preserving the original > > memory layout. > > > > Lastly, the static_assert() ensures the alignment between the FAM > > and struct data_chunk sgl; is not inadvertently changed, and it's > > intentionally placed inmediately after the related structure (that > > is, no blank line in between). > > > > Signed-off-by: Gustavo A. R. Silva > > Reviewed-by: Laurent Pinchart > > > --- > > drivers/media/platform/xilinx/xilinx-dma.h | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/media/platform/xilinx/xilinx-dma.h b/drivers/media/platform/xilinx/xilinx-dma.h > > index 18f77e1a7b39..65f6147ff6c6 100644 > > --- a/drivers/media/platform/xilinx/xilinx-dma.h > > +++ b/drivers/media/platform/xilinx/xilinx-dma.h > > @@ -96,9 +96,14 @@ struct xvip_dma { > > > > struct dma_chan *dma; > > unsigned int align; > > - struct dma_interleaved_template xt; > > - struct data_chunk sgl; > > + > > + /* Must be last as it ends in a flexible-array member. */ > > + TRAILING_OVERLAP(struct dma_interleaved_template, xt, sgl, > > + struct data_chunk sgl; > > + ); > > }; > > +static_assert(offsetof(struct xvip_dma, xt.sgl) == > > + offsetof(struct xvip_dma, sgl)); > > > > #define to_xvip_dma(vdev) container_of(vdev, struct xvip_dma, video) > > -- Regards, Laurent Pinchart