From patchwork Tue Jun 18 13:37:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702260 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 5B373166314 for ; Tue, 18 Jun 2024 13:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717873; cv=none; b=FykU3FYEoN7EOKGQmotM+TVF1HqcNjCvbxrlYxWm3J4P8Mi2W2/pKFFBcSGO6nFXN+5xDi/Mj3v2iGZ5TuPtw3dpJGyV3VK1hbnDGptJsa3rJic3a/DfNpwcjUdzsAzb/0eM0X4fMz2+N1sTn7AHJrTAR9fiUGj3OtHqz1Yx2/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717873; c=relaxed/simple; bh=GoXx+LUbk1pIIGrnFwGZ+D3NCJxZwtQES8xRkbwieRw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EaZ2RsQdmc/Q06hVQYhDrWWVzhY4wVRRttHNte4gYiIzANWqTpp67JiaeJjUWqJik/+VXn9n4Al0UtGi4HCnU2ULOBnZ4CCyp8WeZexL0es6KjkR6w9Hx6Jnn0KSWSwX695O8ufmdBkimeyWOmz028mVy0LvBuWN9iX/UFirn3s= 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=PBtoONjp; arc=none smtp.client-ip=209.85.167.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="PBtoONjp" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3cabac56b38so3183417b6e.3 for ; Tue, 18 Jun 2024 06:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717871; x=1719322671; 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=lyFYwbZ5CJhnsT3ZAVEp/WPT2f72YwpJexmvGlup3eA=; b=PBtoONjpp8Yb95gX83yBzyI7CvzCNSeoVGBBPcj6lD59IVcw5ZuHqMMtoqLk3TvMh8 xY67HKSF+dC/akFDVRQR8ffSCvOh8iWrlzSoIeqsp7dfIipF6w7g/FMJybboJWc17tHy PGYdqjEVwHDttgsoqmUSLhELBcQPT/re3guf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717871; x=1719322671; 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=lyFYwbZ5CJhnsT3ZAVEp/WPT2f72YwpJexmvGlup3eA=; b=FQZQ4wm3HQ898BqpR2r/wXuxWjRK6H+HiHIizRI52IILNjmw6/Ob5x5sQGZhob6XNq 4VvueWu2dcQG9OYqsSR75LaC27mBkwLcpkuoOr2mcUSXvdMFBIhtPX5KZHGZH2rhpuq1 LU2ZiTrdzsxkgRu3GH2kC45d3QmWM2Oy8leCkh+EuTZR++7iRXC24XcFkUEnujzY8kPD 4d+kHyJI6hcoy2YwXFL7ukOMFP0rh8wdgXaFfFo4QPFiDcpa1Uy9pdhSVX69a4wmLd7K 2so+BwLG6Tahrcg2XLZO0hTkHomP7vebLJpwvBB0+IDMl5KlVqGY2lEwHBqv+ISyFvLJ 3j9A== X-Forwarded-Encrypted: i=1; AJvYcCV/L3D5oSTgA2YcTzWW6kkc9eB0+6iGxCPQAqoQc0CMTx23xuk7ZpO5Nc2XQ7Z9kIGh8TRoTMiQ1ph0ABd5Cx2Mp6gb5zwZ/Uvv/Bs= X-Gm-Message-State: AOJu0YyW/BkLcqAXSDGk2Qxro2rE/Bxx36tT9M0K5EMn42YMKp77ucXY 53kwpAm68KZHi/BILbgC5FwKJ93/TRPCiWtnN4YTv1zR6dHbQw6l724EZdxPi4hejjXYmFZkpbz V32o7 X-Google-Smtp-Source: AGHT+IEmRQPni9rlDK9KsV2t5smDWQkyDsQQTzI4m1+U7VAK4E1oD11JY+8S6sqxF/BUxo0nnLHy7A== X-Received: by 2002:a05:6808:1a18:b0:3d2:21c8:e1d5 with SMTP id 5614622812f47-3d24e8fb77bmr15257913b6e.25.1718717871081; Tue, 18 Jun 2024 06:37:51 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:50 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:44 +0000 Subject: [PATCH v5 01/10] media: venus: Remove unused structs Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-1-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 This structures are not used, and have a single element array at the end of them. Remove them. This fix the following cocci warnings: drivers/media/platform/qcom/venus/hfi_helper.h:764:5-15: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1041:5-15: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1088:39-51: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1093:5-22: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1144:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1239:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_helper.h:1272:4-13: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:85:5-16: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:180:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/media/platform/qcom/venus/hfi_cmds.h:189: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.h | 26 --------------- drivers/media/platform/qcom/venus/hfi_helper.h | 46 -------------------------- 2 files changed, 72 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 20acd412ee7b..41f765eac4d9 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -77,14 +77,6 @@ struct hfi_sys_get_property_pkt { u32 data[1]; }; -struct hfi_sys_set_buffers_pkt { - struct hfi_pkt_hdr hdr; - u32 buffer_type; - u32 buffer_size; - u32 num_buffers; - u32 buffer_addr[1]; -}; - struct hfi_sys_ping_pkt { struct hfi_pkt_hdr hdr; u32 client_data; @@ -171,24 +163,6 @@ struct hfi_session_empty_buffer_uncompressed_plane0_pkt { u32 data[1]; }; -struct hfi_session_empty_buffer_uncompressed_plane1_pkt { - u32 flags; - u32 alloc_len; - u32 filled_len; - u32 offset; - u32 packet_buffer2; - u32 data[1]; -}; - -struct hfi_session_empty_buffer_uncompressed_plane2_pkt { - u32 flags; - u32 alloc_len; - u32 filled_len; - u32 offset; - u32 packet_buffer3; - u32 data[1]; -}; - struct hfi_session_fill_buffer_pkt { struct hfi_session_hdr_pkt shdr; u32 stream_id; diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index e4c05d62cfc7..f61295819cc1 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -759,11 +759,6 @@ struct hfi_multi_stream_3x { u32 enable; }; -struct hfi_multi_view_format { - u32 views; - u32 view_order[1]; -}; - #define HFI_MULTI_SLICE_OFF 0x1 #define HFI_MULTI_SLICE_BY_MB_COUNT 0x2 #define HFI_MULTI_SLICE_BY_BYTE_COUNT 0x3 @@ -1036,11 +1031,6 @@ struct hfi_codec_supported { u32 enc_codecs; }; -struct hfi_properties_supported { - u32 num_properties; - u32 properties[1]; -}; - struct hfi_max_sessions_supported { u32 max_sessions; }; @@ -1076,23 +1066,6 @@ struct hfi_resource_ocmem { u32 mem; }; -struct hfi_resource_ocmem_requirement { - u32 session_domain; - u32 width; - u32 height; - u32 size; -}; - -struct hfi_resource_ocmem_requirement_info { - u32 num_entries; - struct hfi_resource_ocmem_requirement requirements[1]; -}; - -struct hfi_property_sys_image_version_info_type { - u32 string_size; - u8 str_image_version[1]; -}; - struct hfi_codec_mask_supported { u32 codecs; u32 video_domains; @@ -1135,15 +1108,6 @@ struct hfi_index_extradata_config { u32 index_extra_data_id; }; -struct hfi_extradata_header { - u32 size; - u32 version; - u32 port_index; - u32 type; - u32 data_size; - u8 data[1]; -}; - struct hfi_batch_info { u32 input_batch_count; u32 output_batch_count; @@ -1234,11 +1198,6 @@ static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements req->count_min = val; }; -struct hfi_data_payload { - u32 size; - u8 data[1]; -}; - struct hfi_enable_picture { u32 picture_type; }; @@ -1267,11 +1226,6 @@ struct hfi_buffer_alloc_mode_supported { u32 data[1]; }; -struct hfi_mb_error_map { - u32 error_map_size; - u8 error_map[1]; -}; - struct hfi_metadata_pass_through { int enable; u32 size; From patchwork Tue Jun 18 13:37:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702261 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 EBC0416631F for ; Tue, 18 Jun 2024 13:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717875; cv=none; b=mWLrcG4eKLmQq/ZC6X8A5/feLt8FLGRCARVyldslKAt/2VPCtu4Rj+6h+yspXiuaA+VewCxQZmlT2Fqi3sFdQxrvGZDQkBqyeA7T3texASLsEKvCYg8kr4HqUNbQSn4ax8s7xqVsWE/Ptc+Uwwzla0tu+gbBEGcoaqVtFDgRgbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717875; c=relaxed/simple; bh=vg4N3vHUM1NcfIbzq9vLahhTUasyDZ1bYNx+7yaEx7k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JgYJvv5KEmM+JyK9o8NXUJaEMnyVDEtAPkpFTYzifXPn4VOGIJMNvYA7MHxnLRwrwZ8wqf7AR2llxJ5YotYwYo/ZOIloLPMs/3d6T2k2OQ+lZQmnCi9Rj8W7J921DXSHKqs1EucfxYjjdgy3jU8gZnbxCD35IUd9VWn5QkwIm2E= 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=LVvpOfA/; arc=none smtp.client-ip=209.85.167.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="LVvpOfA/" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3d4430b8591so728198b6e.2 for ; Tue, 18 Jun 2024 06:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717872; x=1719322672; 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=iBlrdaaQBMTsb4IyivLP+IImA8pYTXHtea9bJPgetqc=; b=LVvpOfA/p38b9lHM8K/FCUwLLBHVbdmWK/2m1cwXvO21gnad89zy58f7ksG62Jd/o1 WI7WQVMyp4+2l1B8IIqauw/AYOAnZbb2ys3o4PhPYIP6QPtIwUbeqbs6kpdQC4UA67C/ XDZYCkddpxPHrZ9WjKkdWJcjWcF9YAVSqzmHM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717872; x=1719322672; 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=iBlrdaaQBMTsb4IyivLP+IImA8pYTXHtea9bJPgetqc=; b=v8CrI8eUzGf/6KW5HUFKAJwdoRkcfviBtIxrqgy5cDXDhwv5Q7kr+1lo5e3Jx2io6N 3RbQTkcttXzd+AZVs6HNjG5to6ObSrKQMPQyvDSq98/HaW09X5+TnMkXCyxDjQ/P0pZx UrKexhr+0d07M5vgyi8SBSa+PuBeAGpIKnJkUwslw7c/6TAa094nf4uwBJxrCwwhzhDw Hch38jW4zwgrxx9LYFCcmzcFY4woWbSyJXj23e9R5K57ga0VP4TYHwd27ffJt3kLNp8D u+O3bkSm+bbN0rPWHztn86dRaL0uIiUPt0WxXylypncXcSyLwAQSc1eTsJAP8yOs16iK shrQ== X-Forwarded-Encrypted: i=1; AJvYcCXYkyv9/qTjS5Y7SVfoJ36zDAm7uVDMqBAH1NuIg2k75Wd4JGw1nTWQQCa5s4wzftVTmgnFUHt4SbUikNYzNfzfz9StJ9pQQ5oVk6Q= X-Gm-Message-State: AOJu0YxxmOvP9dY2CzW+wpzQ5peEhik33XFv0FPnDvlqwKuUJ4WBZ0dK 3hJmh0seyq0JKb3DetXoXPxgcnQgdBLMHQ/AtE8Trvsy7xQW5xpoBEJ9pZQOMKG+V8AmYpGKhOA /Uafj X-Google-Smtp-Source: AGHT+IGAbmA+QOT2T92r/tmWOvvfxvs5SSBY51LP38a381c8Nq7cxwS5jqWGmNHK7iqs+JxA0IQXeA== X-Received: by 2002:a05:6808:128b:b0:3d2:2b1d:7bd9 with SMTP id 5614622812f47-3d24e9085e7mr15725342b6e.33.1718717872024; Tue, 18 Jun 2024 06:37:52 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:51 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:45 +0000 Subject: [PATCH v5 02/10] media: venus: Use flex array for hfi_session_release_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-2-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Replace the old style single element array with a flex array. We do not allocate this structure, so the size change should not be an issue. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:204:5-16: 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 Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 41f765eac4d9..6dff949c4402 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -201,7 +201,7 @@ struct hfi_session_release_buffer_pkt { u32 extradata_size; u32 response_req; u32 num_buffers; - u32 buffer_info[1]; + u32 buffer_info[]; }; struct hfi_session_release_resources_pkt { From patchwork Tue Jun 18 13:37:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702262 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 489EE16A937 for ; Tue, 18 Jun 2024 13:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717876; cv=none; b=fgIlC1f0j0jre9RtVnS9pYqTIrDSPIacnia6sGqHDz7gHTRUKNg9f8U5RFCtXRJt5V4eRodz776hqdLgUrAIz9IEWy2XDqBptLDEI96Ul6HjXsA04dNxv2hnrj9LwhFv2tZqtRqRkdbBOh7XzBwxChxgChlxYAAC55fcckijiqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717876; c=relaxed/simple; bh=JCwRzQfJUN4DIo72lM4nWjkcyF1hZtywYkiYbZ3Wb1g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZJWxTX5ffaS/30IaUnjceNiWRLFavAtEa2Ap4uhfFPZQN5fHNcse6duCnm3oDh6B3U4b2/nc30wpEkwH5CdNV0SY648VrXcXajJIN4ET+MUPY6sH+sz/0+EjgvLoPgg1hKisIY4hw5mZmILVXze/Uh/ionNZxqIpy+1IJgkCwNM= 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=aEnGINkc; arc=none smtp.client-ip=209.85.222.170 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="aEnGINkc" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7955e1bf5f8so332430385a.0 for ; Tue, 18 Jun 2024 06:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717874; x=1719322674; 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=NfmzknDlhP7JVdeMuBVj3S4t4ocBYNX2DjumHrcLghk=; b=aEnGINkci36kajF9DwTSi7/Gsy0zU3fBpt589MxJAI34CBMzb7rxpXvXc0/Hqgh3JN NFtFBDVI90y7ssk9J6m/pO8+qJqL4UR4OdUKoyo3XynsewHPml48Hi+Lvdws2QSqO7A2 RIMxG5c1Q3XTqtEGDsad/TUa7LXMQB4jeb6w0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717874; x=1719322674; 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=NfmzknDlhP7JVdeMuBVj3S4t4ocBYNX2DjumHrcLghk=; b=CqIV6k+WEPsesfO1CD689Y4yx8XP0w1FeD1jH+cHpWEtB5sp/wvSGaVXc/1YgvBK71 YKss1I7l36Yxyv/uQiqnnscyJ72EZhYWOqEJYSe+lx1gfUedm12EafA1KqHI7/UWmw3P SUp5yngMYld/EvtFTwdOFNcVdZ4oYKX/CUcPW2yq3io8Sa3OR4aoLKPHMPt98UtNgX3c mo190vyEBQYm8W8mtBll38ZnG6LdnzI3ol8ScXxvblMQfG0qb90sf2o6Xew27RkCwSVn Y7uxbTO92Dba5iWrFNwyrLbuXNrpeTLmSlXzAQ4SVzVNrGsjxxJV38/+Y1dQprwOwClX t4Bg== X-Forwarded-Encrypted: i=1; AJvYcCXwpW/inGKFQLy5/AVZBMRKW9t2oDdcpZ+0R4e/cSWlxIfcWOtV2CsDM76r/nke+2B5HoA/Lg8Vi+TS8EaqcDXmG+GSiL18epqlmis= X-Gm-Message-State: AOJu0YwvN/4rWNYA2ukM577FMQwPKPn0x4AvCvIJbYOrIlLPaK/GRElv 5HkW337OIyOj0HzD547pt/TnP7ZRyodlH7Y8rv5vA+R6maP8WTtUsZOAc3P2qHMvNl7OpSShnkv Z5QHg X-Google-Smtp-Source: AGHT+IGEfL8XeSfOM4jwm81aDULa50VWwdKgHpsA+y9HEy95/tn/hw5XDbDctHO+xTMeAiPX0ksKzA== X-Received: by 2002:a05:620a:28d3:b0:795:5ad3:87ce with SMTP id af79cd13be357-798d2438227mr1412816285a.34.1718717873897; Tue, 18 Jun 2024 06:37:53 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:53 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:46 +0000 Subject: [PATCH v5 03/10] media: venus: Refactor struct hfi_uncompressed_plane_info Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-3-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 This field is never used, but if we remove it we would change the size of the struct and can lead to behavior change. Stay on the safe side by replacing the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1003:43-60: 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 Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index f61295819cc1..c53e2fb2d42c 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1000,7 +1000,7 @@ struct hfi_uncompressed_plane_constraints { struct hfi_uncompressed_plane_info { u32 format; u32 num_planes; - struct hfi_uncompressed_plane_constraints plane_constraints[1]; + struct hfi_uncompressed_plane_constraints plane_constraints; }; struct hfi_uncompressed_format_supported { From patchwork Tue Jun 18 13:37:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702263 Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (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 6741616B38E for ; Tue, 18 Jun 2024 13:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717878; cv=none; b=JZV/9E/pbqh4xPzMWTwCgjxYleVitaqdzVy85Twnj2XR0qu+fvGNc1YpmZjlCYI0bwDudFFbwxB9PCMNmxW25PTOs9pIv68QdBMmPcby2O8n5sCIRLD/sVro/nkBVTd03jDg1+GhjtDxqzBx99H3vzcqpQX19ijltKkWPp0UirY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717878; c=relaxed/simple; bh=Kx34urW1bu83x+FpRH2PjWtCHfI81fNXdP9esvIj2lg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QQ/qZ8//5YerJMXdip3Rxkg9uAylCLXBy9YQRdLxOX83Oau2jBa+qkn9qWofJuKgmNnAxJPI644IAq3EWYTudUV+OwnLivtc8cNl7jZA9T1BRH6+Kew6Xe8NDbXnQSK+S8itPVSNa+BQ/qxVNZjowVJlRNPM8QCRh69hxyBd7ZM= 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=ED+Mf5PM; arc=none smtp.client-ip=209.85.222.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ED+Mf5PM" Received: by mail-ua1-f44.google.com with SMTP id a1e0cc1a2514c-80ba70d19ddso1551219241.0 for ; Tue, 18 Jun 2024 06:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717875; x=1719322675; 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=uSxpnRMMBh3XAQOKvAUYOjxDrEUAAE5bMiw0Qh3Ul94=; b=ED+Mf5PMUM9of7URCeAn7RNQyecPKy1WZT9ZXXKfINjlYKnJS4TTjPujbIoucX9y9v rIkowdH+aHrbVgCph+ZcuOjYR8l6lU8OIhUB0z1AGCe1G3zqPXcP+oeIdo8n8pOHUUJ1 5lmFQ6fRFXcnZEKnN2BqIsojaiULo27kjpej8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717875; x=1719322675; 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=uSxpnRMMBh3XAQOKvAUYOjxDrEUAAE5bMiw0Qh3Ul94=; b=G/r/LjJ3oMfdhV/HlFz85sLdPjowLv8TSC7+Wsrt4a5FIvacRHUkfIrS8Fbi+Y1AZx TmkooahK+hnjlW7OB9P10uyI76dS9PmQtJ2zZg50ltcvV40Dst8ycq/+txuFo8wlbnp8 bz4703JvF543ZzqwZR3GvLbqUCHrhsQOt79fkdd46aWmXC1W9O34yaejokmc0ePIIIyR ZhmiGeUhYxW5MyGbwCO8PnU2q8/kTYh+d1qVasz72xbJYFJz/6EGGurECXznvhmwhWhD hG5DsHf0KGDPKG2kze4G3XP45mUJXQQ+kkKzOpFBTh/rXTbXsStbj86NnBkXVzkalOBE CPMA== X-Forwarded-Encrypted: i=1; AJvYcCXUTDQ7SSycfhSt9e7AhMMZNFUMdW1TLROdkQOS7aKbJ7jSW8GpybymkW4Fw7TK8eZhU7uzlWOVXOOTtb8Nc6MCC5fRcWmNDKNZ1Wc= X-Gm-Message-State: AOJu0YycvFRqc1tQKjfNh7vVCheLqFn2Ly+TeS2PHNJscWoQcTvl74Sf K1N9Eyr+NNn/v02qR6cWJlvfU8+ofAU4E9V1GIcjUOw77wNzRiK49bVO95f3alDE9BoU0Yf8Vc3 1XvlY X-Google-Smtp-Source: AGHT+IHAODVjmf2y7hxDr47vyEGKr+vtIgOCrnudAO3YuibggEVox0Hp/ospxqFRpHhKmeRWGN0DcQ== X-Received: by 2002:a05:6122:c97:b0:4d3:cff6:79f0 with SMTP id 71dfb90a1353d-4ee3e9808e5mr12164963e0c.4.1718717874707; Tue, 18 Jun 2024 06:37:54 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:54 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:47 +0000 Subject: [PATCH v5 04/10] media: venus: Refactor struct hfi_session_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-4-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 The struct hfi_session_get_property_pkt is always used to fetch 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) Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia 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 { From patchwork Tue Jun 18 13:37:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702264 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 D3F7C16B3A0 for ; Tue, 18 Jun 2024 13:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717878; cv=none; b=no0BMQbwXkCKDrmSJNJl4G/rnWcr/6wVbvyNZBp/LoR665Q+z8GMZHt/RXCNR/5+N2XuaYaoXbigazWMUpLIYK+ZtKnH6bREC6srRGTCrbNiaGoKfNmsBIZMvd8IG7pJDDfqWd75c+3KUGLYdQuAhjIGWhdqgD2OghBkxNzBwJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717878; c=relaxed/simple; bh=w3DHP4p4643nKW5OrdOfOxfbPI1T7mPQssl6ldJECKo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PQkVPkJ3wGlVHdj1pTgCcr7Z0e8yWUc2vYARFBJE0JevUWmc5ZcHjIFJn6ci0FMzlasBvqTuUmG4zu5PrugHtOZh/sNcnLcdnVJchduVsq/yR+yyStkxN9+RdLD+brl42T5oxYfK7bS/nYUhIuUf4q0N4OpXOyMGoUn9SKlG9kQ= 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=V7OZe8z5; arc=none smtp.client-ip=209.85.222.179 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="V7OZe8z5" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-796df041d73so384873785a.3 for ; Tue, 18 Jun 2024 06:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717875; x=1719322675; 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=zSnUXEZtxSx3BYm4BCVxhmYch12bVybwuYwnU/i/Z5U=; b=V7OZe8z5aThjADq3yKVV7PgW7gt1/y8zN+5CVDQG1T3urnC8ITxBj+dQlYrSZklzrG usKeswnZ+2PTX37povjfrmivhR/fjkSJp3U6NdWwq9SQQDc0IQK4qEUiTeUcNZ8ZcV12 6nfFykFBL2K3zwJOkwMKdCJcuK2RoLlGLo8sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717875; x=1719322675; 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=zSnUXEZtxSx3BYm4BCVxhmYch12bVybwuYwnU/i/Z5U=; b=Nki8mTABniJSdFNpR+PixXWkezgrC4+3p/5rLqPsfV7ZnE8ZvsBEQqVvZRstKqDUU9 geCI8GVf/9e1/G52K2n/S9GJOJGdCyAQbq8lyXmOO8o9ZgFyNnyGQFr6URixff8cOR/2 lu5ojovVrISuaRd0lbFhr+tD+IbgFuwEu8V4F0NMGunal0zWEeNzYYhhjcAtGnWwhYuG OkGLr6LC1wQhpwZyVjjB1aOWFYzr0ivWviG0aUgRewI7SppZ319Wit1X/ZugbVqtY5ml IlR3LM8fZgpWSHL8bXTch3zuCZSmgaele7YcN47MNRsBZhGCJdYRBr+xCjSp6GPDksqx DRkQ== X-Forwarded-Encrypted: i=1; AJvYcCXWRrX+OdUm4nrB5ITmW5aBcFcySFa0lcuEGBx3jdnwxODJf7QMCJ4E3JjBedlfBVMP0SMke1EkETIB5osaoF2hb1ZVCZoh+6bnryM= X-Gm-Message-State: AOJu0Yxtom0H3a4V/QLdZzwlf6UG95lf4cmclOR0EC/2M60SJY2FKd67 brGbad87FJzj/cWhVGTYDPLIRtU7rm1HV90LvjT7vmC4jP0NwtgtZHeysMrjXmo6Q9DgVTj8Hb7 QRSV7 X-Google-Smtp-Source: AGHT+IFosDDClF84gGgSRj5dHMhRBg9h/CZLMI1/BJ04L5j1+KPNuSW/Ol/HXseq/SYmSspuibOWHA== X-Received: by 2002:a05:620a:444f:b0:795:5815:2f9f with SMTP id af79cd13be357-798d241d00fmr1513504185a.25.1718717875384; Tue, 18 Jun 2024 06:37:55 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:55 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:48 +0000 Subject: [PATCH v5 05/10] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-5-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 plane_info is not a typical array, the data is not contiguous: pinfo = (void *)pinfo + sizeof(*constr) * num_planes + 2 * sizeof(u32); Replace the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1009:36-46: 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 Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- drivers/media/platform/qcom/venus/hfi_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index c53e2fb2d42c..6202dcfc467a 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1006,7 +1006,7 @@ struct hfi_uncompressed_plane_info { struct hfi_uncompressed_format_supported { u32 buffer_type; u32 format_entries; - struct hfi_uncompressed_plane_info plane_info[1]; + struct hfi_uncompressed_plane_info plane_info; }; struct hfi_uncompressed_plane_actual { diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index c43839539d4d..3df241dc3a11 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -157,7 +157,7 @@ static void parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) { struct hfi_uncompressed_format_supported *fmt = data; - struct hfi_uncompressed_plane_info *pinfo = fmt->plane_info; + struct hfi_uncompressed_plane_info *pinfo = &fmt->plane_info; struct hfi_uncompressed_plane_constraints *constr; struct raw_formats rawfmts[MAX_FMT_ENTRIES] = {}; u32 entries = fmt->format_entries; From patchwork Tue Jun 18 13:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702265 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 E358616C69B for ; Tue, 18 Jun 2024 13:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717879; cv=none; b=D2PrdDxoVzBDh36Gwa+2UXe2RGLoQMwVd9a0k9iVG+pvlMd81wsmPCSCufzhoonqDpmnK+EJA9Fr0IHN7tD4MUFDVTuUFxGjzLJkOxkdpVhMtAJHl1xEL+TBXL5k7cGA/ktj8h5ouqLhTyeeF34k2NmmxB8zuUbXsimUvPWSn/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717879; c=relaxed/simple; bh=iELnSY5gu3MPwTWIlT31gap3UcK/8g4Z6s90Q+ubKso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=inzA2JKK/MEcILW4JhTzzLOYIEwA8Ocx0ofauaDlKOmsimXwVq/RgcUGzuxMY9VsJyT8B/RcBU4AX/M4gusCDdgqusP9guXTND/XrdGCpDhehJwFSUL3MAqFmjCDeigemxEsg1s0AcULVT3Pq2VUZ0OvSri6TTvXUcKh/ynnkvU= 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=SFXobsN7; arc=none smtp.client-ip=209.85.222.169 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SFXobsN7" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7965d034cedso346795185a.3 for ; Tue, 18 Jun 2024 06:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717876; x=1719322676; 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=MW9bvh2bp76Of1yyIbqQelf17GV+Jkv7epwXCqKgstg=; b=SFXobsN7Y6qcPfXteidGdyqryJ6i8m4cGzKjTwpBzq723v/hKxWvLJVMJXsvJ/NfY/ Rks9t35kGa4vZhavMRJK7XsX2Unhz6aiZigj1eoiowFBgs4t44czVOlB+IFfZslA1CtK 7VHHA+tKaSB68PEB5xEUwFVN8nNkYmd9PlAUI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717876; x=1719322676; 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=MW9bvh2bp76Of1yyIbqQelf17GV+Jkv7epwXCqKgstg=; b=AWkoXkj45jN/M7Qe1nRpDmFbROVgdvFmHktQo8onfiEb0YeorJXRBD7JMNAB3Wu72t CZp75aARQM/VShYv8CdZVfquYuMDBOfSIIR59tsjLAeVgMzvpyL3Z4B0cL5UAWlE3hAq ajY+CX5YP7zAn/Rn2iygiixKuHY68+qWW7UNzrDN9gISHCC/d2r27P8aYHuXtPGhJCbk vIGJqpAoPtWbSOCraAl4Jgwn2gWvXAyDMNHAa2AgyeNjgDA7B0b7uCe6NVgC7t5+vjWJ Tke9qnp+MS0c0nYVXFUp+nU7RVu7u7hKNFNYkwidtF1N3AvMQ9foP6tSJKwQfKbrdXyn wDAQ== X-Forwarded-Encrypted: i=1; AJvYcCVi55T8A04cq1cor4TsegABqTc7Y/4Z+wzn/C7lVSNA/Y+Y3U+CT+gOCFcRBPcp3oJrqJM69aVZAt/VnWzZf4eaq0aCtphofyZKmLU= X-Gm-Message-State: AOJu0YwGTExjqDEDzK9qT5ftthBNtSjMjS7ZvVp0j39NpiwYbYdZmboE 0Dt5J5SSP47zoK+C3ZRLSGFK/Xs/Y5XlCjTI+h6GSdcnNyr2XW+hEsUq20K7LF2tKPI+LZNXO1w I2f5k X-Google-Smtp-Source: AGHT+IHUPkEjN1Rk4xvtyWc0bLx9LlZNTQuD6SlnDrxbm7CEFP8MpAyoWDysNL5JPs/xrPrkaHldpg== X-Received: by 2002:a05:620a:2586:b0:797:5765:b844 with SMTP id af79cd13be357-798d242f63bmr1493021685a.37.1718717876400; Tue, 18 Jun 2024 06:37:56 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:55 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:49 +0000 Subject: [PATCH v5 06/10] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-6-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 The single element array data[1] is never used. Replace it with a padding field of the same size. This fixes the following cocci error: drivers/media/platform/qcom/venus/hfi_cmds.h:163:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index f5708fdfb197..8768ee052adc 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -160,7 +160,7 @@ struct hfi_session_empty_buffer_uncompressed_plane0_pkt { u32 input_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 data; }; struct hfi_session_fill_buffer_pkt { From patchwork Tue Jun 18 13:37:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702266 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 7BA5016B385 for ; Tue, 18 Jun 2024 13:37:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717880; cv=none; b=G1MdguvfMf62xliNb826jR2+xpofHdeoHS2x+TusrVVd/o06GR6S7OuaJT4kp5ev5dSxHuNvXpV7ByhzA2otFPfKvHK3J3Yt/lHuWDbsz84tgK6kbAp1qFP7kwboljMUvyBIw50d70rotISgt3gunaqI9kAyZ3uf6V8TE7RgZBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717880; c=relaxed/simple; bh=REbIhZEglYBHgb7HJlMZ2r2p8w/k8dfgexAVenpfyQc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nxvMqCsBMR4NB9WwWSu43WNw7VpxRqijlSMwq2ZVnMgbUAH8d2UuMiSJQg90aHbrVZNspCy3JS11AV6UlgbWhLJK2tBa1X9W5i6Pu9nKPcVG6Li/D3RVIs/0GQ8w3A6ZBQvg9/oBqrCscBrxvWVNf47D7SBkTmYIq1fXy+fuxOg= 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=Tnq1i92+; arc=none smtp.client-ip=209.85.222.173 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Tnq1i92+" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-7961fb2d1cfso469699485a.0 for ; Tue, 18 Jun 2024 06:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717877; x=1719322677; 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=y1nLEejg3OHGtJ31ylvTDCmBSO7HiCAKQK04IWdzamU=; b=Tnq1i92+KnHk0CCFsddSU200F1hHQ2BkaVO8D3dkBksKv1jDl1umQ9/o51sHqlNlAm ku5vPJ0suCEALBDIm4LeWga/3CwmpJA83pcvarAPbFNLLdWukIfp//wLl0ZXrxwZkNZ5 hCDs0jCUnbrMlO/vQW3PsZeoa4qBB2wXQwP60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717877; x=1719322677; 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=y1nLEejg3OHGtJ31ylvTDCmBSO7HiCAKQK04IWdzamU=; b=nSrL2V0/SFNWh1XVXBF+aJIgzftcdklsqDb+nBp1A+2X1naEqWPsr7XtRDVQmKuAIN pqbSX6DxRH27+2toM+qXReRbe4PGiUPQD6jMPgt9mg3jraOMqyBt5XW+y+Xggvip8qsg QXNs2zXgeNP+i/Vir2UgE2ZWNK9eH8gL9d2mq1dC+WCibcRsuvOPWCQz1xAMLlQ0afzV hPZrWIe7TS3YSOV4pbfcDP7fpj1e2XYwjM5AeMP1Q9sHMFH7eRqtnuLg/ZF/NLE9j4eM XO54u7Zis954tzgCX9310dUgplVaTTlMhYExSLdupFBUhys8jZpHnD3fmMXUgcGis1pT pWFA== X-Forwarded-Encrypted: i=1; AJvYcCXMOnAuYiKSgOq5YK3qQYo7XjQakmBagOV2y2upNJAqrTupDUmdZeezgyVDwUQCzG6GNArx4W76wIzsG75npwRqVJjWkrGjuGUcnTs= X-Gm-Message-State: AOJu0YxQ9PO60DZe5tgzdo3Z3s7Tyn0bw68/s2wGkO0UqVwnOkBin5Ub cNYQF7sVT82NV6CEpTCt1EwCrjgXUvmiNiykq4YblVfBZci8x5Re/VuX3pD5dkytcbfUb/k1vBp jI0PD X-Google-Smtp-Source: AGHT+IGjdUxmekTm73uUT+ZjPzTRtV+1glujlLe9BtgDyl3oT+EM2OHrXsRD2H0jaRmgr/dPXg3V0g== X-Received: by 2002:a05:620a:298c:b0:795:575c:5bb7 with SMTP id af79cd13be357-798d26ae16cmr1247186685a.74.1718717877269; Tue, 18 Jun 2024 06:37:57 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:56 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:50 +0000 Subject: [PATCH v5 07/10] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-7-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 The single element array data[1] is never used. Replace it with a padding field of the same size. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:146: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 Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 8768ee052adc..2c56ae303989 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -143,7 +143,7 @@ struct hfi_session_empty_buffer_compressed_pkt { u32 input_tag; u32 packet_buffer; u32 extradata_buffer; - u32 data[1]; + u32 data; }; struct hfi_session_empty_buffer_uncompressed_plane0_pkt { From patchwork Tue Jun 18 13:37:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702267 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 6976516D9C2 for ; Tue, 18 Jun 2024 13:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717881; cv=none; b=CRiyHtZ4ZeznKiVEJG5bY9EqMiDvrbl2glcLJGMjf947Fn+4qNCqZi8vVT8lElG/RF+/qbnFtx407jlX89csz8ZPSKHypCk5uUATedhbKNPJoeAzsWkc8PCtBYF/lgr1tDiojsu6IvHtsy+72tuI/eUYaq4nwr/rhTm52UsJoec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717881; c=relaxed/simple; bh=LrbREgccmp+ApJP/aOqmOoRz76Y1lEsELda3PHy44H0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZUfZZzN2biUiJvYe77X+u9/uTiJl/sUIsKSpk7o/mM6d1ciIoZew5RcWlmn8VuYYnN1ViaumibGRxUoibA4in4BX0NzfvREoL+RQwcjxFuTmFAGOO9Ev9GdS9FEdd2yKiFZ+XhLqezetcQmKECmYBccca8d2Bws8nx83whRsq/Q= 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=Vhcezod9; arc=none smtp.client-ip=209.85.222.180 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Vhcezod9" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-797e2834c4eso451637085a.0 for ; Tue, 18 Jun 2024 06:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717878; x=1719322678; 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=yg6dOdrePmQkedMibhUOvsYt1qJByOG1v6bUXQRrIc0=; b=Vhcezod9bTjHhu5dqi2/RMzSrpi/ALRIrD13HlMTNDime5k71fOYHpXqTA0EAzSTOF ibk6ZrbAFsxebknblBSyrY8gFdd8P+sBG7eAkQEU1IySvLTS8osLtrxzors5DvQwtf3o 3XUgD72NIfh8x5K1dQ4L+Br3iGldTXf0z4HmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717878; x=1719322678; 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=yg6dOdrePmQkedMibhUOvsYt1qJByOG1v6bUXQRrIc0=; b=hC1wFEl8SLeficTfg9qUHfULNZdqHkc4JpWPQEOaPPaejYflHb7ENXHcTkC8vieEA9 E0/fXHLV2jBgFk3QyJ/66hQQ15S921LEd0RJzulzxqhbRKbOFc6ODCI+bQgJwTy9bsy5 0adOrWKTBNmqAFj3WWdzgoh10+5VRi1TVqDDP4/ErVXRhUTAsRv55ZSHQXyR9uj4fR8F 8lAFTqDEMAD9Y1A6QBK8ItlAbscZOBIgxACdsYWXeAPOVAnLqdPh3R2v1AJng4Ay8ckN DoBIApvPVgA7AGSusrMr6znOl522NXPHVC/jw1OFUAxVf09BF1gDZpQ6vjKkNE+K5vgS e7Gg== X-Forwarded-Encrypted: i=1; AJvYcCVDukccalchRLGW2gcGY6bD1I7VDfl2xR4rB1uN+Qpl6hFzq68Es5MoM5dIQc9F4KY3OxWheVDkapmG+XjdT21dNvh/IF4gtqWISMM= X-Gm-Message-State: AOJu0YwUO7d+RCtJRPd8RM61JopoxAAdMyXJk/MCsX/HWEetvYBCDakx s1UEkPktyctRuGlchBaiuQRzo77skoVJVMOprttZti++pGDygBwfrBXdzubHCRofRZ9WIlQYIpv B9KM0 X-Google-Smtp-Source: AGHT+IGAgj3YnsFss9qEjXgsxLbOwfO0PDliSTE4TcCbevE5n9KjJc7F+p+/GujvK9mbnLR+t5wqXQ== X-Received: by 2002:a05:620a:4308:b0:798:5598:bdff with SMTP id af79cd13be357-79ba75e14e3mr450019785a.0.1718717878028; Tue, 18 Jun 2024 06:37:58 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:57 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:51 +0000 Subject: [PATCH v5 08/10] media: venus: Refactor hfi_sys_get_property_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-8-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Replace a single length element array with an element. 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) Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- 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 75f4a3d3e748..0a4de8ca1df5 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -156,7 +156,7 @@ void pkt_sys_image_version(struct hfi_sys_get_property_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->data = 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 2c56ae303989..f91bc9087643 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -74,7 +74,7 @@ struct hfi_sys_set_property_pkt { struct hfi_sys_get_property_pkt { struct hfi_pkt_hdr hdr; u32 num_properties; - u32 data[1]; + u32 data; }; struct hfi_sys_ping_pkt { From patchwork Tue Jun 18 13:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702268 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (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 34CA016DC33 for ; Tue, 18 Jun 2024 13:38:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717881; cv=none; b=UDJna44NNYPrFI6+y1HMW/FKM01kmPgqyKJN645JmmeQr5VBA4AtO1yPkHfyrxe22LcqtuA/mIbsAEB52I74iLZuixR+5+heMrOyQX3/BT1ieLfO2Q/4xUnzOkXLXpzxUSL6PIfb2uhyUynYohAMac7DpPyBGeAIoQkzQlNqafU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717881; c=relaxed/simple; bh=DZjQ6FV3T2FW/P5dZ/rmnh+9n/L8e1/dcKMQojAHidA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SPftZlRa/rB0rvOjh4iJGvhHVOyBBdWuG+X5vZUMGuSkDUirlJ4cSz1sL2aqDmqLJ2QgI4KcAXXkdy3I4U5X/FFufVMCO+zc7CFgSAOAbdqmBlRN0amC8JgRF7q5AkPgQPEf0pz+Hn5NGuE25vK4SlYP+2Iye6A5rIB7n36lQRw= 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=h/q7QLM6; arc=none smtp.client-ip=209.85.160.52 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="h/q7QLM6" Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-24c0dbd2866so2841243fac.0 for ; Tue, 18 Jun 2024 06:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717879; x=1719322679; 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=A2IFt2EVdi+gZJF4jowtvIlbB+KtHxr9PizWbsBiOL8=; b=h/q7QLM6kNjjkD99jkS7jDZvS4Ma4njXAHHAZcMhibE7R4o4NN/sCtPdmK51Lk7snj YlOalbEqWwDmgiwNUnPbBuP/m4fW7QNTRocFM7XWxEMNvYUPvc8U8Hm1uboUpxuBebR5 pyL5NN6H3hpIm/vX6VhE4NaWq7fd3SWlsRqCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717879; x=1719322679; 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=A2IFt2EVdi+gZJF4jowtvIlbB+KtHxr9PizWbsBiOL8=; b=O984mTJDkfHtDmb2NL36hqyMEmUTUzzb/2cmZ/jshJSIFSEdQmTddAlWDPvtAOa2Cy iT5SEtFVI/+u3P8eto2zE4EpgU2KzAUDVV3TAmC7meiBQrd1ek66hG3pwGf161CPmMYH dBvA+DlmRJfxW1VZCPFtDOp3VOnLGqIBS6DDlVINfF1Cf4wKwXoY+JhIWerF4Z2rT3GN uY7qN5dsYRd8hqx1r+xf66UTjH7/nx//wsr4A8UzoClkBYizSojx8UZInjcrDuwDko+l pEYbjGDSxf3FM4bGAm9k4NtBcXtsMSixhU00pQwDrVcsk1rALldUcYZfVfrBy3T6AGEC MqMg== X-Forwarded-Encrypted: i=1; AJvYcCV1bxQXW8mqXLMw7dhfHW9psUlVbdxQ14aUsb5mXKBmO1yI+Z4PkA3GeoszMSjT3MRP0E2hNcOYRISUTFGIqjVZUQegnIj7TmtQzIs= X-Gm-Message-State: AOJu0YzO9kBirlHhT7BkWt8sQZMP9Bqjrf2a0FnIsYx4GlwLIw01p+tc 73RxTxB/PqJpCiaEEZ8IZVdGOYHSyle32NBQVMmDZGlsZeKDU6Zc5/iuU/280owfDv4JXLj2rnL jbCyY X-Google-Smtp-Source: AGHT+IFGZzzKWBOJ8T4ois2QX+pNAsJoUQREamSXoXS7bchmzONZY4R+JRX9+M2w5xew57/NtISAyA== X-Received: by 2002:a05:6870:7b4c:b0:259:8b4e:e71a with SMTP id 586e51a60fabf-2598b4f0ac6mr606072fac.46.1718717878982; Tue, 18 Jun 2024 06:37:58 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:58 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:52 +0000 Subject: [PATCH v5 09/10] media: venus: Refactor hfi_session_fill_buffer_pkt Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-9-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 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) Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- 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 0a4de8ca1df5..3ae063094e3e 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->data = 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 f91bc9087643..daba45720ddc 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 data; }; struct hfi_session_flush_pkt { From patchwork Tue Jun 18 13:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702269 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 5C7E916EB63 for ; Tue, 18 Jun 2024 13:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717882; cv=none; b=FtzwAObPgKHTmh+YcWdNb6+cD1TiRiRI0+zDWnmjAKfXC8pqaM8pI2EazKL4A41rCbn9gny3c+wlsGp/7koBlrNCVmFatQrJgDEY4JGNEATM7+zl8bTpuCzKhQSee3MTw0j85bmBxhYLZMmbPpZ2h4yNZHVyEvSWgNN8nsXOTS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717882; c=relaxed/simple; bh=n7rLzzBBfHOdiSuzszfNn/euo2ePzTmy1Jk7b4uNXQ0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=shk7/ffjzjNfuclSUngJCDKi1n38vdOwotrgCdc8PilFZb/hcbfmYx4xzV7j1Rl6R+XnrHNUTW0knowcscmNIHdJLD+U7xW/ZrujlF1e6LIlSt+4OnteJmfotmPYwlMZOQRRRBorZeT+t7TgRTl3ImMY9Gmg3I32M7+kVpA3jy0= 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=Mq2qWFNO; arc=none smtp.client-ip=209.85.167.169 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Mq2qWFNO" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3d23a0a32afso2952638b6e.3 for ; Tue, 18 Jun 2024 06:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717880; x=1719322680; 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=C/eq9KiqE9DhkH+J1pTk62wzUPV+ZFcAncSfE/zn07s=; b=Mq2qWFNOBV+XDeAiig97C0zvDRN7YUgzl+hkOr7jX2lwSGymaMVphRHukfuOOz4hOm 7YClKFW/3PC7hqu+w62Nm2x/19MXN1ZSVwccH1zxJBN1ExGPIDwT59VEPTzPAxInObJP XZ+J/6lbiBavT9y4A7fwHp+q0rnrXF3FbRx8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717880; x=1719322680; 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=C/eq9KiqE9DhkH+J1pTk62wzUPV+ZFcAncSfE/zn07s=; b=jAq1TXxd5xP+AAToSKBEoJ0JLhBY9VhAcr26rcuX28Lvj0SVFr5GPIW7CWAQzusnsP NHu2a+KCtz7gQnGvn+8+bNewt6tMH4YbrvTEcvqK1KhWN62GnmxQCe8okGRNk7FhQdcA yj/OV0O+SCtWTWx/xgVWG/zZwYM2ZM4PEIhGsM2wshgOUZ8mOGDDwR3ogCwj0oBQpMON COL/jxMyFwYQDvqhOI5PMG7NeudMdWVbQysCAVrRFDD+Xwo7X6CK+G/R61qAqBaqosTS SMbTD+5d61RmY8GjFQ5fGzOE5KkociQbHoAE1iuscI+5ZRtUCnsOvvyOMmqtNRUTVg6W ljiQ== X-Forwarded-Encrypted: i=1; AJvYcCUTxwElh4RtiIFHg35zogQidPO7TSOnjjlYyXbIlUu0q/LTUN43benTnWt1ae1Cqj16SM0mfcL7HBp2P4x61LKzjin5X4UWwVQnyOg= X-Gm-Message-State: AOJu0YzLG8sZXH8MMpApBvo0XryZkioGkoZa6oi4VSldcNz3jyLnVV3o cQShqfwgHPm5f1Ftsqt/2MRy9lhKSLxd7gLFoC3hqAJduInxwpMjXJXVGV8FJBJ7RoQVBlc5eYc DG3Gy X-Google-Smtp-Source: AGHT+IHK+MUXA9aHTIKx+La/+tL6XuNAxNsBHd2w0eK2r23/Txk8tr8Eu/lANB+LjBHcJGZuZjo8hg== X-Received: by 2002:a05:6808:1520:b0:3d2:2356:d273 with SMTP id 5614622812f47-3d24e8a9973mr15936428b6e.6.1718717880067; Tue, 18 Jun 2024 06:38:00 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:59 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:53 +0000 Subject: [PATCH v5 10/10] media: venus: Refactor hfi_buffer_alloc_mode_supported Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-10-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> To: Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Replace the old style single element array at the end of the struct with a flex array. The code does not allocate this structure, so the size change should not be a problem. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1233:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Acked-by: Vikash Garodia Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 6202dcfc467a..242a3ba94555 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1223,7 +1223,7 @@ struct hfi_interlace_format_supported { struct hfi_buffer_alloc_mode_supported { u32 buffer_type; u32 num_entries; - u32 data[1]; + u32 data[]; }; struct hfi_metadata_pass_through {