Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp517416lqh; Tue, 7 May 2024 06:27:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNFnO66OqTA2LGrUFF+ff0L5SLANkGZ8ADVWHOcDxxYCJoiiRnAFnlYKGFQqKzEO+7fpXdy6k3c3Id+QQQ5R5opg6MgNHMm0KwaOmDwQ== X-Google-Smtp-Source: AGHT+IHFfO2oZBXjrnpVw+JRNYH5HfWofElkWJ+5FQqxY1mH+OcDeg5Ckk4hqvfM5U+VEjJ99NFe X-Received: by 2002:a05:6512:3709:b0:51b:812:3c82 with SMTP id z9-20020a056512370900b0051b08123c82mr7490218lfr.5.1715088476714; Tue, 07 May 2024 06:27:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715088476; cv=pass; d=google.com; s=arc-20160816; b=r+PP3tNkAiKdKwRmMVTkwdHHKJNzdHRmV7IQyhhdFPYEupL8cZ4/bCSwWGSBBd+Mt8 UOOx6A3t+3KXCjMnIfW1hPA08/TDHK19oACtEuo7Nd0SyuS6mMvW5hzyaGuXouD0RVZE kJDkbHIJhJkjOM1ESbvxwY3sD8e5A5VcJX4D261v+Vkak3QSjZJzIgDrQTwyzsCu6ggi QtCw5nOnQvkCuO8bYfPf+4GaKCRjCqzCu7dHmnzz29KHYJ250p7A7HCoeAB4Tu3pVqrF 4qAiyZwjLTHMQPQKq0XnJxi/WzcG4iw0nvIcoplYU4NjXMCBL+zIKhjR+N+aD689YGxH hdRQ== 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=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; fh=C0LVoniX7C/OMEuJzxc6Z4IgMqW8PiEzkss1C13efyo=; b=A6MQ50lJD23ZRJAEGRNWjeC/5j2jgohuUoUu0XcMJsFTWlXJi7kDOMzZ3L6WPd7NrQ fhjaG6hgdQNctrOmpHbmKJ+Cp6dyNJ/3FMnJFl3pNnxaJQYibZ8EodeG9cTAgh33a9gg VQC/p+b9Ub91sXHgceestVzYyAzKUx9M2vcED5gceF/ici5Eom8+ozYQi83K9XXsG+K4 zPubM3+h00C5gf7xdvZuQX182XsfPFo60k07BAWXnD/sQWG1bzBvc2SYlexcdf9ZOaAm qw5N4pRPK79SwfnkeIMXF6v0pWUB3MvUoQ+r3y8o0sgkHlBq2ASAeR3BBACTRcKEJVa8 elcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RDMbgFrt; 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-171405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w3-20020aa7d283000000b005726fb3e1absi5869210edq.23.2024.05.07.06.27.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RDMbgFrt; 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-171405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171405-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2A53E1F218FA for ; Tue, 7 May 2024 13:27:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6063D16F822; Tue, 7 May 2024 13:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RDMbgFrt" Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 B164C16EBEB for ; Tue, 7 May 2024 13:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; cv=none; b=VSn9DqBOsu9dhuInf+kyWsHjL1FzHMiUGRKDRHhcT4poOxOrfsSX+NDday0vlVq0hYEF7d6U0Ti58+kEEmjkcrgC6T+2nX2+8lHHeu/OoWGFBpy3Ht5SyaCIdqpnEN4Ps8prDnGodGm4J81SMlJ7fsbBH9ih8KxxVAbTV0amtaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087925; c=relaxed/simple; bh=cqQiASSb1ke8R5KptOfAxJYuMrFDRm8Ouf7QBhfinuo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HXfID/n1Q4KC6wUDGPLt/4pgZjkZwvIBOAjyYMFAqP2hG+gy+Hk1xa4xQnu3CSX77Qo57YP7lO4TQza7eqM1MdcgaIaISGHp/UtOiAhFfQXAozc9ZdxWecJ0Km3gCRa1Wyvd65TYYU53+1yfMk5aKr6N8JQCwiCPtZUdKJ75c3I= 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=RDMbgFrt; arc=none smtp.client-ip=209.85.219.53 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-f53.google.com with SMTP id 6a1803df08f44-6a0d1032362so10595126d6.3 for ; Tue, 07 May 2024 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715087921; x=1715692721; 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=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=RDMbgFrtVCgPuxbnWbZH1qbBZ7pa/VfszDw/xgHARRfziEaMkRLGuDthwezlyexIIg +I+DgiQD8mukDI8r8lffQ73cBecqHxyhKEi8kTzHeKh1Jq99YJML+K5uJIZvtHl5r95C G+WqWVekOUJH4IrPCpBsTu1obb6pWA8Bpo9dk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715087921; x=1715692721; 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=1Dzq1v7dj+VBVNk1zZzFNzIZj2cxfHYcizI+MBp1ZX8=; b=I+25zrlABBYRjQRchtXw5cBfF/My6wQbEApfF4O8HtpIIwJHk0jedwolK2jv8APdRw QkBf+Nilinok5jodQdvjqTysPslymDOMYL4BCh28gkIJkatgNMlBiAZk299cMT/Q6ZSU 4vu7SG1rEO1ETmh2VFtpRi0mzEkrrry3wkmeNVMzq3RCSI8bhiwGaFOTGZJAEGZfJhBD 0cY2yCI4hDRjz63lp+IafxivD8HiNfU0RxDJS2HeZadAISiswFofUftZ8nx5z2DmB64W ZTNlCK8bqjowy6d/QFXJXPtOQwHOrkGV6BXUGKAdMCv7jCq2qyPuMXaI5LynxNHGyiDZ uatQ== X-Forwarded-Encrypted: i=1; AJvYcCX+hmmPv3Sipd/9OTrFdTflhM++XPPo6B77cMUUjT7loBMYzo7hizI0q9Uj2p8ReO4PL/+modk3C1OC/rRhonBbTrgCFNImqPZVkFuf X-Gm-Message-State: AOJu0YyC7K5o6UEqsMG8CNQjzKPSGg/S32mQOikY62VEORavf6AEDdS7 fy1miE2YEuGF3B8JX/F/ktdWr8fyeTuCoWDjsEMuqOosK65PtDlGhTgX2dnBVg== X-Received: by 2002:ad4:5be8:0:b0:6a0:55c6:9b47 with SMTP id k8-20020ad45be8000000b006a055c69b47mr16507653qvc.37.1715087921664; Tue, 07 May 2024 06:18:41 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:18:41 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 13:18:38 +0000 Subject: [PATCH 12/18] media: venus: Refactor struct hfi_session_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-12-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 The struct hfi_session_get_property_pkt is always used to fectch a single property. Make that explicit in the code and avoid a single element array at the end of the struct. This change fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:194: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 | 8 ++++---- drivers/media/platform/qcom/venus/hfi_cmds.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 3418d2dd9371..520ff8a587e6 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -401,8 +401,8 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(*pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; - pkt->data[0] = ptype; + pkt->one = 1; + pkt->data = ptype; return 0; } @@ -1106,11 +1106,11 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.size = sizeof(struct hfi_session_get_property_pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); - pkt->num_properties = 1; + pkt->one = 1; switch (ptype) { case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: - pkt->data[0] = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; + pkt->data = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; break; default: ret = pkt_session_get_property_1x(pkt, cookie, ptype); diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 6dff949c4402..e1dd0ea2be1a 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -190,8 +190,8 @@ struct hfi_session_resume_pkt { struct hfi_session_get_property_pkt { struct hfi_session_hdr_pkt shdr; - u32 num_properties; - u32 data[1]; + u32 one; + u32 data; }; struct hfi_session_release_buffer_pkt { -- 2.45.0.rc1.225.g2a3ae87e7f-goog