Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp74276lqo; Tue, 7 May 2024 12:34:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWi/kIgYh8sPsjkkqq+dhuh9s8iD8iY6C+z+oZpECXbzJFD8uhk2kZYVQRJfIuuHNuOH1mzLhi+xPdJUemztNlvg1vfjMvXtNsxWVOOPw== X-Google-Smtp-Source: AGHT+IEXw2iOGPjHvBCIy+jU5IHSIB90JqA2MuChkS4DSHJ8HHY5jEmZc8w3JaTRwT1PJTDHrmaU X-Received: by 2002:ad4:5fcf:0:b0:6a0:cd1b:9f9f with SMTP id 6a1803df08f44-6a15147db7amr8543886d6.38.1715110476039; Tue, 07 May 2024 12:34:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715110476; cv=pass; d=google.com; s=arc-20160816; b=NPlKRdAJGbdBUfxcvIn+Zdu+RV09TehPy67KJ6TO/M44KIAvYokMQOse7w/KTfyADU HJzR7YR51DRnZc4yJDJV+jbM1LPlGK2umaTRbF3LMnQV4RvdyU0BgPER+aPLDUT+Toz7 WNJNUnikLtnTBALWUF1hlR1YV9F31sl9pcKzw/jA9nwXGzaR9CnF+YmNgaqMnzztXV0I 0UwbRZStWVgBCehjdEkR6ndVxmrjPjDssjKyQNXYCCwqHgLb+BAHDT9K4vvoIJ4yKvbQ 0ys3KPda9vtspjyI4vAyD9TMyEId2qGeQWIiQ+fgW4Q3NihJZ72K3u7y4Dyyw6I1Izhy 6rXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=slukwDkSZrPhrz6JDQQg94s1v2kVMEpodW5TWLVpRuU=; fh=ffCQZAKQzdTaKQ1QcH9qCRmCfGVptxEg6uH7A2gOcYs=; b=A4I+Mk4f8QruIluMu/Eut37UvHXwEJrQ7qib58S4rlzaxPgjWoTZu1vyqz922ckXpS 28UXSD9Y5o5KVF3oy6E3TDL+6voaj4I4SQO4ZB9J6MIsftBaU3IAiBU36+Yg/6WzD+RU l0OKE+6Db7G9DKyBUOaTlenaxcVGVmmhi2QB9DY442BbMtgiehDubkska50v5jEKbS0R 8UXG+jtU821O7B8wNoYK2H/Cv++y+81WM/abKD8ekuvpG+jRrLaw0+YScns2D9CKFhEZ KUJqVspi9Vqd43duLqJUH9MQWFmnJj6YgI7L5NMu/79nJuSxRW7yRB7h0BDFducu/IBj pF/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=A+vQwDRi; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-172065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172065-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ge1-20020a05621427c100b006a0d69556c2si12005458qvb.437.2024.05.07.12.34.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 12:34:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=A+vQwDRi; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-172065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172065-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BF2741C21D7E for ; Tue, 7 May 2024 19:34:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3061D16E870; Tue, 7 May 2024 19:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="A+vQwDRi" 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 EB02F14D2BE; Tue, 7 May 2024 19:34:22 +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=1715110464; cv=none; b=BakwmvGGnwhcQZHJi2KSfilPywi/zqcAWrUqqrBN8OycG/58Uqay8BaJH6Sb6hBHfMlvhU5pm4kjN4H4cpGQPeNS+A+pRhQ0hsqQuaZbLXtM1SyjaJfeCFPaSvnGW/VWT3+PxNvKIaBVxgvSmW5pIzCJgCgM6B/gHsmsaNnwx60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715110464; c=relaxed/simple; bh=JIzGYwzsIqdboqdXrPWYdf1tKATH1z3ErUquMcGhApk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iQzw9bZqKl2/7x4RHeNPznpqYKCdR13SbbKzeyoAztRRIoyBmFXwJ0F07m25YsSc5wtN2AJtXKDYZh27O5W1SIYtcp1fnamIi1AnqPT/q2npvpmPgW8KE7hqh7CdKcscch8wcfABiIXZ2cdS+qnIhXPs7V83ZOm/J9QxwYJAvBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (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=A+vQwDRi; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 68DAC9CE; Tue, 7 May 2024 21:34:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715110458; bh=JIzGYwzsIqdboqdXrPWYdf1tKATH1z3ErUquMcGhApk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A+vQwDRiW39L1GyVYDDr8Ke7BHjnv1ZRARyd9AgaMz9IZs7Bu4gl7CiR50V044kXh W3iGv3yvC1MYin7qslkmhmMbbPuEBRlTcIGhyk6dwI7AvvbNh1oW0O87GfKEFOVdtk YsmtKzbvBuEFl2Ip8FP64t1y9YI8P/qZP/O2hHr8= Date: Tue, 7 May 2024 22:34:12 +0300 From: Laurent Pinchart To: Ricardo Ribalda Cc: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil Subject: Re: [PATCH v2 02/18] media: xilinx: Refactor struct xvip_dma Message-ID: <20240507193412.GB2012@pendragon.ideasonboard.com> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> <20240507-cocci-flexarray-v2-2-7aea262cf065@chromium.org> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240507-cocci-flexarray-v2-2-7aea262cf065@chromium.org> Hi Ricardo, Thank you for the patch. On Tue, May 07, 2024 at 04:27:07PM +0000, Ricardo Ribalda wrote: > Replace a single element array with a single field. > > The following cocci warning is fixed: > drivers/media/platform/xilinx/xilinx-dma.h:100:19-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) This is a false positive, as I really meant ab array with a single element, this isn't a VLA. I think the current code is a bit clearer, but I don't think this patch is such a regression in terms of readability that I'll argue for the driver to remain the last coccinelle warning :-) Reviewed-by: Laurent Pinchart > Signed-off-by: Ricardo Ribalda > --- > drivers/media/platform/xilinx/xilinx-dma.c | 4 ++-- > drivers/media/platform/xilinx/xilinx-dma.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c > index a96de5d388a1..a1687b868a44 100644 > --- a/drivers/media/platform/xilinx/xilinx-dma.c > +++ b/drivers/media/platform/xilinx/xilinx-dma.c > @@ -348,8 +348,8 @@ static void xvip_dma_buffer_queue(struct vb2_buffer *vb) > } > > dma->xt.frame_size = 1; > - dma->sgl[0].size = dma->format.width * dma->fmtinfo->bpp; > - dma->sgl[0].icg = dma->format.bytesperline - dma->sgl[0].size; > + dma->sgl.size = dma->format.width * dma->fmtinfo->bpp; > + dma->sgl.icg = dma->format.bytesperline - dma->sgl.size; > dma->xt.numf = dma->format.height; > > desc = dmaengine_prep_interleaved_dma(dma->dma, &dma->xt, flags); > diff --git a/drivers/media/platform/xilinx/xilinx-dma.h b/drivers/media/platform/xilinx/xilinx-dma.h > index 9c6d4c18d1a9..18f77e1a7b39 100644 > --- a/drivers/media/platform/xilinx/xilinx-dma.h > +++ b/drivers/media/platform/xilinx/xilinx-dma.h > @@ -97,7 +97,7 @@ struct xvip_dma { > struct dma_chan *dma; > unsigned int align; > struct dma_interleaved_template xt; > - struct data_chunk sgl[1]; > + struct data_chunk sgl; > }; > > #define to_xvip_dma(vdev) container_of(vdev, struct xvip_dma, video) -- Regards, Laurent Pinchart