From patchwork Tue May 7 16:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657462 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC682C25B5F for ; Tue, 7 May 2024 16:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yOxSJPYMVILXVHKr9QFGiN3vyCzsOlNMM+g8RZc0kjs=; b=aW72+77ZjGeMbW yDtYaWGquKiEZNGiSJIm4GW7Mp7OHhAyj1mxikIuE7cHMIcSiZcfnhdQGC60c4mX8/TOi5aRr3m2/ +zryLO/HJpmY4YPNsEKrhwP8nPOt8+1p29u7P4zuEo+DLQQuy+VY4eZl2kKUuwO0WPitwDRAo6ZRi fBXuHnfqmKYVXV8fjjdzHbBK/Np0uYtsEiybTQI0f0SNWZXn/Y2/UguLbj0CkWGOaj1qieTPk4VwL M1ld9N8ZVac9navxUnno7FDp2oVxe0m+4W6OGFNvlHpTvtvOq1maqmwoWEToDjRVLHNVPRpC916nn 07rmGz+LKFy1KGkTIkjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4NfB-0000000Bxng-3VYs; Tue, 07 May 2024 16:27:33 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4New-0000000BxSv-0Fns for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:21 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-43d4a2d0a0bso16203501cf.3 for ; Tue, 07 May 2024 09:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099231; x=1715704031; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dp/a3NMmYGz+hm8qsmJibF9yTx35ajv4b4FGHxOOJ3Q=; b=nv3qy9V4blMaefzr8FvS0U9cYa37erTWvw4f/LOhhe/DR6ziJ3sHaA76pwaDdUfnNi ddV8buBjMdwKGKGDGA8hzsXaQrCV5YhqOx16CTNyAFg7eqNwZs1uabvTA4wKCRs13hdo Q3NzdrDsuchn66jhdA6KGvPtJN6l80b7zm0ls= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099231; x=1715704031; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dp/a3NMmYGz+hm8qsmJibF9yTx35ajv4b4FGHxOOJ3Q=; b=DZPTs2tIEZFVOoczHvSoa6ejmpLjsBZS+GIVbCsJsj++/iQ+ZWt55iCPabi54iT6SH tcT8ke6D0SdpWvXeLyUhBPMr/+FU+gHcJ5BES8rE+2AHHmc4yp2Op9MlqXlSj7Sk+pej pEZRjCyTJFnadzFvJt0DW+/X9qJAVdGk3CgWo/Em9/XWFw+khMTtR1sMaN0jM7W8j03q USAZuQEUbMu6QSmcyrtwkYWP8SQldoiDwdoXne4SleEfh/zn2HUrOHGVy8Xzwby1jI+U c9oC4ySF3CUt9yv7fe5j8KT/G2dc0rlCxuSsF7/ArsH+8yv7oGDCesPcpefNzIYNbjZZ sBBA== X-Forwarded-Encrypted: i=1; AJvYcCUomsIgq7/iL4x1Sd6fYTuxq+aZoEGEDYw9kd3RNmzSQSvvshjBQZDhBS0DNSOiYC6VA4pCgVaPeW9Vi/zktUmhWyzjLwy+xNeJ+oGqlg0zqbrdccg= X-Gm-Message-State: AOJu0YzBxRJDWsT8JWHQL+PYyRgloavseIf9WpGtIT/fSsjynH64sXqq gE+J4Y6SnWu1Jw30ld7xq1U7rcXJHDAL01p3IquBCXGDR01SqQH3kj9u4fVJjA== X-Google-Smtp-Source: AGHT+IEOeHKGmS3SHashwweKO/vUQBNCSRFTe5jpqSXB3JxcQpvTp7L0R+6KghhNE4f3RITfPrM5nw== X-Received: by 2002:ac8:5753:0:b0:43a:f64f:c2a with SMTP id d75a77b69052e-43dbf853b66mr1566601cf.46.1715099231571; Tue, 07 May 2024 09:27:11 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:10 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:07 +0000 Subject: [PATCH v2 02/18] media: xilinx: Refactor struct xvip_dma MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-2-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092718_253077_D51CE621 X-CRM114-Status: GOOD ( 13.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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) Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart --- 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)