Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp174142lqo; Thu, 9 May 2024 16:56:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWsflWa0Ci9MlV4qyCpHLljxxNGtCn+M/fCRhCVQP6G/B1qgtxdTdjr+7McpWl8TKK3P6OIrbTLEPQOsn7xrUmIBVgJVyCwxV6pfyxXJw== X-Google-Smtp-Source: AGHT+IGnTeKYAOxwz9j0ZMJFvAP07XNClzk++ndYnmpSARa8NP7aFP4RZc32RkIX7hkEqKZCZuUN X-Received: by 2002:a05:622a:1391:b0:43a:b542:d1dd with SMTP id d75a77b69052e-43dfdb61356mr9082441cf.36.1715298994203; Thu, 09 May 2024 16:56:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715298994; cv=pass; d=google.com; s=arc-20160816; b=lPzEROjFTUWXLQlxX1DHabu0Z3lz4js9Vww2KQHB1tGOCc9f42/xzSCDfPvEgWvfCv 7hv3VJ4G7lccoGfS7cGNymbjeLkA6D9DkgfWQ+RAPmSHabLZ3rnF7OrTJZYBShitoLof akwwIhubXsnXpJe6j9d7cZijsYYBf3aua6PHz9AfYp1Nss77g2MMvQ3oFt/dnziYUpjl XlobLf8/F3J8fQiF0ZkzTMRj99frLJe1jLR8XSyzqCMRnyV4OhjqZkLOU64T6foP0msX v0ypSkxO1ROdPtt12GXq6Qdt3z4BO9KZhE4PmyRSLwKkIOM7qDZgIccE/nQBISb7DXm9 +sqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=X4J5NVwqETAunl255VwAIZlwOQM8pMKyHA9A90BXzpg=; fh=9lJkDMs+2fJzdCdoKeeR15GGBoAFPdSaj9UnypQzHpI=; b=t3UN01Xdi5X7OfikWH80c3kY/9v1jzwvqEwMqR9Ck4jU07z7LmdlZt1PoX0amTpQcm ZrPY0i5r6mGZuXNJCl+owBxndWOxEIK47L4VA7abKIXZTQKDetvSpZh4fjrdd8AfliMb Lxg59e+H88zVBUvWN+/YqhXJBw/TULvguU1OC3MGTlJGjVb5RT5Zso0Q+ZD15N+HpTvr Vr5Uaywjo68V9WvpfuVBxT0xqUP//gh+fnEcZiFwwbk4o94y1cbC3khgN9N0OzjbxDCY KORqcNAZwUBollQWA+1LzFe0PDnrpsMOPtpQT8pR9uhceAqdwcwxBdoBhnkAuVQRzQXW 7akg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Cr/BTd46"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-175084-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a2076si26033871cf.59.2024.05.09.16.56.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 16:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175084-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Cr/BTd46"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-175084-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175084-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DC9E91C23119 for ; Thu, 9 May 2024 23:56:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 672BC131181; Thu, 9 May 2024 23:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Cr/BTd46" Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 D041512DD82 for ; Thu, 9 May 2024 23:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715298984; cv=none; b=s66Igom+K3yq46+tFuAYJU1O32J4TMgrY7i3rk1+1irx6aT6DZaSVTVzWXOFOhaCgydmcnIzHwaEL3ra896IxG/GlddbTXKBpNbISEJSJH98aPwVHCev5Lvxq0xaViAMipMQojQXajYXevjhabpj7AydpdzJEEX0y8d7/uMZrn0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715298984; c=relaxed/simple; bh=gyzWYhvrDFaPsJx8YYqlTG3OQAfifSDKg/gu8FI8JUU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MRoerSP26iu9vVG8joZEhc5U2qf5u8jQ0u5mPYBE2VH9jUhtiIb3nw5pli4rwI9m4UevmUE+ufgi2PCRnJfMcMmYZNO2pUxfl2cSW+vT7HxAruLlAdeNFqcjKzydcY6xvxcNBatVSQU6FRa/fyKvNoNGKK8UXnzWxSgefRdbtOQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Cr/BTd46; arc=none smtp.client-ip=209.85.128.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-41ba0bb5837so10760875e9.3 for ; Thu, 09 May 2024 16:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715298981; x=1715903781; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=X4J5NVwqETAunl255VwAIZlwOQM8pMKyHA9A90BXzpg=; b=Cr/BTd46aLBdVtACOtMJMYDjehGh+k8bFxH6BK2DAN+nir6ohw3RyWp8/h1S/2nLPv 9TYkodg3RazQ1k5i0An1avtX9ishRod4hujGTPrDWv77HyVAvQWo2b2eG8bAkGgem5SD Ch6h5wkYOoS4doiq3y+sRTHa/4aXz0xru78qbWm49QiHsZbdhPN2neJJEKCiS78MfHpj ux4Jcg9fxAIFVnK++YidIGdkYXhoZnFvTnz8GqVIDH2eJ9AnF+ix/sOuq7O4xLTH2F08 +c1ide6nPoR/Vd+34BSbXIvLgJAjM9A/KErvkQgS6WxwLXnjAGILTWtMi3SF9oUC+Z4C WdRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715298981; x=1715903781; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X4J5NVwqETAunl255VwAIZlwOQM8pMKyHA9A90BXzpg=; b=T9miI+B47/PAhcnvsuLQKLV+SC9lgO+qBYIcKAalcxFGR3HOh+m5hT2kRHRCQ62rKi 5KmINSVM7l40RmO2PlI69uEc2tyN6++0SKo7QFnLBx+7fp3ipP/ZERz1uQIstAKgYeL7 Mf6IIAR9nmcFhNUH0KInP5fUsNWgHgtQ/e5s33rhx/K7VqhOopGJLPJ3/8cd8Wlv85pj 3SosHzAJeKj83zfffA7tSzM/siRatYjSyhjoDrqo0zAjTKbMM/loPNBqgJ7D9lk1wKeu MzY6QePGY2PdIEJdKXgbgckAIXgvve0S1kyw7nfgx/3R4FJcNf4dV2G90Epa2I5sJaL5 EFjg== X-Forwarded-Encrypted: i=1; AJvYcCUX0rkAvoELbP7MCFs66fBcewg5ScG3Y41upV52ZMH3C+qS5xlBWIZ7qbzxKpSo2qOZ1fRSopJOHxRG9iObgwKw3CzfQAb6nJe76rcj X-Gm-Message-State: AOJu0YzVCrTiInXoXYL8nEX/3nFlfgy3E8BeBWPzLl9Mi4/vdVRYaQ1B ZUNRB9sVELDw+bghHUtQxjD35WZY/yCyYu/Lt3OxBgnRZPXqsBUtaiu5ep2gvH4= X-Received: by 2002:a05:600c:1d28:b0:418:17e9:c23f with SMTP id 5b1f17b1804b1-41feac59e0fmr8333385e9.31.1715298981352; Thu, 09 May 2024 16:56:21 -0700 (PDT) Received: from [192.168.0.3] ([176.61.106.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502bbbbf2dsm2892356f8f.100.2024.05.09.16.56.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 May 2024 16:56:20 -0700 (PDT) Message-ID: Date: Fri, 10 May 2024 00:56:19 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported To: Ricardo Ribalda , 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 References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> <20240507-cocci-flexarray-v2-13-7aea262cf065@chromium.org> Content-Language: en-US From: Bryan O'Donoghue In-Reply-To: <20240507-cocci-flexarray-v2-13-7aea262cf065@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/05/2024 17:27, Ricardo Ribalda wrote: > 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 > --- > 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 eb0a4c64b7ef..dee439ea4d2e 100644 > --- a/drivers/media/platform/qcom/venus/hfi_helper.h > +++ b/drivers/media/platform/qcom/venus/hfi_helper.h > @@ -1006,7 +1006,7 @@ struct hfi_uncompressed_plane_info { > struct hfi_uncompressed_format_supported { > u32 buffer_type; > u32 format_entries; > - struct hfi_uncompressed_plane_info plane_info[1]; > + struct hfi_uncompressed_plane_info plane_info; > }; > > struct hfi_uncompressed_plane_actual { > diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c > index c43839539d4d..3df241dc3a11 100644 > --- a/drivers/media/platform/qcom/venus/hfi_parser.c > +++ b/drivers/media/platform/qcom/venus/hfi_parser.c > @@ -157,7 +157,7 @@ static void > parse_raw_formats(struct venus_core *core, u32 codecs, u32 domain, void *data) > { > struct hfi_uncompressed_format_supported *fmt = data; > - struct hfi_uncompressed_plane_info *pinfo = fmt->plane_info; > + struct hfi_uncompressed_plane_info *pinfo = &fmt->plane_info; > struct hfi_uncompressed_plane_constraints *constr; > struct raw_formats rawfmts[MAX_FMT_ENTRIES] = {}; > u32 entries = fmt->format_entries; > Reviewed-by: Bryan O'Donoghue