From mboxrd@z Thu Jan 1 00:00:00 1970 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 578EAC27C4F for ; Tue, 18 Jun 2024 12:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:CC:To:From:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KsIQfOWwO2j2+yCOfMgo3UpYsU+EIIQ8PzJUT46lHfc=; b=Mzg5TciBKFWmSFKi15sXvrO0vQ Ey3Q9nzHj1/U8fqzMyXxkD9rVxVT34fTSUQX/laENqabQJ3v5QBw+hEIgF9wzWticg1LrCw9mjE1T coNm2GQJu77Sa6+d7MQVS01IWAgWtI8sVYgpSrKZYi6uxGyXW94ggz0+x+1KSADqITpCwKGyg8VUe WyCJOYk5mGzWPQer9yjVsnlwACMa6H/mfiKwP5WplT4dVGTbbXN3PdxA8g0KDetvU77JHa2engSkJ YxzER3NmIrQiEQtLdFxM1eEN2k3ruSY//Jb+FxJD+LdZaZzmu3ik7tTeINiQ5UV491X0U7+wZH9kl cFSnQ00A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJXnI-0000000EqTo-30Si; Tue, 18 Jun 2024 12:18:36 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJXnF-0000000EqTD-0oTA for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2024 12:18:34 +0000 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45I8c479009345; Tue, 18 Jun 2024 12:18:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= KsIQfOWwO2j2+yCOfMgo3UpYsU+EIIQ8PzJUT46lHfc=; b=XzKmwjn82tpHMaiP OesFIqHOATmGZ5QOIwHJTbXvK+m7vPwABhRsB7pJmAO8xdznEeICQ14fQK7UbfAV +c/jijroy/AFlG2lQFK516aDva71S7u4fgxTPZzgUOTdWpF64fuCMbNDJrgrHndZ Qi8lXb9LWJV7fgf7CM7Flz9VAsjtIkKmKTuKIkvwnv3tskE1y8JHl4/CK4Bqql1P B685u0RvInueDejUtBIptomhkp24RGTg3xC02VZj09myPPNFbtJhaGhzJssaxDoj yxAjPT1RsnP6bQ7dMxknVlN/9/GraKMWq1OB1z0bI1XxA5E5IKUqo4cJtWfdmPFq bp7pPg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yu6wa8mtb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jun 2024 12:18:25 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45ICIOOM006098 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jun 2024 12:18:24 GMT Received: from [10.216.29.175] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 18 Jun 2024 05:18:19 -0700 Message-ID: Date: Tue, 18 Jun 2024 17:48:16 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 12/18] media: venus: Refactor struct hfi_session_get_property_pkt Content-Language: en-US From: Vikash Garodia To: Ricardo Ribalda , Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio CC: , , , , Hans Verkuil References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> <20240527-cocci-flexarray-v3-12-cda09c535816@chromium.org> <1d952b60-7042-bef6-443d-325de75a864d@quicinc.com> In-Reply-To: <1d952b60-7042-bef6-443d-325de75a864d@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: uj4bT3wkbBzhfhX9mkW8WwTjetyAmCT9 X-Proofpoint-ORIG-GUID: uj4bT3wkbBzhfhX9mkW8WwTjetyAmCT9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-18_02,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406180091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_051833_389685_E692CCC8 X-CRM114-Status: GOOD ( 16.02 ) 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 On 6/18/2024 5:35 PM, Vikash Garodia wrote: > > On 5/28/2024 2:39 AM, Ricardo Ribalda wrote: >> The struct hfi_session_get_property_pkt is always used to fectch a fectch -> fetch >> 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) >> >> Reviewed-by: Bryan O'Donoghue >> Signed-off-by: Ricardo Ribalda >> --- >> drivers/media/platform/qcom/venus/hfi_cmds.c | 4 ++-- >> drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- >> 2 files changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c >> index 3418d2dd9371..75f4a3d3e748 100644 >> --- a/drivers/media/platform/qcom/venus/hfi_cmds.c >> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c >> @@ -402,7 +402,7 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *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->data = ptype; >> >> return 0; >> } >> @@ -1110,7 +1110,7 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, >> >> 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..f5708fdfb197 100644 >> --- a/drivers/media/platform/qcom/venus/hfi_cmds.h >> +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h >> @@ -191,7 +191,7 @@ struct hfi_session_resume_pkt { >> struct hfi_session_get_property_pkt { >> struct hfi_session_hdr_pkt shdr; >> u32 num_properties; >> - u32 data[1]; >> + u32 data; >> }; >> >> struct hfi_session_release_buffer_pkt { >> > Acked-by: Vikash Garodia