From patchwork Tue May 7 16:27:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657475 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 0ACB7C25B4F for ; Tue, 7 May 2024 16:28:36 +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=PgS0DtdRe4cXNtmNJKJcPLwOal8073jJHJmev6VcxvU=; b=3VomhGOsdkA3yB AkoMLQB1dOPc8IW4GKHZgavMKyun56dUPGKlAsaHwDSXLFcTue6VZw25RpC/gjz36Gs5NwnfCwxWk u+qPe+fayXDc9c+no3dx3BKeNE5hFjfJBQcW+5jGGNOJLhw+OxsGlaBPiSsx5lvrtxXFd8pcnleaG SzmWTPQBBGGzVoTg+rqI7A4DML81XTzLr1VWjJcdoMTv3P3QzwPQIXTk+2iXR+5vBYOz2FD5ZB/H5 BOdMGS5z1KzRJMhXaSw1k3a9mqGc0QTgv1q8Dd/MIbDyMwSQaaZWXgA3ylB55KYBmMmXFRnpYmSor f9oSVkbaS6iBGonOh2Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nfu-0000000ByRU-3v3s; Tue, 07 May 2024 16:28:18 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Nf5-0000000BxfN-3zXE for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:31 +0000 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-43ab76cac73so31119691cf.1 for ; Tue, 07 May 2024 09:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099244; x=1715704044; 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=LytlgeivFEVadVFPCSFVFsEkz0aZMS5bY0SwfM06VYA=; b=alhL6So3Yk/3pUugYykO2uZY9YF4hpeR0Z3CaVtWnkTf74RbXGYnWC5Zo6vYQi4W1B ekEcvS75RbgT8VAEDciB4ImYVsnegq1kU5v77s4apAhNfx3/DOog4kheeQGC/yXZLlxl aenUclyOJ/VT2P+j7DuaewRFTnUVnifHUDLPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099244; x=1715704044; 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=LytlgeivFEVadVFPCSFVFsEkz0aZMS5bY0SwfM06VYA=; b=EMS1RIMhOUs28EQ1CxBRDJZnepcF6TQ4whuAdfk1HEK5s1RTybSJ9mqEo5i9ulQHQu j5li0tOAs6zsOp4mzlf89nBa+1mT1ULaSaT26ESJhwX8l2S8tH6it6r07x/uPC55KCVE 54VUF3xLre2MV0V9b3WlyzNwQ4LaAQ2Q9gjiS1QpDhI42Ze1FzjM/ondfaptnESUU+u8 kgv9S5mnALTUhaB0EWVaG4tjGOzF60rsgSPa/JDMACT/44r4wWjtHqYQ4hOEukzh+tZ7 mN6BzxCB+rIV230Tg/pudn2Ulekny7lTj4HSjKMSMvKmric6xzgvYk3wMfCwcBIjjb5G c+bQ== X-Forwarded-Encrypted: i=1; AJvYcCU0tEeAv/6YPn34V3FVD6y9RtV7AzZxn2J+CVUMsNBjZP4kXQ2jK228w6EOnMJAHeZa94mAFaJDfu+KoXo1tfm1iGzGFIS2qDIYPnuN/VfGKUqqqxA= X-Gm-Message-State: AOJu0YwGImqDodYUWN30EBDH2CJ7RSvpKznatV28NWRHNelQutlQix8d BZo1s97EZkngkCjzVNW2q203kzad+4McZjFYi46Hq8r2w4ubjSCI0QVP2/cP0w== X-Google-Smtp-Source: AGHT+IH3mMeaAQ3dPkDbtiyOlqK0t/M43w6OxFHdMVW2XCWSC0GBNoCeALnYs1IDQynVDH2ifLt8lg== X-Received: by 2002:ac8:7d0a:0:b0:43b:173e:ce1b with SMTP id d75a77b69052e-43d8f7cec66mr50519711cf.32.1715099243729; Tue, 07 May 2024 09:27:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:23 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:22 +0000 Subject: [PATCH v2 17/18] media: venus: Refactor hfi_session_fill_buffer_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-17-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_092728_083711_70C48B03 X-CRM114-Status: GOOD ( 13.90 ) 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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue --- 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 c5123f2e76fe..35423e211ddd 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->extradata_size = 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 cd7902743f62..0ccc4102ac3d 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 extradata_size; }; struct hfi_session_flush_pkt {