From patchwork Mon May 27 21:09: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: 13675838 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 93CE4C25B74 for ; Mon, 27 May 2024 21:10:33 +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=bs+zOl9MeBRuPqCl6Xx3T4QaPp/AnDuY/scwc9HqWNc=; b=umBGdoKWft17QD NWRk+SrxwpzxqravMpqhyckjC06junTKVXGa5HImLEi1hbEQOTzN91e+3ta/j2Rmtvz1gDydvVYSO 3loLdcPkzQuidai/id0KrmnfI/sNTkFuc4hvRoDIFnU/rHGkpt9G9vP/bwxQZSylVIJv6KjYigL8V pnksUBztgbTG0XlaCjWRDBVGpDuz5iviOxLirUGVb8qEP4Hxdqki4dTe6wlZLPLqkNMlF+cuY4tXj OoqJ4D4sAt2FCbOSyo/KZYHi42BzIh5caHIdV7eTHHuSTO8/zcWpv5e5rqUAmtmT7dzaJ3S+UC48+ +VXpKXQuCThwzgv35RgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBhbo-0000000GLB9-3jKR; Mon, 27 May 2024 21:10:20 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBhal-0000000GKGv-1pvz for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2024 21:09:17 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-62a08091c2bso1621777b3.0 for ; Mon, 27 May 2024 14:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844153; x=1717448953; 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=l3fZDWwdSfr806tKPwKAlFoXNkHe5euNILjrUm/nl8g=; b=Ag+jHrOQFDeRgrLRx6xo849IKeWYsvEED2XK/v8N7YV4uW6GPoTIQQcJa0JI3DwrEw G1bvuODrE5OO1hzjgeIUFcznTPmbAuVi/rQSRr9+7KNexUUnft8Ja5pgqg8IAhXlsrsU DF2fJqiYA+cejOk3UsqhAh59rBd/oQnVECpu8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844153; x=1717448953; 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=l3fZDWwdSfr806tKPwKAlFoXNkHe5euNILjrUm/nl8g=; b=uGv59jWoTfkSxqJUYSjT5P0T5YwuFfue3jL/S+tbadwHy1qIPk4fTInTIXLzpJRpAX jq1eC52TPftTv/KZYF1+oYa1BOm1oWgwwEC1+SBNbAYBJ7Nv9cW4uUHZKnAix6qY2vgY w5DnR6hmHJJsCvX6H7+47EwUc0r0/myL7WF0P1oZxX6CD8wN4UZymH18nLo+kQNa/Jui 2zz3XzEP95lr65LI9iA7gPKmokQ5TP2ovc0aRxii7hKQD3rKbckgtwsa+6IWtIf1WQIA SW8hatKwuVSnmr7qOK+H8vOlsPHlVbjk2Q8d+5tzt/zKwWiEcMtpCWl8vOlrThXifJv0 O/Lw== X-Forwarded-Encrypted: i=1; AJvYcCXj0N+LIqus23E9zF6ioC+zVE/omaqprz4c0q+H2c2dhsR0gyuPStjpVUMG3naZ9iKxgKk5b2bZ8JNJ7sDOril9bWQ3LIIH31zlEU0nbHqt7mp2gpQ= X-Gm-Message-State: AOJu0YyFMDZQlTW3EgzWgRfXbNBEJYpX0ktDjVeNCQcmBdCWZUkjBtTR +jkEpCJgpSnZwf47Hpa9xVuakV47j4eHUCae5n0+8Q0RK/3EbQeJEQu4L7+XPA== X-Google-Smtp-Source: AGHT+IE7yvawDvvPTW8z16+danN5kIYa/qq3kf2XRt5s2NEtmjukpOxQYCxbSk6UfuH55Or4GMU6Cg== X-Received: by 2002:a81:a105:0:b0:61b:3484:316b with SMTP id 00721157ae682-62a08da0820mr90061817b3.14.1716844152764; Mon, 27 May 2024 14:09:12 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:11 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:07 +0000 Subject: [PATCH v3 17/18] media: venus: Refactor hfi_session_fill_buffer_pkt MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-17-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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-20240527_140915_585040_A668DA4E X-CRM114-Status: GOOD ( 13.64 ) 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 The single data array data[1] is only used to save the extradata_size. Replace it with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:175:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Reviewed-by: Bryan O'Donoghue Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 0a4de8ca1df5..3ae063094e3e 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -331,7 +331,7 @@ int pkt_session_ftb(struct hfi_session_fill_buffer_pkt *pkt, void *cookie, pkt->alloc_len = out_frame->alloc_len; pkt->filled_len = out_frame->filled_len; pkt->offset = out_frame->offset; - pkt->data[0] = out_frame->extradata_size; + pkt->data = out_frame->extradata_size; return 0; } diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index f91bc9087643..daba45720ddc 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -172,7 +172,7 @@ struct hfi_session_fill_buffer_pkt { u32 output_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 data; }; struct hfi_session_flush_pkt {