From patchwork Thu Jun 6 13:16:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 802776 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.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 5FFB1195B3B for ; Thu, 6 Jun 2024 13:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679853; cv=none; b=XEVZmlQKr1PwnBnmpJF+HS5bjHa0IylqtDv7F6FxduWcEAIfHeHDk2IJShr0zFFD3YySiD8AMhxkKPoXFKBOc9++KdT6fpwF4cYQytVOtADfvSDwrBSWI6FXKxkYLV/WfeHVMGXuL9+oBe5dUyO5ZC1Ul5Nj9IGwxc0jHIfv6Z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679853; c=relaxed/simple; bh=9Ex/psXstRZqGMxxPJ0VpkCq64t7rGKg+zLLyU8qbQM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Th03EPUCz9plt4M//uoVz0wifgNiocOl3dh7tyW+AIGS7ew4U+195Vl2Mu/Y25XnRqsNIkYZIc7/3ASKDeVpYHkOW/zzNfN3YeNMN2nAwB90DX4VXseVw33ahgtDSWd4BZGvwA9bfyk0+ECK9WurQMr/xNR0+Z5wPyxQD0Sywuw= 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=NvYMBhPb; arc=none smtp.client-ip=209.85.161.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="NvYMBhPb" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-5b9794dad09so419738eaf.3 for ; Thu, 06 Jun 2024 06:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717679850; x=1718284650; 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=AAL4006xAnRJyzvWwdXcDdqMP35ODneV2/4JxIJoTYE=; b=NvYMBhPbL4ddCR1Xdo0TVjY2+0mkBDXcQoJmDaBfuAgBEBD5KBI+0Vy9Ew7LZ3U64g gqGYDYnPcUh6vAl+FOBCQdz9IbPMcv32KFFTjVy5vxB7Y0wv7ovxcZgmcRTNmJFVjL00 7szNGD1s7aojdVbkjcCPwbxa2KzrH/8JTxr2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679850; x=1718284650; 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=AAL4006xAnRJyzvWwdXcDdqMP35ODneV2/4JxIJoTYE=; b=jnN+zAKaANvco6HMP3EONU8va/RCQc6Yj6YGHvmaLmunwBaMU9QghIWtYB8yNMODPj zb+qD41PjnQx2iKGoR36HxEK4/eTd+B37P0Dt0vcqOVim6Z1v92poByqGo3f3ceaznh+ 3+zNri5YL9uizEv4IxGEtTHE6vLkmdVJZFve51YWx+sgO+XtIpIFr0zPvt9GS58HrBPu REh5DxEobtUQj27l3BrfeN9q/pmt9TxS2xNTzE7wTtlq4pfbYGKuZj61TTSte7PFzVlD ONSAViJoj1qpDb5L4Xv0Cb1qdEo14+CwR8P4aRt6s9tHE32tFZ1OoaDe2fnJAvsn962j CeKA== X-Forwarded-Encrypted: i=1; AJvYcCVfabgy2+lf9wuYlJkGn+zJ/u+F2B7mue3lf8IH+Z3kM2/jYp33x0pJS3rnRWpo5uY5XJwXpRwqGfNejt2C4c75NW5S7fRs40Jd/Xo= X-Gm-Message-State: AOJu0YyocYZTx6VxCiFH6PQP9rXX80fjmfpwcfc0VPqrdhg+4BNSxO43 FeudMWvn51enXSHdVmslixIg0DFUeQnByNolvJVf7PZIxcJkURD9/QOL0m/vcg== X-Google-Smtp-Source: AGHT+IFMfHqWudPNwZ7gEE3WDMg2/DCijf/SGmLWSwqmxlW9rIKDz6JeqdjExEkt/BTcjfNpWLogIg== X-Received: by 2002:a05:6358:2609:b0:199:2b63:9f42 with SMTP id e5c5f4694b2df-19c6c68a2femr652957255d.10.1717679850292; Thu, 06 Jun 2024 06:17: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-6b04f6607f5sm6118036d6.31.2024.06.06.06.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:17:29 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 06 Jun 2024 13:16:35 +0000 Subject: [PATCH v4 01/11] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T and MBIN_SEGMENT_T Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-cocci-flexarray-v4-1-3379ee5eed28@chromium.org> References: <20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org> In-Reply-To: <20240606-cocci-flexarray-v4-0-3379ee5eed28@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.12.4 Replace the older style one-element array with a flexible array member. There does not seem to be any allocation for these structs in the code, so no more code changes are required. The following cocci warnings are fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:182: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/dvb-frontends/mxl5xx_defs.h:171:4-8: 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/dvb-frontends/mxl5xx_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 097271f73740..bf08d82ba2cc 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -168,7 +168,7 @@ struct MBIN_FILE_HEADER_T { struct MBIN_FILE_T { struct MBIN_FILE_HEADER_T header; - u8 data[1]; + u8 data[]; }; struct MBIN_SEGMENT_HEADER_T { @@ -179,7 +179,7 @@ struct MBIN_SEGMENT_HEADER_T { struct MBIN_SEGMENT_T { struct MBIN_SEGMENT_HEADER_T header; - u8 data[1]; + u8 data[]; }; enum MXL_CMD_TYPE_E { MXL_CMD_WRITE = 0, MXL_CMD_READ }; From patchwork Thu Jun 6 13:16:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 802775 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (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 24652195FD8 for ; Thu, 6 Jun 2024 13:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679854; cv=none; b=lRPuYC34wmDLkz6JGsjLGLPUtfJ+0T7S1ORedVtyD1q17qZfmSZswPn001walIpO4HbhNcbac8loccWgROtMI5Ft7f4a2hELoak+T8EA2LEB5pF0jVgesNgoiGM5kgwM5qv8ZXebqhYlJoXFHDuFUVm36yDZc85BdVJHfovAR1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679854; c=relaxed/simple; bh=LKep9+SsMgXIw7N/wwAo5L/YSHeXN3o1qd6elsENQvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RzoMAd7afZ8G3kajg839NovOXyQw0XD421wH+vjrAp7YfSJ+qT8J5/h+4pLedpOSc2cSgOvKs7pbkiB2nERzuD4B5fbVPl/PLN8am/DvbE+Vj3yJVivXnGj3/3Jvt2E6Bx+tjr3qPcIDcnyt7u+Mfup2PRaMdynRS1TR5QYNnl0= 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=Q8dS9Jfh; arc=none smtp.client-ip=209.85.161.50 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="Q8dS9Jfh" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5ba6859fb57so436122eaf.2 for ; Thu, 06 Jun 2024 06:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717679852; x=1718284652; 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=bZZh27lvax1pQKtebKo1tSyfI2/RfGD2+tRBLkwHpFg=; b=Q8dS9JfhUN0JBhPQ2Pc+v0JQqNI9KiQVlEXPQ4YhjjMFO4vefxSidC2dXIJ2fMT41b 6rUYMQCj/lQSwE5Tmx6gtNRVdD4pkx7Hg5Ex9J8uuMl76DnLrYLyKPulvDvDWrkcFSQ9 WxbuomJvMde3Xv92dEN+InNMT0gFjt8sqnSd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679852; x=1718284652; 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=bZZh27lvax1pQKtebKo1tSyfI2/RfGD2+tRBLkwHpFg=; b=cT44I/4HjBuUneKpzH1NGUdH4zWbcUpoKutr6owYLjN5HBbG0wVDWocsaHImHneZ0j XIeUr31PwZDPOmYhvC3SzfWZDC8tcewW3CKLKUK4WA71n0wworTfYsqkPRMUsZhEDnKf upKKAV78rOfIKJgkSQmm5vWabYrEjMg+w0ovrtgWjdNALSSANIfcgHdJPzZ8r3w5/kPV GBrei+hM2IQYpZfgRm4OrpT2r+L6QZ+teLCv4n+ysSaliGVb182uMDJB3F/sTSoJBIj6 RbeKuZpVSkWgd1OHp5jVxWrWI1xwO6m47OjUGEJfSVAMm9QbfeNSRarT6Z8j7gF27IdB 9vFQ== X-Forwarded-Encrypted: i=1; AJvYcCVIn1HKXdzXicWv/5waiLB4nOajcqgyB3SAHbXK00z2Ixv6Ims94UKnaQA4tVw+Ia73Z8KEK8txMi9k43tKLn24pmlYS1F0zr0C64c= X-Gm-Message-State: AOJu0YxK+oLizoqJBm4I1zt7lC/A75ugrblW8NqaBIgBbnvYCT1/BK1d P1r+nQRObLiG6FphELR8CiMjOT032Daisx54C2rdNzjlMmB77eYJInqMKFvFsg== X-Google-Smtp-Source: AGHT+IGNI9HGZGYM1bs7kXBQ+Gzd7oXjy4+AygNfoD1Lq7a40uZ9nWHXC95xkS7mtZToVDJBYIlggA== X-Received: by 2002:a05:6358:9985:b0:19e:e402:4d17 with SMTP id e5c5f4694b2df-19ee4025007mr233623255d.7.1717679852165; Thu, 06 Jun 2024 06:17: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-6b04f6607f5sm6118036d6.31.2024.06.06.06.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:17:31 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 06 Jun 2024 13:16:37 +0000 Subject: [PATCH v4 03/11] 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: <20240606-cocci-flexarray-v4-3-3379ee5eed28@chromium.org> References: <20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org> In-Reply-To: <20240606-cocci-flexarray-v4-0-3379ee5eed28@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.12.4 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 --- 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 Thu Jun 6 13:16:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 802774 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 D26AB196C7B for ; Thu, 6 Jun 2024 13:17:35 +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=1717679858; cv=none; b=FHYaii8zLkuQt4T7CLkg5sW/GAh4+5iXiB/08RtecuqRksz9FzDnOwteKFzI7+EpdeFyzXSvKEMy1dgX16D0Onj9Oo5aw9nbTp9SZYQ8ROVIqRK42eCeFp0VC54qd1qqOF7DssTcyuJwtDx4IzDucJbjyGLJpNBM1No6CJWN0k0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679858; c=relaxed/simple; bh=q/yIjMSqnXj8v7L7GkQC3K27otk7HPW5heUqxBmLTVc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PMbt29kIKx6GL0nVeW2V7T37TgLvLjHQD4FkKnQgApobD9ymoSXVXp91NoZlpSVELUTnAfTREs+DRDOvbUiDfcDc0ljZbJXF09mHWsTlhw1pn6JJsNed+UG/W9acDQo7QO2ctSX6Pj584849H+cnS8bF1nzorUIaU3Vm4D6S9cw= 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=UkKa/XJl; 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="UkKa/XJl" Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-6af27d0c9f8so4471506d6.2 for ; Thu, 06 Jun 2024 06:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717679855; x=1718284655; 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=e2AAUOSqY0VuuUiDfECnNkpzmbnAcXOGiikRuWRSAa4=; b=UkKa/XJlLcI5Ssyawo/sbucMPb9oT0FmCygLPm740rx/AcjqYX++l6CaF6nYEkSLZ4 CyxYLm0jWtaboiQXA4KL+w62uvipVV1pstDxFK/us1gRV12IDaLlj8k1OqSp3MWfu8nv Q4WdCbzl9rY85sr8hcO18Mq/E5nB1v0P46+RI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679855; x=1718284655; 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=e2AAUOSqY0VuuUiDfECnNkpzmbnAcXOGiikRuWRSAa4=; b=ttZbttqoUOcSVuk7U5pdoMu68LYpWUJJWpxzhgzpb2auX+l8h62R1/ntIEWRg/fwF7 S82w/AvLAHMPS2quEfS4etOfwWZBWsNVZUk2+sQMmyIVqN6kSpa8I9Zzkp3Pkf97yx/u 7KtYSOIHn8+KzvPjsLcuar2daMQhiI6XTC+Jhw8F6oGh95myz/8RSu17Rh2uXY056vXl GNjDh2yQzwkLgJsfgNLyxVYYnBwJcM5D6JGWFzCgPPBN8M5hurPvNI1wUEvFjE1XDvTA OKATGCM/5inwdr+TIkM7/bd+dttJE4ojLoADVOkq8+edTQluajVT4Lhj0n2+YP0lSvcC FELQ== X-Forwarded-Encrypted: i=1; AJvYcCWaIAbIdAYoMsvswTwvTaksxPYlyrkH3F5pmf4DhxwqfXcrdK6CZzmTdf0ShBX2etLQmKLVl07/UK4d1hVWFR3F6h+eDas5b+rK0hM= X-Gm-Message-State: AOJu0YxO1j8wg6adsKVou4KTUMvL2OEl+MhyRnhDDlHJwnJsX4iwzh4A l9VQ3WaW07Ss8c0Fo2Id1N47q9uEpO4S805wSt+jaz++CGSsUOJqXZ/15Y+r/A== X-Google-Smtp-Source: AGHT+IF2SHvoVvYn/P2leNQvN1o8bRfjg6tCknHvek81SGWfjCxGxX7kcfXDgqQa2sakPR4YvGy8vg== X-Received: by 2002:a05:6214:3d8b:b0:6a9:b253:58d5 with SMTP id 6a1803df08f44-6b02bf1eb0amr54587866d6.17.1717679854725; Thu, 06 Jun 2024 06:17:34 -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-6b04f6607f5sm6118036d6.31.2024.06.06.06.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:17:34 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 06 Jun 2024 13:16:39 +0000 Subject: [PATCH v4 05/11] 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: <20240606-cocci-flexarray-v4-5-3379ee5eed28@chromium.org> References: <20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org> In-Reply-To: <20240606-cocci-flexarray-v4-0-3379ee5eed28@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.12.4 The struct hfi_session_get_property_pkt is always used to fectch a single property. Make that explicit in the code and avoid a single element array at the end of the struct. This change fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_cmds.h:194:5-9: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Reviewed-by: Bryan O'Donoghue Signed-off-by: Ricardo Ribalda --- drivers/media/platform/qcom/venus/hfi_cmds.c | 4 ++-- drivers/media/platform/qcom/venus/hfi_cmds.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 3418d2dd9371..75f4a3d3e748 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -402,7 +402,7 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *pkt, pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_GET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); pkt->num_properties = 1; - pkt->data[0] = ptype; + pkt->data = ptype; return 0; } @@ -1110,7 +1110,7 @@ pkt_session_get_property_3xx(struct hfi_session_get_property_pkt *pkt, switch (ptype) { case HFI_PROPERTY_CONFIG_VDEC_ENTROPY: - pkt->data[0] = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; + pkt->data = HFI_PROPERTY_CONFIG_VDEC_ENTROPY; break; default: ret = pkt_session_get_property_1x(pkt, cookie, ptype); diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.h b/drivers/media/platform/qcom/venus/hfi_cmds.h index 6dff949c4402..f5708fdfb197 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.h +++ b/drivers/media/platform/qcom/venus/hfi_cmds.h @@ -191,7 +191,7 @@ struct hfi_session_resume_pkt { struct hfi_session_get_property_pkt { struct hfi_session_hdr_pkt shdr; u32 num_properties; - u32 data[1]; + u32 data; }; struct hfi_session_release_buffer_pkt { From patchwork Thu Jun 6 13:16:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 802773 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 6B6D1197536 for ; Thu, 6 Jun 2024 13:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679860; cv=none; b=hXq7hY3yUQPsb0a3osFWOblfhKOFZBaJSaeLEU5t5ATSdH8PKfmIEcv/iqnj/7H5ItWn6OSnV/Afgp/AxVwKyQCZswjCjPvPv6tsuHkcnQFVTYZwWBS7twEHg773P9F7BrTka8LMSIoaCigVmGmQlsGDNdzF4E4EjmGGODGBfTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679860; c=relaxed/simple; bh=rr+ZAD9eEY9wxQwSyBHAujNTY1n691T+07WEbe4AI+g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F1gr8oqRaZRcU1lO6iHx7niMIlVqFxtUuEJ+8QHZFwBHDM/5VGdYeeR7KppMqVLuyznIWy5egfM/IDlqHUPlh2MfCJXSn6zhaNsycOasx4n9BMV7ArWprTd7E9RG5j9kghoWxmyvlHodneMS/hho1um6CUE7kOzeKr8WUUjFX4s= 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=ntd/dDPP; arc=none smtp.client-ip=209.85.219.54 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="ntd/dDPP" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6ae1b32752fso5008606d6.0 for ; Thu, 06 Jun 2024 06:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717679858; x=1718284658; 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=rV++zhXkLm63xkLNQev5FMXGRPhSAuf2+6p1s7sOLOM=; b=ntd/dDPPjOuAXrysYvbBo83QdWpNwlilfdrgAUQYRbdE0RAfoenU+qfyECYt2/kU5r 4TStcYC0Gs8kNraSTw6Fie4A8jMmytxs6UO4DHIJDDCdQgKIsqfClLQkP6jtmko+q/OV A73vOxGemKnuZQYGGsJ8PrIZ3h6uygmC/JDOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679858; x=1718284658; 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=rV++zhXkLm63xkLNQev5FMXGRPhSAuf2+6p1s7sOLOM=; b=NQQ9FvRhQJLoKOw9Itt6tgCXXHpQKPMAeVE72TSIFWb58Hd/kSppweus2WEwzCFmVS Dk4yoxHKy05ydtnTUFRyb3nhNNM7s1DiXexUmIfn4XGS6kPER1eg1rDdpp9giChJVHmx wc91hGGdTuD0Sy+/MwOj6BRxgdZSpqycE6/+3o2VFUGB+G+dqkPi3CJeBAzyvq8PTcjS lxMLz2j3Dd6vktvnxbEvq5DIFlX+dUPFbwitFJAaZ/+XZ6wrpmn6OfSW38BrA4BdY0au IdAk7OcdjCyW9xUxgdfG1hiIJHBiaVkxAiIi07Ex0PA5tjlqoo4Zwkv83GeSnzjwR2dz 0/kQ== X-Forwarded-Encrypted: i=1; AJvYcCUPSmFYtZkkIKGTnNQeURTp1B2ZJc6mGywHwWlNPuNOcVLQJFnkru7Pz1ykCKCUnZKYH2mnzQELttfXiTDGWpgrMRuOcLpi+iY8Yg0= X-Gm-Message-State: AOJu0YwS1O3SXykVUUvOL6YJCSusuFqZ/bg+0VR8pmdIj1zEX4tKs29y iQ0PtbybFWyaeH4zr/b06+gSbNa1ZBL7TXjzFm9/7kRckKVIFcO2QyhU189Umg== X-Google-Smtp-Source: AGHT+IFEbhMVQzLzMehFBZ5O1a5UQYgBDvAL87jiyZxeXK49H/vAmDrzba4DetgTJ+cq2bB+dcgNzQ== X-Received: by 2002:a05:6214:3c8e:b0:6af:b8b3:338e with SMTP id 6a1803df08f44-6b04aeb2647mr34544096d6.53.1717679857474; Thu, 06 Jun 2024 06:17:37 -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-6b04f6607f5sm6118036d6.31.2024.06.06.06.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:17:37 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 06 Jun 2024 13:16:41 +0000 Subject: [PATCH v4 07/11] 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: <20240606-cocci-flexarray-v4-7-3379ee5eed28@chromium.org> References: <20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org> In-Reply-To: <20240606-cocci-flexarray-v4-0-3379ee5eed28@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.12.4 The single element array data[1] is never used. Replace it whit 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 --- 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 Thu Jun 6 13:16: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: 802772 Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) (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 14552197A9A for ; Thu, 6 Jun 2024 13:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679864; cv=none; b=qzO+f+xXnpqvbawN3tYS8bVNloM4VrZZWBXH3M/rqst0dH5PV5bwSTInty0kl+AWcJNw+gE4nFI2H05JLR3FUc8vwXOwliQmLZuRhlp3G6VP7cWozg+UUxuaGYf/kXH8UhIyXq1LRWkqp1oQAw4tdQJiehigDDUoY203ZEo2xYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679864; c=relaxed/simple; bh=/NolsqpFl438TCqFo9LQEcg+v+sNSkqQj0PpqvI4hys=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=duuPZ71eA2IR4pUeex0jGKNTqyMrvusssBt1+cMbKvNQd8J1bAmr1H1Flz4cYnlGoaDYQD5hKcaFNMfq0RLHa+06iY17H8u04PFe4AnjTsg5GJIrF70LObQl3BDrqs/YxEzOhVUR8Dzu5CxXWNzoOKkD0tLTiKcGeC65dlBlSq0= 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=B0m2W8Yc; arc=none smtp.client-ip=209.85.161.48 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="B0m2W8Yc" Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-5b970a97e8eso479467eaf.1 for ; Thu, 06 Jun 2024 06:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717679862; x=1718284662; 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=9kZibIjO2Z4ZCSJlx2Ohq41MEqbhxGGlKtW/qmnnTcc=; b=B0m2W8YcCHfDC4u1Xmsgo73tUGvDyueDVroXxO9OL8c342QQY+D0w+AqzlzB+FSepg VYNOz4WDZiEH6usVHvTAWUl3MOIQ2nEr/4wmyDbdflv7Al9aaOvfC1TVesXa5ePhTpEz BgPlKq1RuHWbcY9EjEXv2fZG+eB8iT8cj61eg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679862; x=1718284662; 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=9kZibIjO2Z4ZCSJlx2Ohq41MEqbhxGGlKtW/qmnnTcc=; b=o/vYl1pZKGhV1SykCF4va37toU1e42hsmSH+/egFM+IcXUXYqi70I84snB0+fyPiMy eD2Js6QhkAa3LQa2JrwEIrRQakF2ANoByIoi2W4cQxo9TCKVMsJm8gg4GC8Sq9sl4g5L KsmqMlk6IMxQXLCNKPot2fQb+clCB4AN7lJaV+Uh+UP4+Pp8GdNQTagnCl2mEQoSo5fS 5S8bMz7/MjPmnxt4sYcz+QhqRDo2opnjZVIZoImi3V/mzITZq3toeptbYNKaChxq2+e3 hDB5rbk7RRgxhPmFwvUqlYH+Sbdf9po5O0Kb49rZ4S+goQc9wfTDwDeRtlQepWk/36wo okxw== X-Forwarded-Encrypted: i=1; AJvYcCV4XSsfw7EPMllplAZJBUci32EKyxAGVwM5YmodQyjGy41fnmF/UKGpOC0K+1uREYC64/V6yPntyBk+hkbt1eCLPE2J2bJoiHSp+ss= X-Gm-Message-State: AOJu0YwtN7ALubxgDI8Li8wqkxijVFkENwLxFBlmN+mvR7+ziOhM3siy YaNQI1XAE4IC4AtyXhCrBJsJKELoPlZKf1pt9QVXxzAAZuTtP/OliSrIOdSF7Q== X-Google-Smtp-Source: AGHT+IEGO3j4JeIIT057xPo5p1aauD1hqTN0PU5iBBrHrF1scvkyvtDkNWbpsNVMkjbf/7njNIrIMA== X-Received: by 2002:a05:6358:72a:b0:19f:13dd:b7a7 with SMTP id e5c5f4694b2df-19f13ddbb03mr111660555d.29.1717679862024; Thu, 06 Jun 2024 06:17:42 -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-6b04f6607f5sm6118036d6.31.2024.06.06.06.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:17:41 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 06 Jun 2024 13:16:44 +0000 Subject: [PATCH v4 10/11] 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: <20240606-cocci-flexarray-v4-10-3379ee5eed28@chromium.org> References: <20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org> In-Reply-To: <20240606-cocci-flexarray-v4-0-3379ee5eed28@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.12.4 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 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 Thu Jun 6 13:16: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: 802771 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.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 3F2AC197A89 for ; Thu, 6 Jun 2024 13:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679865; cv=none; b=uZ+JqXw4vI0CwSEWOvKsVcXRMtOr1Z7AroumWf4fnQeALbTl1oEp0brAV7FmZ1uX42wQAUDiFF1ILnKMR97wGnjwx1L1bKXSukQzDGBekIGLJ/+OrTDcaDCSTNvNmvHcibZ8PSAOUkPTm2Rpx6OPjqdkFm8K4IyafgugdbeNMRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717679865; c=relaxed/simple; bh=Avo2Fleh4ujjt70o15EeficxKnpelBo2TOFCLUdZKFI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nZuycRCrMur1gCPcqQ+WYBeqP20us5rM/Upc4OaqlVQuxhx0miSqg2Mnd7Dwc/Loy3EMiwCfBZdBEPq1lHRCVjR0Ixu06pZAqm9r/O+Yubxku1QsjtMf0l03N58/RFMPeaLI5pEpPYql+Xm2W/Xbb4zkSoLYLCMLQ36A7WNeQNU= 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=dr0D+icq; arc=none smtp.client-ip=209.85.160.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="dr0D+icq" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-440299bcf53so4553251cf.3 for ; Thu, 06 Jun 2024 06:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717679863; x=1718284663; 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=2o9uFpZwETiKeZWYLVPp/h/C01HBTzSktsioUGg06Ew=; b=dr0D+icqsuyL2nuQ7p7S3Vud/E3YjHXXW6VdaFnIvukhdpS6XoVSxygvcFuE3lurd4 ElRlCgM7ovhhl4r98jnxmqNfFGAemoaFK95QcAr78CbdyY7YSZRiDvoAgDLT1m3Hjd6n yrt+P0n5v7LJW1e/NjwPDP670UOhdTjCZpvfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717679863; x=1718284663; 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=2o9uFpZwETiKeZWYLVPp/h/C01HBTzSktsioUGg06Ew=; b=BtAhA3yiOnwFUCybUe6ToxGLJDb+CBMthDU7X/r4SSdR9jVMOOosUSwYMJQuc/Sb05 wnyu+MrqtC0+sab8rHU+JKT1eUw27VkA8hvwiZ0FfRghRj1vs/YJDoJl0l0OyNSuREL2 qXiBlS7whaajADUYM6noBuSs98XTOO+MmW08KN5uwgBQiBnNccRy4ZXALbmQjtJnxXpI Qmg/R84+0h6nPljiDJGrNItpdx4kscUkLki/BDqor3VAEIHWCWvdUbGf9pJDcEWtQF0n LjgjEmlvhjWqQ39xMFuD+CQ1SKRoqLuhDSsU78EiFlr322d7Q9u5r6XJkU4ml/AuloBM z9cA== X-Forwarded-Encrypted: i=1; AJvYcCVgxvNiV1CiiX68HewPjGQ3tlYJLKxPCpeqSro+2zaz7RGwQenGj3okJIBE4thzcx96GfXodoP42psYPDXaZeYkBarb0PBtTVAdyK4= X-Gm-Message-State: AOJu0YzV2rA5HgUn99TYesX6KDw4JVK09AZc3KctY5HnEJuA/9USLASS HrN8Xk7lrfWjg//3SaSYcoJhbzIPzu071x3T51gueYHqYp3CMUV7jUaPtV2grw== X-Google-Smtp-Source: AGHT+IE8jXrmgfRC91PfzOqBRQfeMgy1DzBFB7+DOjFIBnca6lzwJN2RUcERx9LU43E0vr3vRV6ErQ== X-Received: by 2002:a05:6214:3f91:b0:6af:cdb3:5db with SMTP id 6a1803df08f44-6b031cecca9mr63488376d6.63.1717679863024; Thu, 06 Jun 2024 06:17:43 -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-6b04f6607f5sm6118036d6.31.2024.06.06.06.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:17:42 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 06 Jun 2024 13:16:45 +0000 Subject: [PATCH v4 11/11] 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: <20240606-cocci-flexarray-v4-11-3379ee5eed28@chromium.org> References: <20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org> In-Reply-To: <20240606-cocci-flexarray-v4-0-3379ee5eed28@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.12.4 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 --- 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 dee439ea4d2e..9545c964a428 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1230,7 +1230,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 {