From patchwork Wed Aug 14 11:39:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763370 Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.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 2FB071AED47 for ; Wed, 14 Aug 2024 11:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635570; cv=none; b=OWG81+K4KhT5eLa+cNmTX9/rIf921Os4boWiZbxePN+WcJYW80fwko5sTzUf6vD3NxhCmmdsMMcU6AysF6sD5hKZPoR4c6w9CetoszPSSUW2z4KT/VycGhmaFSJbT9zJKjrSRHb/8xEipDs22iZowaTDRipKkr7WU1iQp7vBDkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635570; c=relaxed/simple; bh=R1PA8oQuTM3Rzjg5+SIhm6Kcapuh62793jx02QTgMY0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hUp/yVwaIrNFg4bqoTsZQB3nXGVZ9EoCwSnPpGUboA/78FCCuaFspLtEG/Bxb9OAFTRSoFUa6WV81kU3zjmDI31v5Sut8+ajTIy1AUfHuHfnHzgP5pzVn22eyBSTveSbxSUryqPIGafwZPuMlrAVL/ATe26vYz2MRy7JaYYrywo= 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=exnUTxQo; arc=none smtp.client-ip=209.85.219.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="exnUTxQo" Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-e115eb44752so460057276.0 for ; Wed, 14 Aug 2024 04:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635568; x=1724240368; 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=+E5Cp8MkPIwpZAw+YrCVKJ1cqUbJ91RXqLOqVZdLQHE=; b=exnUTxQoSCW61Q+un2gAVat7J+3yjd/s1cV8lrIYEA6fhQPZBHWqjSrT3c5ZZKp5fE D+e5oTd7k6R9ZHkJ6qhZRGJqcySA240XNT+EjT3t9iuoXY8EokVpe8zjIV8MBxhldHYh nKbrQD84NYJ/rMl9JpzL4O5p27uHpzm1HwQ18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635568; x=1724240368; 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=+E5Cp8MkPIwpZAw+YrCVKJ1cqUbJ91RXqLOqVZdLQHE=; b=F1xQNCTWzsmkrBXFjhIgvM1JSHkiyqHaEq4F3AU9f54ou63D9U9UNNILExuIf1BTUt XgXPrXqJBsElcC4MlxyEqF79SS/yxLZpTG20swS4NrUXhAU7XjbNpdMuW2dgrfclO9QK /wJR7thwtUtE0VdoGy3q6gD8aKdQ/T+6HuWe/gMuEFfJC510tPgo7bLDFqhXs8VeP28E Po6nL4vBmDxUAGRGWjJ0XikAuUHzGfASLrVrUKMAu0LHURfQ7X3ZWSpyK64YRsiSr7GB p1UCUOT5UcqivAsSeHZfbvn1dNeS2QNV/oicHbvWaqj+Ocjs1MW2XyKjSZ+S85ekQEmg 6NWg== X-Forwarded-Encrypted: i=1; AJvYcCWOVMYCgI9gjdR4co4HDDI+lgqk6lHD3+w9cnhXFdJkCH6a75wsVq14mM1dTsQbCf9rdJq5pXlhVdu3rRxuxBGEZlRLIqlfhZYi0rJHYA== X-Gm-Message-State: AOJu0Ywn2fTI+69fKaTYIQVJooigi93cGofBGmzaAmsbLv9ee+iWn3Ek sx1zkOBJJC2mmOPoh8fo1ggs4PABFlO0RTMcp8O1Bh73p0W4toAXq/8ViOov6w== X-Google-Smtp-Source: AGHT+IH4HRHiY7J0a3dkMQnnmztUnfpAtb+vJO43WbTYlwvIuzF4AM3KwSduHBvZYPZPpJXTBCsLgw== X-Received: by 2002:a05:6902:2387:b0:e0b:56a7:9a6a with SMTP id 3f1490d57ef6-e1155aad833mr2512251276.23.1723635568084; Wed, 14 Aug 2024 04:39:28 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:27 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:21 +0000 Subject: [PATCH v7 01/10] media: venus: Use flex array for hfi_session_release_buffer_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-1-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- 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 20acd412ee7b..42825f07939d 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -227,7 +227,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 Wed Aug 14 11:39:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763371 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 55BEE1AED57 for ; Wed, 14 Aug 2024 11:39:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635571; cv=none; b=mDA0KeKROy1H2Oxe0mb3s7nznaZj4JS2jXngqPCxNSWldrgvHFJ9Ou4FxEX/HU9ddASe4QKrbXXEWlENQ+MkCV0ceyjwrV7fGh0JqGkIpAth3fo3HW2xavnnwCxpv99nlW8z+hEhdjymPtnDg+O1sEP416FAPNdUb0eHY0189Ec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635571; c=relaxed/simple; bh=5GjsDBGQqIgtkhE42oyItt8GLxY3GZ3DjuoGu9io62I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N4d7nIq78SOTTi6VF639KTHfK2pTRgDznFrCnUJJGrq4zP8De5LBFiSo/f6tmu6o4PxT8EQs9VeLuV/1hNJLIOZxpHkmpXU+iCwn3+AKjlowJ7Xr6HEsNEXIOASLtAIsqsesxz1Y3r09a+sk2/iaNsh7bc8enPuppGehWGMwyXU= 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=M4tdAlft; arc=none smtp.client-ip=209.85.219.47 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="M4tdAlft" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6b7a36f26f3so6953216d6.1 for ; Wed, 14 Aug 2024 04:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635569; x=1724240369; 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=yUMFOlEGEXrhpj9V1EgmNfGLXeQh9qSdvMzJJ0d3XaE=; b=M4tdAlft7SRHx9iAyXlW9ETtIa1Lr/REeJoPj3hPKZZ9YMx9nXfJWlVarPLC0hLHU+ yaN8LcXx5qvuuLQUSEx0RMJ2CpsgNM/oLfrm8W2yxtnec4IdFYePV42YJhKra+eSDOZv Y4jgtBnp66S4WG9H0jMvjem1yZ1LCznl9LopM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635569; x=1724240369; 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=yUMFOlEGEXrhpj9V1EgmNfGLXeQh9qSdvMzJJ0d3XaE=; b=K/KjKcanOHqfmufAHOK8Ptk2skfHmMIA9jOOypNDHgy/dDneYnl91xZgb9KW9aMIt8 aBm1BOriiLOb69LE003IcRrR/we9irbmBE3lH34i9IlxZ7pV9qJ1vmeXDH9yOYcJIFfU qIme/yP0ZgLRJLWa58SLrgZ1T8xyqfYaGL6YFHZieGOFAZSdaG2SfHeBY2JqEV0U5WHP XeZDo9AjAyf0UCszeYs/q2Jd5smaHg0YKj7hiV3WXURA2gIWy94jYD5VvWvX4WBY9+pS kZeZwneOQpGqm60VjJwTx0YosaTDZdxt66Jx1ZflDpUeOaJMHwE7uo69BwNEqWOWbbmv v23w== X-Forwarded-Encrypted: i=1; AJvYcCX6LakOb+/hJmvEm6UNW4VJDXD+SuDHiMAD3e26jlW/INymwDnXp0C9/JOj6eBvDaBRDcUduZXW3hITLl7Vsj2NGZxaWAl5MTwCYWL+cg== X-Gm-Message-State: AOJu0YxkGKX+s5cTOOX5J1cUHWwD6dND9W6dsmCvomPi1EeiEAFR8NMR cLTtbsaebiKrrU1vU1L7KnGh6E5zJAgcoYDc8ed5mGYXaqyq7cXfQpD365Tc8A== X-Google-Smtp-Source: AGHT+IFJDtb638rb+wV2H21FdbW4vA4Hf7yPXCUSiIUml67X7wYGObrCaoKmvWeXp1gLR2i26FSdzA== X-Received: by 2002:ad4:5e8a:0:b0:6b7:551b:7800 with SMTP id 6a1803df08f44-6bf50c4e22emr122066976d6.19.1723635569305; Wed, 14 Aug 2024 04:39:29 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:28 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:22 +0000 Subject: [PATCH v7 02/10] media: venus: Refactor struct hfi_uncompressed_plane_info Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-2-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- 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 e4c05d62cfc7..5e91f3f6984d 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1005,7 +1005,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 Wed Aug 14 11:39:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763372 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 4234E1B011F for ; Wed, 14 Aug 2024 11:39:31 +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=1723635572; cv=none; b=fmqXxjJs/BVZstWtDINDERUJRAe9t29fiuHASFK4nZLX9YIzN5I6rzK4XksH0f2i3RGrqyjWenatMIGF+TKXhzSHeiQWx3NpjEUcc4KJ8EPvGg1Ds1bt7o/XkZjWmXNl4uGOqz8/wcD+9nOQ+Yz5ylQ4TjGrTQ/NDKrX9Mpf8gA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635572; c=relaxed/simple; bh=+fyewBEAHwhWWYY8SehenMG7FUCiXBxuJ2SmDJj7qtw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=btOn/4ZzwMEKRHEAa2bg2oaZTG0bo55ys+f94IKxNvJRiP+qXFRJHdAZossLDRq92mTRdTIJpy9CVnwxRmagk6kTHwFK1LOCFhFT94PG4QMuFaJlKmsCstUt9q8/00usI+kVTwBKzxKi7K/jVwB8M8dlzP9xUpvusuBDkiNaIeY= 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=CM9vDk4e; 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="CM9vDk4e" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7a1e4c75488so392842285a.0 for ; Wed, 14 Aug 2024 04:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635570; x=1724240370; 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=dW6BndWIicgTEOdzqt9NbfZI8whTCoSZbzVH2/mWmSw=; b=CM9vDk4eDQ38IQrHnf+iMZkTAdKLqFObh0EuF0LC8hHmVaUCQYhrVhjsViXNZTTugD 8uqYmzvXxnT5z1i6AaRAJv5frhtvD50N875HgRHy7aO0MVcV7lHGfVEBn+6j3l6qzbUD ueu6p0GWgUYOFxdwee6AS43g5yfCjzQj10Azk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635570; x=1724240370; 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=dW6BndWIicgTEOdzqt9NbfZI8whTCoSZbzVH2/mWmSw=; b=EokSpQHbfUfIUV9FSRzaMBRA+AfBhacOTZnSQDANFv7k7JQHN8Oc6ezBJKAuV6bl6t JNjmU2iGlmqCXZHtnC9KaTeKUkCccMQrK16iKLi/viFWB6uuXeyu6BSXhi719XI2PW9h yAYeqKe9J5wYTy1DuGu0Y0ggIltlvFnuV2oALRCSs6Y2ofhPzj0fW9PSLSdXV5ZypDbf 3bBLt5t3i9jn6s7sCOeb9qhcM49Gtrk93F77J6OcY98hURw0LDvZnw6lcr8TG9bppEbK oBgFD9xleHGoPBe50QcSMayJoSN5GcyoTQhIFFJYp7hhiEMhX3KtEhA9lWaYR5GrA16+ SWGw== X-Forwarded-Encrypted: i=1; AJvYcCWNjzNb8xpyA/uax9Lm/ffy4fmNQlT6bDHUcy+QvzxrpZfV3qovWeLFYDkuyBQPUAxARc8QhXVSgURxDoiEJDrnPPrH39OB24O9UY19LA== X-Gm-Message-State: AOJu0YwTno4e3eJkOWz/k8Cs1rGkoO77mvsGQLrwxbdGQwpTsNkqhDFv prpEb98ksPBX/qnYzNvPjQVek1420uYgiZFQ1h4PqdNRypsbZFIXE1LfxoI/6w== X-Google-Smtp-Source: AGHT+IFccd54QpZdtUkOZ8WHMkTHK/5uPBl6nsQyxjAc07rfGvSQX4JwOVC5B7G3kyUqPv1fefszAg== X-Received: by 2002:a05:6214:2e46:b0:6b5:d663:bb53 with SMTP id 6a1803df08f44-6bf5d15903bmr32696476d6.5.1723635570044; Wed, 14 Aug 2024 04:39:30 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:29 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:23 +0000 Subject: [PATCH v7 03/10] media: venus: Refactor struct hfi_session_get_property_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-3-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- 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 42825f07939d..b158fcd00dd6 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -217,7 +217,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 Wed Aug 14 11:39:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763373 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (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 13D191B0135 for ; Wed, 14 Aug 2024 11:39:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635573; cv=none; b=d+TFegzr84PbGcc90OrRdlgAfopTaSp2RFZDOVsbyQ98+OJ0j1MoXTvtZhEJgx/kep/yJ8TCSR50yDiw1k1iQogCjy+NnBvkECGHHXxGjsIn+a4fBl3Eli5AuculVn0jGtKg16NMmR0x7bjVB77MR7wUIOebnZK06KhXwsqDfn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635573; c=relaxed/simple; bh=Sv3wnLESn0x+4EjPwl9XXffhuwptYLQmakQ09d0MPlw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CTe2NJsdnko+SbsfFTOJUaVK3fT+ORJTSl1webZpSRVUxryasrCSH8BxLt5W8nMBb32cqxXPt8nfQQSylutCG3xC7oubGtXVW/QPHx5EtFuxCagvnvdJoei5p076mCQ3IHSSYJd4NnYvILelw9VXHLqD6xpjNvumh7fB+sga22U= 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=kgLa47Hc; arc=none smtp.client-ip=209.85.128.175 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="kgLa47Hc" Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-66acac24443so66030907b3.1 for ; Wed, 14 Aug 2024 04:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635571; x=1724240371; 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=NbZBMh9jJa4Sx0XDfCtUJJo6xYR8XeaNAE9cdhAst/g=; b=kgLa47Hc91zsevsh8GSdETSKT864Rccdl7DTPd8C3ry8ZTXANsv16F8HaBGoBfBRFr iu2Rp8QbabORqOYCYwk70uvqzi45fG6SQ/14Q/9UzG4AoEeNdQkzWondTfbGXhZRgtk9 8tBT/dkFPls8JCmzd6/DSL7IUanKkdMS1+TIs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635571; x=1724240371; 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=NbZBMh9jJa4Sx0XDfCtUJJo6xYR8XeaNAE9cdhAst/g=; b=C4xyKbfBcnr/m26J2UdZIFM6NpNRKYT8QizFk4vZ/ZmTcuwqvycuElu+lFz7CTMUoE 7QYzYmVQpQHuPi2FHKEejaXVKcG7q6wrwCEGfOU/iiivrL1gxnJcPBqGvP1xD1yPRlT7 wHcvpsimSCcHhRnalGdYB0sZlkePkBDax51HThHmIpdlgOU0nyrQVrwYvYbfSENnrDzZ BSXXfMbbLxU/NpZ5zbATb1hlyqoRqS8s4J0QWBTmOOcO0LixuQG9lmuArrzBlEKJD+lG kUR0NaPUI0nnl12K/QJB0YtIm9Zah1pFvoJ43MsS3qByxNLOCcaBYDUoGGg7ORoeIA5+ Fm2g== X-Forwarded-Encrypted: i=1; AJvYcCVeP33lRAqMmDOMJ6xdbkAdnnGVA08HgZf/9wrjrumOEc4qe46Iuu6rvlrO96AsgqJ1XhiVPNoEppe9Wt76yLkrAcKWGNqrvactiKeZjw== X-Gm-Message-State: AOJu0Yz00tksvPjIbhzqdd957Ov2OyGVydMwvuxAXiKZ9W0DVt4o/dJ3 0BmHd6VkSxAs83hSv9E9/jb9ze7hWTJc18nU95QzCdZqNavuPULTo2fFbomsKQ== X-Google-Smtp-Source: AGHT+IHRsykAwCMx5tZRxY5hmqyA+Ey5x0wiBbORQkW1hfMduV6yGvJe4ltt2zFO97WRae+NRAydfA== X-Received: by 2002:a05:690c:fd4:b0:62f:cb31:1be with SMTP id 00721157ae682-6ac95696a52mr30104587b3.8.1723635570906; Wed, 14 Aug 2024 04:39:30 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:30 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:24 +0000 Subject: [PATCH v7 04/10] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-4-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- 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 5e91f3f6984d..3edefa4edeb9 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1011,7 +1011,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 Wed Aug 14 11:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763374 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 DC6AA1B1418 for ; Wed, 14 Aug 2024 11:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635575; cv=none; b=KMkx2LLzPy3BF5XiRsAWzyNlGEw6p4yD7BCPUrY0A6ydbOk3Hp/ZLjovOlwkBP00gvtZyrABWEuN0dwwMcWyIjXI22fa7At/29kNGXlW/Y8Vbsk5lyQnfe/AVZKAiGsdLXlIlEsnNte+gmRUx6JI6wRe+feR0CvSCAB/g15Zo/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635575; c=relaxed/simple; bh=vxzbkABevUmcO8zo0C7ffTq3vZBZQCpob+pP/oWgid4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XX2r1VSHVX5lHpkkpjJb23p9fHh8GQgfKOjxMtd15+Co0TTAzdYx3S3emF9fweOpZVR2xh6m8CZ/1BKuZg0ldLRSFEAwHIf+/p/X+qACZaqO9L2nRGuGxvVXpUc7lj2H6pBspvd7Q2ckDcmo/i1EhyxnBhLngwCC2ESj8oGmaSI= 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=fAlj16hB; arc=none smtp.client-ip=209.85.219.46 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="fAlj16hB" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6bb84ac8facso31611966d6.1 for ; Wed, 14 Aug 2024 04:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635572; x=1724240372; 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=1MENOIHt7duNVXQ/OhDJTUUPml/BdyniF1Xogw88blA=; b=fAlj16hBsT0Zg4mNV7uEnToGIC2FYF0XBYbGOjc25B9h+iJLFIHPmM9Wcb0PLZP65M DR3EkwSs55xyKdDzLB6ytSsdNhJEFSh+qnIMLnITU9iBJbEUL6I9+EG5aE7xwxtS2tDT vnMX2ZX6/CrNN4FktPtSEU5GGiNbwsIBEc/50= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635572; x=1724240372; 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=1MENOIHt7duNVXQ/OhDJTUUPml/BdyniF1Xogw88blA=; b=rUHCmY1UZAgEcKudTo6TujmTzqTEoz7+Xk67Hw0vdS3+5xfbMPJUyTSUEq3fx+opg3 XLpRRGdavTkpW5OM5xpbCeS9e/q4gYykWWVNovVO2PwBD5rGWrmQsDl8GrYLdjtq3kAB 9wN7bh08FyHe86KY3Dq8dEq9wPyk6SlAy/WmNiSakM2if/uVyye/XiXklZiPndl6Jl0S nFGyphh1ZhW5KtFNbODxDcpkfbZDifmjzW3TLIiV3p+WHEVjF0RbFeGaDCxDZLtJeA5K c4UUhlNvHmi4jhI69dN2F6Z1CH6vKHJsf34+LiCzAyirRGA4rVTCu1tD1vSaS68rF9Xk FQ/A== X-Forwarded-Encrypted: i=1; AJvYcCVFvgCq23uob5m2zh/hGwxnFUuRXcieJp5TPEZHouUyQAwX1CVjN+aYWpM0nzQHm412b7ROHNgqrNMABNhWM75ZuVv+UgFPPV4S6w9ZMQ== X-Gm-Message-State: AOJu0YyDSerzUbwKaLcEyJsmPVvRYgySRpwN5Z5l/I0rPMvd2beSnR12 qtTPTmu0OIXpnvxvO+pmqRZMfliGnsoxAq89i+naqbcyDxXKi0CMXidLO1pQhw== X-Google-Smtp-Source: AGHT+IEOOVmvcPoN/8++vzKRrLZToSjJo3+FaNbM1KRubLyRDXu+jabIS95Y0MPfG5GFa5XUFcn82Q== X-Received: by 2002:a05:6214:3b82:b0:6bd:7373:8c8c with SMTP id 6a1803df08f44-6bf5d1c492bmr28595046d6.11.1723635571850; Wed, 14 Aug 2024 04:39:31 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:31 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:25 +0000 Subject: [PATCH v7 05/10] media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-5-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- 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 b158fcd00dd6..01f5463e0fa2 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -168,7 +168,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_empty_buffer_uncompressed_plane1_pkt { From patchwork Wed Aug 14 11:39:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763375 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (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 B2C601B143F for ; Wed, 14 Aug 2024 11:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635575; cv=none; b=P5ya3e546NquDKudGr01ydIxG5vF5Y+1zG6cT+ejwzNgtpIN26Wpc4yjydXLNOwCirsfPXXfZXVvRccWJUa1tdklCbUOg1te51h30Mo54YJ5Sjbt6tiIsqSenyxLCkC1tcG5wMtJ4Ocu8CWHWcuUwxnlaM0wtO2miREXtVF3/4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635575; c=relaxed/simple; bh=pyIU/wpDxEysTH1DK2l3U//dOe+Y8cV+Qr1aH0szbt0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SfoR1rTdfjEmvz/VCumtrCS8YkwpzCwlwZyCkOsqSRjEptVFINSlByssJRUrEO1MZ4MGMZQuKYM/tpOROKBar//QvOeRA52iWwF2mryeSw8Ox1KpbgdaDM4zrLboIfYSCPtfOAmQ0pkHvpIKSgS9phUc6Xh4XfqeWeCBo4dEwzw= 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=Rj9rWN5S; arc=none smtp.client-ip=209.85.219.49 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="Rj9rWN5S" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6b797fb1c4aso43910596d6.2 for ; Wed, 14 Aug 2024 04:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635573; x=1724240373; 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=qra7e6gnIzbOaHScJoaGRuYLxVmqQHQON+C6sPV13Dc=; b=Rj9rWN5SWbVlxMVFVqcNHkrlGVSmvj9Eukip3/VripbTHZCW0CElsZVBrq/k7g7l37 1S7OjJBqNU2T254laajEykhKSto0MDjFI3FKlF3N7bcy9PIi5tvHIE1xjZ500VLD2BAh xChfWjyMrQBJsuqksHp1GAvsoM//pZyAvC8HU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635573; x=1724240373; 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=qra7e6gnIzbOaHScJoaGRuYLxVmqQHQON+C6sPV13Dc=; b=KJXujU+je8VRdiRCN2fwPAeyxskY9U0vZ+i2HVy489ZKukjoDUyzDIHDc2fhAwtkCd pGy+xEzyfPn2MKBmps4KsHJRnIekYxdGEwiOqFrEkBGXieAjJNahKwdIiXAtKf8CA1DG Un8chINJK5ZX61RCAKtq9lgcevq66WMRtwWhj9+xiITXLFREJyhW2caMK9vgtDx5o0QI kHP7PRa/KOo44ne4I3GBQeBN2xi/XZc0Z7YVaThIf6SFRj12S5WyuIhByZObpeq/qe/E RV+penSuxftcLjJeH4RH76EwYFd035PPSrlU+owThMws0egid5EszybK8SZtKdWLrTxg O/0g== X-Forwarded-Encrypted: i=1; AJvYcCWvQ8ehru3iqiEgjiZIEecAVd//ibHPhWHu975lC//HYbyMVYXs/Ex/30RfRy2HwOI/wrl84NKO4H5mOfJJB/LU8Rbt3xnqca2DHaQjBQ== X-Gm-Message-State: AOJu0Yw8Tk7zd2NK1t0BWeINNpwBflb30caJGYLYeEi0cP/dK30s420x OC0anmkL2GNKEtlmlUQlyrUpE6cY5tdBlKkRkmIjzfNc4vsCu/njS+ugYCoS+j4o+9CTjqtugq+ thT3d X-Google-Smtp-Source: AGHT+IEwgGa1Gx+up8FUs2IaSrC67k7jaLZQEMvAtBGuuQ1QJth3AQrJWfsKiZSm5YL9CycnW+R6RQ== X-Received: by 2002:a05:6214:469a:b0:6bd:9622:471c with SMTP id 6a1803df08f44-6bf5d1642d8mr36612546d6.12.1723635572647; Wed, 14 Aug 2024 04:39:32 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:32 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:26 +0000 Subject: [PATCH v7 06/10] media: venus: Refactor hfi_session_empty_buffer_compressed_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-6-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- 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 01f5463e0fa2..de0bf2399505 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -151,7 +151,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 Wed Aug 14 11:39:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763376 Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (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 0D88B1B150C for ; Wed, 14 Aug 2024 11:39:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635576; cv=none; b=NTF9/T9cZRD/BmoOUGeXn4+pzrP/P8iHq6sH29Iu9edGWmbanp4ocVsXmV8ewE/dfXId0BuQ4JKbi5wS7gy8Ub2KY3PxcRnsCJ4epP5sjsnzM/0fPA5UpR76RyU5duaytyCBpfQ5Mou9+54FJW+IlcRJ/GRXifh8Uy8UApvWVDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635576; c=relaxed/simple; bh=gk4QNEzmTFA+fqvMiqWZtz5y8Ao9GZS0y5Lg+TJlg/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VBeN1Db68BXG9bhSo9CKZI++npOk21mrrXhT+RZ+arKI7YZEg44LJM2ZBDXEnNlH4WOgWKjNnJVoFAM/VEcxfGKBkiK10I8gz5IIK3ltpMLUw2WxGQGSXMSNF4W6odixx5budLMKoc5HXWxdy5ETQen8lJwnxEfIiZc2vNVEWFs= 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=bnorKWXa; arc=none smtp.client-ip=209.85.219.41 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="bnorKWXa" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6bbbd25d216so7003546d6.0 for ; Wed, 14 Aug 2024 04:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635574; x=1724240374; 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=MZhV7hkPV5YlSdrc3t2vELDUUGpk4drcpL8ab8KCXVM=; b=bnorKWXaAvYFa9Jz8Nc9eaADLQPX6cQwIzLrPwWDeKMUajrTuFM1e3qqhyfLiDJPkX P3aptWaC3SB5e8y0PQTsfNEpSrQXLbhpj/dt9Mvrm/eKP1tJVP7bPf8i1mSxn+GmZ4Ul wRB/uisJx1gM+WVJ4Qh47xzpc2pMtZSuueZwc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635574; x=1724240374; 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=MZhV7hkPV5YlSdrc3t2vELDUUGpk4drcpL8ab8KCXVM=; b=RwUpH/waOciKJ3tGPJcMZD5IX13zE6KmLaUjAjg5v4pBd8OaKcThHV8SMV1zw+LboV EEa68rgsMWeYnGC8AFzfQV3Xr6KR8ealNrMtEgWQAQVJ80dmVfuWJxEVBGfRg/RKZUne MKfxnIY5MxwlllfHlcg6JgocXrHnYpy+exTg4fLkyBk5SzbVnNZGR/axv14eMNki0Hqr oQJhl1PTr1gmK6S7lk/nEekN9VPIeQmmazdWn8kW86J9ONqtA0iVqT51qnG4TcIrLHFo RGdAY48eG0tYu3ZhPyt1Wla6kqKgZT3KEDUsK2A3YsA4TdudPH1qbmiFwzyIOCmuZxha Rokg== X-Forwarded-Encrypted: i=1; AJvYcCU4uX4fhLIRgSif2Mf70Ow01OaZwj+fMOM68ULegHHNAVRqtxycGQgU8DikoBWEsjuyMMeTTRbyAXHhMyr66R4O0gS84pZuvH85QTQD4g== X-Gm-Message-State: AOJu0YyEWeRwn+uwyJoKG6q2NopWBFaMuYc3FguWwrZNTncbFvk7UePk ERLha2zIdk4lD4ezQ8KB0raz7HFeE1NmGfpnW7y1S+9dJeUs/J/5p9SGek8WLec9yBEwmDdfCow 8pVNg X-Google-Smtp-Source: AGHT+IHU2rwzo/jfsznQsavVkiDnzev6AHoPcWEldqEoikU9zq/6RhKey9BfzttvpRF+80edEWKwPQ== X-Received: by 2002:a05:6214:3bc3:b0:6b5:2f57:1a63 with SMTP id 6a1803df08f44-6bf5fa5be80mr30493486d6.21.1723635573948; Wed, 14 Aug 2024 04:39:33 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:32 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:27 +0000 Subject: [PATCH v7 07/10] media: venus: Refactor hfi_sys_get_property_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-7-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- 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 de0bf2399505..615ac8d156a5 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_set_buffers_pkt { From patchwork Wed Aug 14 11:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763377 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.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 316B31B29BB for ; Wed, 14 Aug 2024 11:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635577; cv=none; b=r6VGXIo4B8tp0Z2/bS6e7YI6o5x3MPuKO/0+3ad+d8h7Ex1twiyMhIlVglFuFHxRD0jPjtfpZMktv4GWHzosFHAq+J0YaE8Eq8G06gwop1Hmg/mwBF7u/Y/xipet8Upuksp0lqdr8Lu9Adz5s8zf89t4lHWkUIl2a7ks/BQcc0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635577; c=relaxed/simple; bh=f6aJO5y6qctXAQENL6bRNRqn7Svp4lX0kLbyb1uIrfg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EMZg4E5KgDguLSgzhmrwCaJuJf09i96dIg36FTYp9javtZFYMILZSKbNCZo9OVNDt2KCEj//BS6hWtbF9Y8ZplieNZCvGUrPH1nV6V726/0koMBSItb9LZGljSXyTBhUFBMPDQ0Kt2UdVF+M/5wrhRw1JjjIEKP4/IiInyfg7eM= 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=jP7pKaH1; arc=none smtp.client-ip=209.85.219.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="jP7pKaH1" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6b7a3e468a9so44704196d6.1 for ; Wed, 14 Aug 2024 04:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635575; x=1724240375; 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=NbltI1PXy7zluZAqPhIhWps9lyd2iHaX1NmD3KiJbs4=; b=jP7pKaH1FS1FDHZMSvdJYmL0tIwRsFhvHp8rGnDsLCRMLU22HjK2Uzvp4vLh86XcRU cYSD2zNqlFWWFyCsAWDoi8fYEfNv6xmh4HkaGKcK0hihWUQ3j5AumE8+FNaCsUJWPfxH UdjNX5LIa38/ASmHG5J6bEPXH7HsZ15Yec9qU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635575; x=1724240375; 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=NbltI1PXy7zluZAqPhIhWps9lyd2iHaX1NmD3KiJbs4=; b=kIcu7FtyP6ZL7v6J8nAzQdJfiOsCF3nG1rhKW0Y233812SI39/962ycYLb8+6G5vOT nmaVoZeyT2Nzzbmp1oY7McY+T0gX8Cb49wzpFfHuRod9DNvGJtvBUGYrOApflV3UE6sx uPjw+3b6nJ9YKaSGKZBKZ46+LMExP9V4XMkaUNseX9N9r/TMbK+DL7dYnSJN57r5UsHb hlIRNKL/pt9L37OJ7Zs2/sSl0CNVNEZltuWcxC0G/aHptj8Pc8UcBUuNdyXHitE5xAp3 QuQ2K+eyyJ3cHmhH4VogwhqwUYpNZ32izMzP7IZ1S4nXH9VKUVvN58hDjp41oN5Qpu4N Tp0g== X-Forwarded-Encrypted: i=1; AJvYcCXJAEHmF+GbMeTuciaNDGpHOpqiykDr/A0EgF5p4KWi1FaRGmqLrWWKyJd07/6yaWWf8i2Bh0YpF1X+kH8r@vger.kernel.org X-Gm-Message-State: AOJu0YyM0HGutecpYhgT4T/kq4Ianq6inACaSSVSbBy2Pfvc/kxWkhH8 +pe58qD2i+YQXwro/CcMDIKnzRsTtxxqZInUXOT3mJN9b5LCWsQnTT1wP1ldVg== X-Google-Smtp-Source: AGHT+IHweFCYSrJ5VlRLFH54oNC9VVSNaAo0rog5MOspE2NEaZXjQiVr0KeUl63PY2kBjjhRdDlavA== X-Received: by 2002:a05:6214:2b91:b0:6b5:a8b9:e8ab with SMTP id 6a1803df08f44-6bf5d273a40mr23415216d6.49.1723635575168; Wed, 14 Aug 2024 04:39:35 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:34 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:28 +0000 Subject: [PATCH v7 08/10] media: venus: Refactor hfi_session_fill_buffer_pkt Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-8-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- 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 615ac8d156a5..63b93a34f609 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -198,7 +198,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 Wed Aug 14 11:39:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763378 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 0463A1B29D8 for ; Wed, 14 Aug 2024 11:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635578; cv=none; b=kaGUONCsBxTyKcTp8Fo193NGJ5BxpPhHPGCh2rMo41Co/arrDhVj75BhSPkxx2zLOEJp/ropDmiOHsSy64rQ7vMuSriStfLq5hY9yznnFBReij3oRaHWInLGWusaH9BBUXhB+53oUUA0cP/TcgBHjdwr4zQk5PgL0c5Czf34/Wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635578; c=relaxed/simple; bh=RUkSvotJiUicAjr125zoqk67Yg0Rr4Z0u5b8fZH4uhY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qe9ry39bo4emvAQO72QjC+4S+7wa+51f4uCc7ncU0CH1lFIBR1yDMv3jrakz/mLYBm2tqyB9kj9+CpWhXUKOkXxF9XR2OZgsLJd3zIHOCE6gbgDtmljhNdTm4KCs7FVm4l1rsQqM/koY/xJkgFcpb4Mkwd2EW0tLOxXOO6ihxH0= 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=WtSgc2N6; arc=none smtp.client-ip=209.85.210.45 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="WtSgc2N6" Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-70942ebcc29so4470130a34.0 for ; Wed, 14 Aug 2024 04:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635576; x=1724240376; 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=RN7Dnd0r7pjMqaCAE+J4vLBmG7zkz8JhaZ76ns/e/WE=; b=WtSgc2N6Lp5Fl+Grd8i857ttdZESlfUR3gycn4LSWe9mgJO5RleWN/SDlvDQFFaKTS 66ca51LN954cVM1yzs2dQaL0kta7EzRXYt3ZdzafFGHckK1YJkZmaNB49P5Tw6aAjIED ph0J44PeYGW93g3Krf3LrNhL31cveht7AlS8o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635576; x=1724240376; 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=RN7Dnd0r7pjMqaCAE+J4vLBmG7zkz8JhaZ76ns/e/WE=; b=YXxK8SaKB9TVr1EiuKdYZ7jkl2cUBGng7okWtSm87ngHj5N39rv0MJHuanbOPh3WRy EpUU4XussnJ/GrfGURrE9XB44zU7BFqVdJ8eCSQchvyRBSwVdB9hpXmhJI2zYPVwNLaH r/Tgq74hZcr32kLjYgP0R9jmolp2t5mu7AnjRwCqkrOvhP387VH6YA4Dpr9pwrB6EeNs rFiZAm2pWpnQy0/iolMmWp0m9sXDhoDMS4ldzppRWVn5YxnBXy8IjRzDOXeUcdur4FFs y01JCBMdlXVk9QPGzzZVZj2sDfFBqZQoyKKcrZRKRQD2Cn1Z8TkPnLwgSgZ/SSvzIygZ W7xQ== X-Forwarded-Encrypted: i=1; AJvYcCWoWdTC+WVCfeZPxUoFCNbrSMYxlljPV4/ola8EeoXdeqdpA4IZ51SMqDlUJtD/0BRbROjVhwXWeZqgPTvs0GP8953bWB/oa/7oDbxDXg== X-Gm-Message-State: AOJu0Ywp7teZ2UL6oMy3VeW3pC5Cqp73J+nmM6NCylfbxu3dqgkSg1me lAN2cQCVccMFwuBbEXVuZPLlwjCByALV+fcWEmKYEs5D/aSG4pN8krff41ngYg== X-Google-Smtp-Source: AGHT+IGw4C+RCNiH4eerEXg4HBAuopT+VKBys5fIpTb7JFfXnmm4MV/gGIeWJWYBjoI+aevyYEu96w== X-Received: by 2002:a05:6359:410d:b0:19f:2c7e:a226 with SMTP id e5c5f4694b2df-1b1aab1a74cmr270917155d.5.1723635576040; Wed, 14 Aug 2024 04:39:36 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:35 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:29 +0000 Subject: [PATCH v7 09/10] media: venus: Refactor hfi_buffer_alloc_mode_supported Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-9-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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) Signed-off-by: Ricardo Ribalda Acked-by: Vikash Garodia --- 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 3edefa4edeb9..755aabcd8048 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1264,7 +1264,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_mb_error_map { From patchwork Wed Aug 14 11:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13763379 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 19B221B32C2 for ; Wed, 14 Aug 2024 11:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635579; cv=none; b=rWISe2bfgd7yTld7iMKciPqKi+8NX76a17x/VBKh8Qg84Xvg3Sr7iSw+oRskjr2Dtu5p0Qxj4qhvp+mxCRsT6Wf2lQlYKqDolb2ulR385vKGGG/ur4pvdc4qC3ZO1nL7inBo8x1jyxrd84akCx0bBn5Bzt7mLQ/xLOMvANDNAyU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723635579; c=relaxed/simple; bh=+CaEvMFtp6+vW8dd+4vdYR7UCy2/V+0eTuF+Ay8On5w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JRahOH2rPlELT7A1r04wVrho8hhMBlsOOWAok7cOUo5WthSeoyXnjKVZqlw6QsKBH7U8yIQ1PyD7RnkYSvpCpWEN7BE5QFKi5JZJ98c6Rb3SSlXke9MH/FeyJHCqMKNpWYEVyagozyrtO3NWXsQ50Tx08AkQQVoyrTpNbvA4yNY= 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=dl+QfuuJ; arc=none smtp.client-ip=209.85.210.45 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="dl+QfuuJ" Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-70938328a0aso3820400a34.1 for ; Wed, 14 Aug 2024 04:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723635577; x=1724240377; 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=GH6hs7TBxxS/YEw6+1SJGhyHiJvtnJuQXXY87tDn62g=; b=dl+QfuuJiepA0A96RA/13tNw9Gls+s5+sJNv8SvpTJQTw6dnpKwNgMSkbFEbUlPpyR aYvoWDSB7nGyf9LbgZ4GaFgDJDdaOZmfUvPDO/M/rGc254ywYRd5pvI3+dDMJ3Q2w88T yJumYIb4YDlfz/RtTDucpvHmITPnBYiIu/rb4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723635577; x=1724240377; 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=GH6hs7TBxxS/YEw6+1SJGhyHiJvtnJuQXXY87tDn62g=; b=Cs4NNfhq9oEe+9mUTsviTZYZCYZm7d2kLHM5s4geRHLAV/87UlF2r0yLqnLZT3URbN UXb0G6msxV2+H1VlUBn3d4GZhWMPleK9PKzIM0aMnmBIchJW3y9rWlskeMsG71C7dr73 hs2wilbl4FvkyYwqN04lSs1LduSWJfG/inux46NQg98SGvnWI4AqtxYMBMxrPX389rtg M0Ho7H5wO+tGtlGBEspNs1YRNFhpXq8IRCks6N6Jdg54zNDxQgG70uI9fCSe9YXU2sFA IGO4VOzEh92luEGqVZMP66TAMJz9c4wpuu/HRZQKk3rhwQW9/u1ljM9KL4ENNXJhmwXd gxWA== X-Forwarded-Encrypted: i=1; AJvYcCV7j/scr6EQB/LxSdgrkw1gI0zdJedgbpwIrYf+uYMTq/JNpc+rEbDKew853mUzTS7PNqPzLpM/qLvSSSrubExxsBqlibAo9ozR3BCNUg== X-Gm-Message-State: AOJu0YyBgV//f9u2Xqoi4MIllv8MDm3rr8cN6GKTkgtW9J+YMY7O7WtX eBRv2o56Ec21wCgw1hH3z4fzg5ogJ+umvaJlENKS+TNERqbCAhTY20lO5tZsjnZ9o/o+zVJj4q3 fgrYZ X-Google-Smtp-Source: AGHT+IEtMdN3+LLVZ8wsdeGDjt8+c2zo2szF4F9XAwgyc+ibeBZWZn4V0pAfv9GBu2VgPAmVm/URKw== X-Received: by 2002:a05:6359:410d:b0:1a5:dca5:a902 with SMTP id e5c5f4694b2df-1b1aab85aabmr281649655d.17.1723635576908; Wed, 14 Aug 2024 04:39:36 -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 6a1803df08f44-6bd82ca0daasm42167916d6.68.2024.08.14.04.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 04:39:36 -0700 (PDT) From: Ricardo Ribalda Date: Wed, 14 Aug 2024 11:39:30 +0000 Subject: [PATCH v7 10/10] media: venus: Convert one-element-arrays to flex-arrays Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240814-cocci-flexarray-v7-10-8a1cc09ae6c4@chromium.org> References: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> In-Reply-To: <20240814-cocci-flexarray-v7-0-8a1cc09ae6c4@chromium.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@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. 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 | 6 +++--- drivers/media/platform/qcom/venus/hfi_helper.h | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 63b93a34f609..1cd1b5e2d056 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -82,7 +82,7 @@ struct hfi_sys_set_buffers_pkt { u32 buffer_type; u32 buffer_size; u32 num_buffers; - u32 buffer_addr[1]; + u32 buffer_addr[]; }; struct hfi_sys_ping_pkt { @@ -177,7 +177,7 @@ struct hfi_session_empty_buffer_uncompressed_plane1_pkt { u32 filled_len; u32 offset; u32 packet_buffer2; - u32 data[1]; + u32 data; }; struct hfi_session_empty_buffer_uncompressed_plane2_pkt { @@ -186,7 +186,7 @@ struct hfi_session_empty_buffer_uncompressed_plane2_pkt { u32 filled_len; u32 offset; u32 packet_buffer3; - u32 data[1]; + u32 data; }; struct hfi_session_fill_buffer_pkt { diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 755aabcd8048..f44059f19505 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -761,7 +761,7 @@ struct hfi_multi_stream_3x { struct hfi_multi_view_format { u32 views; - u32 view_order[1]; + u32 view_order[]; }; #define HFI_MULTI_SLICE_OFF 0x1 @@ -1038,7 +1038,7 @@ struct hfi_codec_supported { struct hfi_properties_supported { u32 num_properties; - u32 properties[1]; + u32 properties[]; }; struct hfi_max_sessions_supported { @@ -1085,12 +1085,12 @@ struct hfi_resource_ocmem_requirement { struct hfi_resource_ocmem_requirement_info { u32 num_entries; - struct hfi_resource_ocmem_requirement requirements[1]; + struct hfi_resource_ocmem_requirement requirements[]; }; struct hfi_property_sys_image_version_info_type { u32 string_size; - u8 str_image_version[1]; + u8 str_image_version[]; }; struct hfi_codec_mask_supported { @@ -1141,7 +1141,7 @@ struct hfi_extradata_header { u32 port_index; u32 type; u32 data_size; - u8 data[1]; + u8 data[]; }; struct hfi_batch_info { @@ -1236,7 +1236,7 @@ static inline void hfi_bufreq_set_count_min_host(struct hfi_buffer_requirements struct hfi_data_payload { u32 size; - u8 data[1]; + u8 data[]; }; struct hfi_enable_picture { @@ -1269,7 +1269,7 @@ struct hfi_buffer_alloc_mode_supported { struct hfi_mb_error_map { u32 error_map_size; - u8 error_map[1]; + u8 error_map[]; }; struct hfi_metadata_pass_through {