From patchwork Tue May 7 13:18:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657248 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 64049C25B4F for ; Tue, 7 May 2024 14:31:28 +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=46D9IXQ0Wufn0Itk0GGfVnxOrfwvMSl2JJ+vj8ugDgw=; b=kuhBaoYHzF4KAY KZd+NP/dlaeaK8oigVRwe3h0mAWAle1hdfZ96o3T6WGMA9rYr9RHIF5k3rHFRXsPRR4pciR+Pw+WG lKCaa4CM+g+6wPb3OW2FMPte1m7k7QYJaCYWrZzy1Ts4Q/ALG2nk3+2aAusYFgjmNoqenLSIpEF+m Wpj73kMBA2LGjlY2qbtYgpbt74SsNBxxKd740rQBEPVrD7/VLdNva/2o58OthcJjKRscOzKhdj7Ds peh2+HWST/Ze/20CLGN3bHrPVZyEQhxJanHrZP+I2qJ9KolDnc0NHi8UvGZer/1luJdH9hofSYh6a S9RsdU7hqgZlQr9CbCSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Lqa-0000000BVzv-1zvd; Tue, 07 May 2024 14:31:12 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Kj8-0000000BATf-29P9 for linux-arm-kernel@bombadil.infradead.org; Tue, 07 May 2024 13:19:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=HfjON8bjREYmJip8CISeXBwAVi +stQWL9UxSSsidpg6B7mg03NivyTIaA1YjN1BW69ZW9wODQdXMLdbBt1PZWe9D5taDFFoljK3Sv/U toW8NQ0iT25zDgrkfXVQsEAJk2o1LrTcDVWBlNdl6L/W44nU9Rr0rB9vjWKM1G8ttUATRXmRpXye1 VeCUoKJXhr4Ro6Rf0QirkDbCL1UkTw5k8nwhWPRxQ4kG6PGcXcdfbqD/iY1xX0bBmzSX2sv1kVnhu QKId+Ta252dEkq/x+Y1+3YKDzFUmTwVbKvJE5xcUUUqbUtb8iXXecmilVqG0tbtWdVAMLssqXNgnY j+2fuE+g==; Received: from mail-qk1-f173.google.com ([209.85.222.173]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Kiy-000000026HI-2FlJ for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 13:19:24 +0000 Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-78f02c96c52so229834285a.1 for ; Tue, 07 May 2024 06:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087925; x=1715692725; 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=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=YLY51WFYF83nak+9HAganT1D+XCuPozFAXismSfO+OzS5Y/IYEphxipvuspbHCpNrx Hluruox0Zhwn1zUI7vOE+5bmgL4E4jyyDf6gna3JUB+51JkQkgSUy4zrSp9KY6HQUPRZ ieoJAv/cqHW/dasVIHbvUYYxDzpjgCgBaUfEQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087925; x=1715692725; 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=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; b=XnMbWu9tBJRUd2z6qMB/LFXgVJ0VLs+W2AKeb+kjmhBHlB/f206ZezJXHwozPUQmTX 8J6AJB9wAORaBIH4xXd5v3Usb8H6XD5Dvpt9Vj8TdYAJu6R3Ktot59m96wFr8ipeIHEI TOxe3oTjS/5dOjivYJLQgeqU4N/DUVVk+eJ8uLW3fQF0+KQCbTOneKDpSKRZU446DSMh uQq2E+B/tB+hK8V2m8/bYh3ed9ZVW0tit+nacF1dh1Mi5QzvUbEcy1MFpJh5hlCys+7K rtW3zhOLuUwK3Gg2wAKMVcJdioqJpI0XLNWQao7HBhymkWMoHId3XMs2wX+l7gpNn2UR Z2Ng== X-Forwarded-Encrypted: i=1; AJvYcCVJwCyeV2kd+Jl8eCW5FPGTVXa7CQzuaxC99hN9FAfl9uu3tyRfawXvgvVRFYoyEpoZAVq3aP287MAGJuW1l6ymPzFaWJ1G0yZW2I0EbK6qBI0Ubbs= X-Gm-Message-State: AOJu0YzRYhoajXuzcCnqXUwj0sSM6ZWXCZUN5B8OFaol/LTodZ//M1W6 uG9ONYJsEKWtNz1izT0reV0amYopqbCm++PnLlylEkDh5Kzs0/8f6jVS/AdAWw== X-Google-Smtp-Source: AGHT+IFjQZjYTO14egmCt9EZ5CsVr4euVVQfMTbFSXKPd+8yhvIiVkrVYxti26YpbA+ubiSl4OVazw== X-Received: by 2002:ad4:5fcf:0:b0:6a0:cb53:a78 with SMTP id jq15-20020ad45fcf000000b006a0cb530a78mr15569643qvb.8.1715087925149; Tue, 07 May 2024 06:18:45 -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 t15-20020a05621405cf00b006a0d19c3139sm4655105qvz.118.2024.05.07.06.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:44 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:42 +0000 Subject: [PATCH 16/18] media: venus: Refactor hfi_sys_get_property_pkt MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v1-16-4a421c21fd06@chromium.org> References: <20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v1-0-4a421c21fd06@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_141917_913553_E85603AF X-CRM114-Status: GOOD ( 16.19 ) 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 This struct was only used to get the version from the core. Make that explicit. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:77: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 --- drivers/media/platform/qcom/venus/hfi_cmds.c | 6 +++--- drivers/media/platform/qcom/venus/hfi_cmds.h | 8 ++++---- drivers/media/platform/qcom/venus/hfi_venus.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 520ff8a587e6..c5123f2e76fe 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -151,12 +151,12 @@ int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type) return 0; } -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt) +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt) { pkt->hdr.size = sizeof(*pkt); pkt->hdr.pkt_type = HFI_CMD_SYS_GET_PROPERTY; - pkt->num_properties = 1; - pkt->data[0] = HFI_PROPERTY_SYS_IMAGE_VERSION; + pkt->one = 1; + pkt->version = HFI_PROPERTY_SYS_IMAGE_VERSION; } int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 02e9a073d0c1..cd7902743f62 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -71,10 +71,10 @@ struct hfi_sys_set_property_pkt { u32 data[]; }; -struct hfi_sys_get_property_pkt { +struct hfi_sys_get_version_pkt { struct hfi_pkt_hdr hdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 version; }; struct hfi_sys_ping_pkt { @@ -239,7 +239,7 @@ void pkt_sys_debug_config(struct hfi_sys_set_property_pkt *pkt, u32 mode, u32 config); void pkt_sys_coverage_config(struct hfi_sys_set_property_pkt *pkt, u32 mode); void pkt_sys_ping(struct hfi_sys_ping_pkt *pkt, u32 cookie); -void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt); +void pkt_sys_image_version(struct hfi_sys_get_version_pkt *pkt); int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type); int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie, u32 session_type, u32 codec); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f9437b6412b9..745c2c0c0d55 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1142,7 +1142,7 @@ static int venus_core_init(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; - struct hfi_sys_get_property_pkt version_pkt; + struct hfi_sys_get_version_pkt version_pkt; struct hfi_sys_init_pkt pkt; int ret;