From patchwork Tue Jun 18 13:37:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13702252 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 7178416B390 for ; Tue, 18 Jun 2024 13:37:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717878; cv=none; b=aG9eGGNbX0AOHccZez+GqutZzylUS3N+m4aVN5eHSkZeab3XoHiZ2lnEI+4I9r8ua6TXoOSemqIvcYJEtFOsQl8rTzv6W0RccMwmJNsyy59zQ2qkKtrVPqRPN6WCnXy2bCSLvQDQIWhfqdc6Kl/Zge4Qs2UjRljZa/Tak4bD2Mo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718717878; c=relaxed/simple; bh=w3DHP4p4643nKW5OrdOfOxfbPI1T7mPQssl6ldJECKo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PQkVPkJ3wGlVHdj1pTgCcr7Z0e8yWUc2vYARFBJE0JevUWmc5ZcHjIFJn6ci0FMzlasBvqTuUmG4zu5PrugHtOZh/sNcnLcdnVJchduVsq/yR+yyStkxN9+RdLD+brl42T5oxYfK7bS/nYUhIuUf4q0N4OpXOyMGoUn9SKlG9kQ= 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=V7OZe8z5; arc=none smtp.client-ip=209.85.222.173 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="V7OZe8z5" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-796df041d73so384873085a.3 for ; Tue, 18 Jun 2024 06:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718717875; x=1719322675; 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=zSnUXEZtxSx3BYm4BCVxhmYch12bVybwuYwnU/i/Z5U=; b=V7OZe8z5aThjADq3yKVV7PgW7gt1/y8zN+5CVDQG1T3urnC8ITxBj+dQlYrSZklzrG usKeswnZ+2PTX37povjfrmivhR/fjkSJp3U6NdWwq9SQQDc0IQK4qEUiTeUcNZ8ZcV12 6nfFykFBL2K3zwJOkwMKdCJcuK2RoLlGLo8sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718717875; x=1719322675; 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=zSnUXEZtxSx3BYm4BCVxhmYch12bVybwuYwnU/i/Z5U=; b=Xehx+S3I4f4QRsOPXK/ZFqyTsMDCBNeI0P8ST1Tft8jKxkV6XmDd1hNIMuQvoBA5la x1nU11fcLsyL6auiGNludoZDFTxLx8NLN4yxtrWtfOt05cI7mlcgkifJdu1vIt9z7oyU eDmHzjOmm0AdxoekNa4bpLO8bLpQtwNNfxtt0z7DO+f1Eqm7uYCM+GmS1kEPWEGcIMA8 ZW8T7xUHV4n/hjIa0ZCujUamhQk16CkWVY+wVro2DX6gAdEAVxtjV40hSZ7iBtRMSbZc 2PsVXuZjOnekDS3s+CNhuyNgTJIois09afJwQnBMNOEyL9e0aKGGJnGOnjgSHuDPhTet 9cJA== X-Forwarded-Encrypted: i=1; AJvYcCX3q3VxvisiABpUDkDtUJvRKg324CVqd9XaDyO+hKcP2zDOHfCkVhgovjLodHicl09+dstQCA1odSVvv4fBXoAzESb1vLuaa3F7SgyM7w== X-Gm-Message-State: AOJu0Yz7rDk9VUIyNUku/bRQAiRPcM8jDMpoAAB4eyDqwSjyI9FLiW4r mPDB6q1MuF1caOAMjFP7v55rqiDHsSlNiIbwoVpN2oI3rAEcewjM97H+WGssDQ== X-Google-Smtp-Source: AGHT+IFosDDClF84gGgSRj5dHMhRBg9h/CZLMI1/BJ04L5j1+KPNuSW/Ol/HXseq/SYmSspuibOWHA== X-Received: by 2002:a05:620a:444f:b0:795:5815:2f9f with SMTP id af79cd13be357-798d241d00fmr1513504185a.25.1718717875384; Tue, 18 Jun 2024 06:37:55 -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 af79cd13be357-798abc06e93sm521666385a.82.2024.06.18.06.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 06:37:55 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 18 Jun 2024 13:37:48 +0000 Subject: [PATCH v5 05/10] media: venus: Refactor struct hfi_uncompressed_format_supported Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240618-cocci-flexarray-v5-5-6a8294942f48@chromium.org> References: <20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org> In-Reply-To: <20240618-cocci-flexarray-v5-0-6a8294942f48@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.13.0 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 Acked-by: Vikash Garodia 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 c53e2fb2d42c..6202dcfc467a 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;