Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2659787lqb; Tue, 28 May 2024 06:54:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjeJ3oFbXmr02MgjYeGrs8N1QUE8nFF65RphAq0Gi705xCFA0gfEVkiHPH8fUeaNCgc5y4w1fgdl534pJkUqSYLhAQIURPEsvUWqxA0g== X-Google-Smtp-Source: AGHT+IF4DbpsvEcjEUZ9e+/wVcufx7jjy4NQZ9Hk5rubuFuJUu+5TGzg41k1EWnOCBw/+xlzK+HE X-Received: by 2002:ac2:5a5c:0:b0:524:6385:6883 with SMTP id 2adb3069b0e04-529650a43c0mr7133487e87.37.1716904478926; Tue, 28 May 2024 06:54:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716904478; cv=pass; d=google.com; s=arc-20160816; b=oQBm8PSumKN1pR/IQYg9WQ1/n8DAHihjMSm4o4kbySkalLPI+NHhG5IzvDtUpufuuJ 49+nFz7YVYG5dEaWMDit4AfkvMlZs4jxJglU6Iah5Z7vgoZ0H7omhXqG/IarR9YWOC+/ yFkK1eWJy06lfQA1QVHglq7KLJkWtKm8HVcV071ef8pu+QzHQ4MAXciY7m0G9AcAaL1U ziliqeukuR184xfoTejMp5DqY2q0JtOitzshhHi6SoWi2/7aWYK4U1jbMA5Ya1xkqCSX V42cmE92iBbfS3TOmj87gdmqmziv/Al3lbHYh05jiU1duHyUiLfU3DE+poHBCqbFxQZ7 ZY/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=fFI8jYX/X3qxOmrsF3ZtImzmHB0YkwhSR8fq5JeK0gQ=; fh=CJyz+vfyxLmLQAz+L/2+BG3rHg8LA/csKOPQuxBO2hw=; b=Niv08McvJ2TCZOZssPmuf47UsgUhSnELvFCnHyDEEuPxTaFYfXL2nXn/e3aCTJjuCb inmC4eZVWdRS/VchXeQiazBus1tUyxqV9GmrA+/XbXa2N7900dCYwMUrLep4zfLqasxv AlV39kJIpNwWDpaXYbS7ix3BnmWJSLZD592WFiKE9EpaC/uu/WEfNBWmhyP2GZKbx2Ib bKgWR+KpattfO7kuBm7LF4KWtqNM49wyJfkowpKbFEkXFQQjwkVTlVw0Wfx+SsMflmEY BhJcMxRWDmm462Obna/eEVMetQZ6FlMM/ZyDoo4JgSw4teYhysINOnCa6gesbx5bVyr5 YS1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192467-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579d2360445si2443837a12.634.2024.05.28.06.54.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 06:54:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192467-linux.lists.archive=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9B44C1F23AB7 for ; Tue, 28 May 2024 13:54:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A016171060; Tue, 28 May 2024 13:53:04 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ED4113C822 for ; Tue, 28 May 2024 13:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904384; cv=none; b=C99rgIkwnZ/sHcf/lWCfq0qEDrywJIB//WHO8PbNTbiPXZrzk12fdnKanLXrAl1gGzNTwtbIelDrkZoy9EAE6XD3OWXy/Y7aFYs25Mq7tZa7g7UMKdOAD7yrQb+qaPtLED8rZFYiZe9INj6Doz5BP2ubr56MK2Z/1TdzvY/6Su0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716904384; c=relaxed/simple; bh=3Pj74Nu4ktesHuDG3HthgKkc3BF0Puu51mhNC0syUjk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WEEku+hMFDzEvTzC/F9UZlb5UtRSHrs0HSMe2rc9mR3vKWdARZ7JU7YvvpfmfRH2BQ2ilwgC4jHDegqTwYMzK+Vq2ohNj1m82vVQVKG/eUP4RjBXp51QoPxvUjdR1bTh2h6rYA3IgOBkpvIzoisYLM8wb9a8CC5DtD14ZUoL6Ws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sBxFG-0003PP-VL; Tue, 28 May 2024 15:52:06 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sBxFE-003Kql-Le; Tue, 28 May 2024 15:52:04 +0200 Received: from mtr by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sBxFE-001NEu-1o; Tue, 28 May 2024 15:52:04 +0200 Date: Tue, 28 May 2024 15:52:04 +0200 From: Michael Tretter To: Ricardo Ribalda Cc: Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil Subject: Re: [PATCH v3 01/18] media: allegro: nal-hevc: Replace array[1] with arrray[N] Message-ID: Mail-Followup-To: Michael Tretter , Ricardo Ribalda , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> <20240527-cocci-flexarray-v3-1-cda09c535816@chromium.org> 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-Disposition: inline In-Reply-To: <20240527-cocci-flexarray-v3-1-cda09c535816@chromium.org> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mtr@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Typo in the subject: arrray -> array On Mon, 27 May 2024 21:08:51 +0000, Ricardo Ribalda wrote: > 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. N_HRD_PARAMETERS -> N_HRD_PARAMS > > 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 With that fixed Reviewed-by: Michael Tretter > --- > 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 > >