Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp518381lqh; Tue, 7 May 2024 06:29:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFT2yoO7Oe3/EvqwYZmk0F5ofCIt7BakZiJ5oqRBWJNsPPzqaTo0D0gkJG0YuF8TGpLEVdySgCYK14KbZ9nChIKXYjzJQxSZWeIOFwNw== X-Google-Smtp-Source: AGHT+IGocdEFxL2n5leOU9bw1WNx4Z8mTYj9LTJO1v+XQEqZvgagUO6HyKJRGiiq1AfWaOpdhxCH X-Received: by 2002:a05:622a:53cf:b0:43a:b2a0:6e01 with SMTP id ef15-20020a05622a53cf00b0043ab2a06e01mr16247466qtb.21.1715088573620; Tue, 07 May 2024 06:29:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715088573; cv=pass; d=google.com; s=arc-20160816; b=GzUui6AOIuxgW6n23wyzo3QgvyT6P1UBd6JHH9s0j2WXC+QNJPBCCUvmtc0ZVdnLeB EXGfKQohKRPfJeDd1dtQ48vNMgUlk0hdHJbkvm8WsDqx22K/3SNTMncyrkLR5SDrU0Lb 5tqpBF58TVcktucSJpSM2Yq1ZcrONdTaw60jaUe+/B9+ltcNcJrsyKC4/mTrnYKgUgDO KO4BsM75OdLijRtAc84/7V72LcFt7inoBRe7LIGTjUpwJkk8cRBJJozx000p78C+mNDr x4qT5Yr46VTrGFCFn0d14yXRCijIw9pIIsamEKiaM9GVFtipHk6eQCGBuCsrkBxzF4Mc x9ZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=AxOzymIGy9oIqpVIjgGXcOBfnvf3rPmoINBWnjxn4+k=; fh=v3Am2m05WDOOKScC7hat3EUNVisBFWgpX0aUwCMi+xw=; b=A9SsnAxDyoO3pYDP2vBzp99DVVrTBBYEiCjhDLnaxOTZGbkTx/2oi+V+SJcbiw8uyc sMiXON1DC2XOIyPunEzC+FDw8FM249zwDkoiLdcfnRX5/F+yptLbjjlURe12uyTslPkI XcxhUMHlKOw1zP1bYl6BbPFNTpfYMeC4WbpJwjCtkqfKXYSblZDhw1bAGwUCGjt5j7D+ 65D3Lzt3ISbYrvtpwucWfxtGNZJZue2Wvdphyj2h2PXU7q+JEQAUlzG3tJPklNznnxxZ 50lIsyltbEvRz1r93rhN5AvGC76TI2h4POFFJ9hZnGikvPQl6U73ypQTQc9ckmBGYQjx PlIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AZ9ltb3I; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-171410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 y8-20020ac85f48000000b0043adbe75155si12709968qta.207.2024.05.07.06.29.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171410-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 header.i=@chromium.org header.s=google header.b=AZ9ltb3I; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-171410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 4CDB71C234B2 for ; Tue, 7 May 2024 13:29:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 122F817920E; Tue, 7 May 2024 13:18:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="AZ9ltb3I" Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20E4616F291 for ; Tue, 7 May 2024 13:18:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087928; cv=none; b=C5bJ6N70el8ELmwKqrsw0H5I+Tm6cwq5H4034UpaWEKOTBSd3qn7mtUbIo1b8K0P3UiP/8C/ZIihTkP4Seviw1KZ6UiiHjgjp9L1pclDHlyVuagC3ycEJ+SjKFpidwr6Pl4vN3nxaz6SAmQEU0JXOgiNrUuZbDjTezolHHulu8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087928; c=relaxed/simple; bh=P3Bstv/vPDiw+M+/G70Utl3bAIKOevXPnXzJX41+MtM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YvhUvttT3zM22cZ340rXOoFXIgMl934rwWEIQNgGOiyeDkNA6606idKfi4mQJGf6KA7nQ6+oUGyU45u512XoLhzRwYmiJbHOsLs0rBaNwVHqS0UBnaYY0dlcEl9puRWu8MTqBxAKO8akwNTT06cqNaEkgewwMYLQf850fYyC6d4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=AZ9ltb3I; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6a04bb4f6d5so20314446d6.0 for ; Tue, 07 May 2024 06:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087925; x=1715692725; darn=vger.kernel.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=AZ9ltb3IB86//wjqAH7/jpArg1gKvlnnLw7s02NXnOtuJVXBWw7kooU45uZcNHklBd aK1pD4AXZnXMMGAv5kdV2vRa6gjO5ckfFFKqygzSku65tfhXBWoSHHN07jwtrr32lHe3 exseckclPfoZlET2o8NH98/Ha8qaJQFh8sXNo= 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=aeaTgLP8oK/3XHAEpGKajF1mAO63wpjX/jG3cNd31RtV977tQzZ7xr24GZl2jtM3Mo Tabzc1u6qevQS9r40A/Oau7Gkws7sv3fbEZmB+eBFIJ1obIcOoQXTGwSMqPbXHN9GvQx 5ZBBl+0UunaFrhJEA7BCf2UcZ186xGSyMWYLktV9W7Atn1xfebUshA1AjD+Q3r0hS4GG i4CBU6+HAdLh9mgjmR3LA8PAuQc2L4A7wBehXfJv0UZ6WlnSf5R/+XLEyUru3nEKVIDA kEWOT1Hl1H7S9Pctwtw3CTaDAeSMILa+RvRU9ihmWaoIh7f2iTApGlml7kES2CnlG5dA nc6A== X-Forwarded-Encrypted: i=1; AJvYcCXXLHtcZBTizLSbptOqWeLKKGoYnGeC5k+z6+2Q5iSkLpV1TyRMtg1gJ4FUBVmgBvW83PKeT5nQtfWesz/S1NAkYdGV0frgGF4x3SaO X-Gm-Message-State: AOJu0YxqT5/VnsfbCLBVvTQxjPDOG3X4GMpzP2+VafciNNdqDMBBA4k/ nAo5kqanQhNhLPj+TjPGSwu7GZjqAwgYpmFOcd78JSIN9qgbW6UxtO6F2n+z0A== 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 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-Transfer-Encoding: 7bit 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 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; -- 2.45.0.rc1.225.g2a3ae87e7f-goog