Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2276831lqb; Mon, 27 May 2024 14:09:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuYAumWzxNlDPS8XRswOXBvDav4d9g9el5sOZwMi/NPGXXnL9e92vBnJJJgkIPsHjFKVeBsZ/xIfFwMlTDzI755EtwDRsyaUfUDVGfEA== X-Google-Smtp-Source: AGHT+IH64lIUgDwBpuxBZJw5xtIfJUso1/2ggbuadik9S9UbEhpemyX1IqN+kh2T8Y6DxfKPVxyQ X-Received: by 2002:a17:90b:903:b0:2bd:d6c6:f454 with SMTP id 98e67ed59e1d1-2bf5bb6b3fdmr14372488a91.21.1716844157197; Mon, 27 May 2024 14:09:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716844157; cv=pass; d=google.com; s=arc-20160816; b=MN45s4GuMWhesld74af3QvgaprBJZ631y9lagojhsw+vzj/RDw6aQITOxHUrRoDnkQ cZbQbbxNCQU2FRyokUOQ05yS4yWMLhZ7jIr4RWuMFfF/VgpwW8f8v3sj4xQZeHBhkaR1 9Xb41Q/9iqozNdgIGI5YJvtzRJnDuijpIeVmUhIAW0wj1s6vNNNMSqbvTvzyGobrZOAK tYVwZ52AZQ2WkBGnDd0rZ5yloBER5Ye3SR6eBTTLYF7AHn5C2uvJHSY3o3IsQPW7Xp4g WI2xlYFxBhtVm6xebb068YJAi4QYp5StC8ZvME7ZXR/hA9ZnvE72UB1YHhn8d9zGJGI3 rSYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=Nd4v7ke+Cy0nQV6qfaxBYuXvHeijlfFLOED6efio0lk=; fh=FO++LIzsWLicmvYuhgD4Mo0+MTZI+6swa7E13VYw4cg=; b=nUHsdXNRL/zdAuxkuywVPeTKJkqOCBs6TixmX4iSuKKiNjIgnVXnvmR+BRVRMYDS96 fuG74/KZDuN70/XdVQ2EqDdOrAzGlAfDgatsnBiDWUmyWA2xuqUrUTZ/No6YfioLpq2X sXiDvUkC1wqh/tKTK1M+NZApppPTcY8h4y1/H8gxV/iVN6qAzwrW+2xvMowXnjVVNfmy sXVp1c9n4ELG63lt8vKRRmg5eT+V+/3TYbOViHpFVTZnbDaR1ZMTtbea/PxlcpRwNwIn YJg82wL8X6Ga8WVCM/aD5Jn0k9bFcfCO4uDjPE161rUcnq5Nk7S8bFMl/dqZLaJywqNI nilA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dzsnouHG; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-191424-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bf6be4a949si6307024a91.105.2024.05.27.14.09.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191424-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dzsnouHG; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-191424-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D12972812AD for ; Mon, 27 May 2024 21:09:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19C071667E4; Mon, 27 May 2024 21:08:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dzsnouHG" 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 9ABE615FA62 for ; Mon, 27 May 2024 21:08:56 +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=1716844138; cv=none; b=TRWgXuuVdkN05Fgc/GuttF3EBZel8vUzmf2HfEfJyfC7ONutTy/WXGj97ynHj6QDPaaLG5RpFBk4UZMSNA0OsJeBGHyX/urMti7HsxDICclqTlelhF1k097U15CpftHvk/WmyQwPnm2mSd46u+NDlZnO60kJVNPBJp8T1144sWc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844138; c=relaxed/simple; bh=JSygS4gzMJ/tHT/j3LMxdo2fBykWODOKPWAhI9tH2kY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qKyqT12BzxSybaZPu5bLAH+tL85zHab2KayvxbSUPx2pDcE6y6FoBrYc7KkJ4FRJMtX5CTSl1V9i1R7wtzKGQhytl1N4AiBYBT7MIS4gMMncr4Hu1zb7loe34RqduLumVfVIOAOefjyIJPTUpZIWrLL/+qTffm3jzpBNnH7sPBw= 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=dzsnouHG; 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 Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6ad7a2f8715so1746786d6.1 for ; Mon, 27 May 2024 14:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844135; x=1717448935; 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=Nd4v7ke+Cy0nQV6qfaxBYuXvHeijlfFLOED6efio0lk=; b=dzsnouHG3jS54O7qwP2Equ3HYnxbcKBuse7ievqjO8sdON7g4hEZfDS8GgVTRQKLIw 1kBszvjBzZea/pYD2Lbt+6s9FBIfcS+BN9ZMgWq2SLMu5WgOqPrH2MQA187J28XkNyjb SNhlnq8+PnSDl6B2hHnDQeEH50KUW7zuLlD4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844135; x=1717448935; 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=Nd4v7ke+Cy0nQV6qfaxBYuXvHeijlfFLOED6efio0lk=; b=rjGBQ/dIStNreduXlN4DNIx1cyx6V3vWJIMUeIabZ+1EqerGwtjUsazeVfYqkqYtKQ C7MDcESsc1tGByVtWP8rzveamqo0Ws3+zjuE3A2i2X8jvuEu0iUhtD2bvvCHlGd8OXOt ZEm5G/prd8d1PpST+RTJBtuihLjh6P0G+eMaOogR75jlBgT1mfP0vXtzocrylCcAQNTO W5Vj+urdnrt/WBx7XthUnLgqoRenqN2JCj9enwXgQ6N4yANYQPWfF/TA4FiF2DoJqDZh Y1dgpOZ3fdaQIm2bcRCybbFRZui7WkzcYBRBJiCDkKXjGfmY/R3dJnd1p5eSwqdIV9GS 0TzQ== X-Forwarded-Encrypted: i=1; AJvYcCX1joTNSQP8SBA88pdxYmnspPk6C8EaTgrgtGJNhXK3dCSK6iXdxR7XBdfdcdCW+jxxuOUX7eXVMYZlSjhbLkv1qc/3le8pcflPIxsS X-Gm-Message-State: AOJu0Yw4u9w6ntRmvNkSQOyXsFmLBdfrLZS92lhK1k6I0V9R+jZ1Y7+N bt6VKj6jvcKv6Vko9zXVpk34Sd+2jto8Oa76HIINhHuAglpvKZKoWrlYoavMHA== X-Received: by 2002:a05:6214:2b9c:b0:6ab:9a03:ff96 with SMTP id 6a1803df08f44-6ab9cfbe9d3mr169298836d6.7.1716844135480; Mon, 27 May 2024 14:08:55 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:54 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:51 +0000 Subject: [PATCH v3 01/18] media: allegro: nal-hevc: Replace array[1] with arrray[N] Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240527-cocci-flexarray-v3-1-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 Structures that have a single element array as the last field can be mistaken as a "flex array". We could replace all the single element arrays in the structure with single element fields, but this driver prefers to follow the ITU-T H.265 specification, which defines it as an array. If we introduce a new define N_HRD_PARAMETERS, we make clear our intentions. This fixes this cocci warning: drivers/media/platform/allegro-dvt/nal-hevc.h:102:14-22: 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/allegro-dvt/nal-hevc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/nal-hevc.h b/drivers/media/platform/allegro-dvt/nal-hevc.h index eb46f12aae80..361e2f55c254 100644 --- a/drivers/media/platform/allegro-dvt/nal-hevc.h +++ b/drivers/media/platform/allegro-dvt/nal-hevc.h @@ -96,10 +96,11 @@ struct nal_hevc_vps { unsigned int extension_data_flag; }; +#define N_HRD_PARAMS 1 struct nal_hevc_sub_layer_hrd_parameters { - unsigned int bit_rate_value_minus1[1]; - unsigned int cpb_size_value_minus1[1]; - unsigned int cbr_flag[1]; + unsigned int bit_rate_value_minus1[N_HRD_PARAMS]; + unsigned int cpb_size_value_minus1[N_HRD_PARAMS]; + unsigned int cbr_flag[N_HRD_PARAMS]; }; struct nal_hevc_hrd_parameters { -- 2.45.1.288.g0e0cd299f1-goog