From patchwork Mon May 27 21:09:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 103C2C25B74 for ; Mon, 27 May 2024 21:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8Sa0QtxdAl3vJF4trWrmBKpbHpnwwTWDD9Uh22ZLrjo=; b=I/d1r9kWJ2oOxB 9G1RDwN+I8+/NUSwLs5QeUHflFxEHh8o+invXBitOnNtkYXfuvqpkojQDF+wGaA3uZ7b7Y8oLacX0 STnQIAgz2CCIIYtMSqInfDBJzIUqUYkeuJkVs7X4PXNYW9F0xzUJkOCIIyiCCIz+2sR9a/rHkiYHP WMzbv7Z6io1ppFGBDkWyKLgNv9ZQq7M5RlUV+6p5bDWzMHwB0jypgri7HgHlRurHE21oBe57n+IWD Ha5DpL3VZ84vhRbdRqFjqje2YT5fzRpeRyNTdGN5dAslQwcv8MTjx2RpHYRA2Z4uROogoFgGSC2D5 hMyD4oo+eceN1bitc8yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBhbA-0000000GKdA-1oAm; Mon, 27 May 2024 21:09:40 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBhae-0000000GKAv-1Eg1 for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2024 21:09:10 +0000 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3d1bc1e5d14so119937b6e.1 for ; Mon, 27 May 2024 14:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844146; x=1717448946; darn=lists.infradead.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=umQqb6RnOEqhwSbkLr5UqyeS93yk9NUaTbaKND2fVbg=; b=A4QCwRM0DVGhe1eq1IGvEspKGJdB0ged/9rdQHUw3KzTPlfOQbpwLMCLLhDqwP8WzG ZO5RH9VpT2wD+wQYYvba8FW/u7jGfADDwm7B1qbDXki3CQ4kum1irHx96WR10KJBtvE+ d7eI6iJmFIuPtXi25WFLyEsZVZwjW9vg749ic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844146; x=1717448946; 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=umQqb6RnOEqhwSbkLr5UqyeS93yk9NUaTbaKND2fVbg=; b=hBBmpUeSJD9S2kelUEhZWPBcD5uU5d/EoqjrPPVUPFj4bkooFPDmo2flKTLa9NOWUk ZMnAd7X6i/wjHrJuKNXlvVoFkPEH0+hxpWoG9IEdNWDribDWXSqyKNDfCiK0UFFvOhN2 +KbBsIMs4ruj0Y2JiFJhHejhDPA+lg0nswtnz2onM+Z7FvdJligXQnDkjv8qpchoI40+ pA5AGcxr6sjdhtpYVlRxalQVtAP0Rz4eal0yD9PSVYpN6R/aUcziE7cjbI/ZrLUdhAP9 4Vmzc5vEccZw0DMs0d72GR9uxK11PREjeeBLKlMchULVDid4vjuWNJTwLs4YyLKtbTwg wLPg== X-Forwarded-Encrypted: i=1; AJvYcCXXouDmAASta7+QSpI6vVoqSCxEVj4SlRsONgmMBbS5OnSDdahnh9eAltszztTlPwNcyKrb4lxuBjDHq+uXNxV3hUVld6y/9uIecO47JXOtVLp+MKc= X-Gm-Message-State: AOJu0YxN/ZiQcCVxqKbXYM/eshNfPR2ZIj97dts9j1Rcu9DaFBlwYMPH bl18nMTjvHOw49x8dVAU5Ho/g3csdgR55hhO3DiGnWQv1FwcEmcT8qIGqUZftA== X-Google-Smtp-Source: AGHT+IExxy1NVsKPC20NN8GUcPBEpa+B5Qdfpnr1hCHN8PSGnu8BXMpCsdi04L8WrZaTqFEAL+NTSQ== X-Received: by 2002:a05:6808:1a0b:b0:3c9:714d:cc7f with SMTP id 5614622812f47-3d1a745c6c7mr12813221b6e.36.1716844145955; Mon, 27 May 2024 14:09:05 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:09:05 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:09:01 +0000 Subject: [PATCH v3 11/18] media: venus: Refactor struct hfi_uncompressed_plane_info MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-11-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240527_140908_470881_38351FC6 X-CRM114-Status: GOOD ( 15.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This field is never used, but if we remove it we would change the size of the struct and can lead to behavior change. Stay on the safe side by replacing the single element array with a single element field. This fixes the following cocci warning: drivers/media/platform/qcom/venus/hfi_helper.h:1003:43-60: 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 Reviewed-by: Bryan O'Donoghue Acked-by: Vikash Garodia --- drivers/media/platform/qcom/venus/hfi_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 7c0edef263ae..eb0a4c64b7ef 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -1000,7 +1000,7 @@ struct hfi_uncompressed_plane_constraints { struct hfi_uncompressed_plane_info { u32 format; u32 num_planes; - struct hfi_uncompressed_plane_constraints plane_constraints[1]; + struct hfi_uncompressed_plane_constraints plane_constraints; }; struct hfi_uncompressed_format_supported {