Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2278202lqb; Mon, 27 May 2024 14:12:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVISx6R76fv6o/bLNRYEZ+2J5xsVEyFL7ZgYlY/9mcDlDQHWkT4knPTtNlYTfFXqqNK09DuDA/KVGsOCBDK1Yo0asBUN5PSTpU5o8Ug6A== X-Google-Smtp-Source: AGHT+IHv6itFC45htCiFqVjPd5VJT0VOKmQLaz3iAe7NCtPOLdD/Lne3MCyhU41gURvhb/taO+25 X-Received: by 2002:a05:6a21:3e09:b0:1af:5a6f:1c62 with SMTP id adf61e73a8af0-1b212ce290amr13299354637.4.1716844359985; Mon, 27 May 2024 14:12:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716844359; cv=pass; d=google.com; s=arc-20160816; b=WPZzKV1bp4hU+f3u8P+sRuU863xLd5vaS/5nuwexa+dRJhuMo2LoYyWa2+4KaqyBSD InA1ZNZCpKH/DcwDSkOoEENj5foO+jjvWzv+4KTrfP9t5tUNq7qgsAADrVsYH/yBjp69 eb2RK/9QmP1D/XhxhkH/HpTr4u7Rw5k+wjVouMUja3MaZTUN45te6jgs+nq8x8mrfaYs hiSPxzE01nD4rfqYURYn72TU0a9R+DxuZCFjrlhMNWbFW6zOT2JhFm/Y9KR3cYpVZzuL DbP2aoMxmzco1DZ4mbSyyRXBdGwYtgYJhUvZajY+FNAZ3T2r8yqow979YVVagep3pved ArPQ== 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=5cEAIpCHBHS4CpppuQZOsAxg9IlPyhk1N0Yb+SULR3M=; fh=fdCX3s8F4nybtQ3uqDHGALXIuP4XdNiAHYuTLNrLRMg=; b=eiwAmUok21otuvcwTboGBw/msQzklmkH5FP9iSwK/HTLtpXqJXZrJdaJ4lK93hnL/j NNXUwSOLcfZmTcxZrWn8ORuDEHLYamU2gkgLn8c/X17JxdV98vHY/Rec9stlxNzpbDt6 FNUHdrSB0aM90ZLOnj3O/1DWvdmxemo5soO3oxpcuUh+X+V/4Y+/k9xF7s4xeVV2pTU4 Goe3/VlWBjMHY0eIUibutTqzw5LUOqQY3YAcKqmGZUAASydcsI1w0uTGVg9Ff1PIBH41 gp7rkBYJ1Ozk8wN9YUB8PooAAoxWo2q9Nh43787AEP8ynqH0xh61eF1j0TfqtXMuuKXl m6xw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SIgGiWAm; 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-191437-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191437-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.12.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:12:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191437-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=SIgGiWAm; 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-191437-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191437-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 D1B7E28362C for ; Mon, 27 May 2024 21:12:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1805316C85F; Mon, 27 May 2024 21:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SIgGiWAm" Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.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 4C7C616B757 for ; Mon, 27 May 2024 21:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844151; cv=none; b=SFWb3FCGMALJ3NCOOcWDbqF69KEMmJAKsMhuTsrb27oaJY31xJNlPMVIloLMBmX+16LY72+3NhwN/wBB1pp+CZ2XDCkrDPVdIpsqbZ6Q0hfr2awk7bQMAoIrv7RDRVBCGWTybUEp6Yc1Hv5wlrwb/Q4nEaiAUO/4s3ektL2vzyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716844151; c=relaxed/simple; bh=YTzf7p9jPjImSwT7T/FubIWDNPXlqDUQZ9SE9jMD+/s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jX38k3DanLktaLh5w7C0nf2udy+RZ9J7Nj4VeT7BaOoaLYs4zKdLZrkPniPTxK4yT3H12mrEHmUoaa/v5LTF/tpfwLpUWY3BZE4xfcazzic22hYVi/sCCqdOEjHbrLm4eLxiN1Aa4YQCvAASnTmo31NOmyzrYKo0xwQN1KHeP/8= 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=SIgGiWAm; arc=none smtp.client-ip=209.85.219.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 Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6ab8e0c42d3so571166d6.3 for ; Mon, 27 May 2024 14:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844148; x=1717448948; 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=5cEAIpCHBHS4CpppuQZOsAxg9IlPyhk1N0Yb+SULR3M=; b=SIgGiWAm6Ptk7/DNq0J8FqDLOmuHfZf4Ak/X0ClCQe5RTnjb3l+PkeCf/Vsf6vJQoY xjhSIJs7utvCgigjQlVJzIEIKMU/pGJdfwEbuMjOVGpCU2zB0CeAIyJRNgTp8ihl3Z3b KWOZN7PYfBzXdlMXaqvF6Ej4PIepCxYrr9Dys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844148; x=1717448948; 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=5cEAIpCHBHS4CpppuQZOsAxg9IlPyhk1N0Yb+SULR3M=; b=EjSg29ukB1rL/MHg1ANsaWUZoghqNgn/hNmRvg+pY0HfmGv0kBGlDvfnkDjcKHYcRf H2LzvVJbcy6klJAhJz/DhJSGCj28pG01NG/r6KekSTUeCDXrRGIMtjTfy0YeBdRTkwDs j91LQnlVGQwlQux/iwHn9B801fEUNDryWX50cbZ8s0Qip0X18ic0HOSp0f1fGuX2ev9+ tRQbu8AzKcVYx0pGLJqtSi6j0YNiav2U7mJIGx2DYHnTtY1qglMLva/ttiyOBQK2J53Y GWFEhjeOmIAynxRRf7pB1nSbhdy/gkjjEWCh0bcIwWSrGVVT1aG8LJV+xiD8F3tj09Qu Bbrw== X-Forwarded-Encrypted: i=1; AJvYcCXI353H9XmjzpyHZZ5ur++5GyPBUnhq09QQvcL83ximboHyTnHmbUokF2vmU9J23UHL2K7FV3OTzxLVwQjpKmp0HyvDRCfSWV8a4GpA X-Gm-Message-State: AOJu0YwyR7mL87wb6a4E6Y+zE0G48Ybw1gQed2CtYkRZHqPcoq9r4WCZ OcBmDsMe4XMleJBlvQfFsJFu7wVNTDl0X3cS/e/LLR6sZnnG+weJaF1mQv9v0a4V6Nc/2sZEw8U = X-Received: by 2002:a05:6214:9d0:b0:6ac:710:3ea2 with SMTP id 6a1803df08f44-6ac07103fc7mr82965526d6.6.1716844148230; Mon, 27 May 2024 14:09:08 -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.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:07 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:03 +0000 Subject: [PATCH v3 13/18] media: venus: Refactor struct hfi_uncompressed_format_supported 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-13-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 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) Reviewed-by: Bryan O'Donoghue 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; -- 2.45.1.288.g0e0cd299f1-goog