lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220517143521.1670663-1-martin.kepplinger@puri.sm>
Date:   Tue, 17 May 2022 16:35:21 +0200
From:   Martin Kepplinger <martin.kepplinger@...i.sm>
To:     ezequiel@...guardiasur.com.ar, p.zabel@...gutronix.de,
        mchehab@...nel.org
Cc:     linux-media@...r.kernel.org, linux-rockchip@...ts.infradead.org,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Martin Kepplinger <martin.kepplinger@...i.sm>
Subject: [PATCH] media: hantro: fix compatible string deprecation warning

of_device_is_compatible() in the end uses strlen of the string
for comparison, so in this case, the condition is true even if
the requested string "nxp,imx8mq-vpu-g1" is being used. The first
chars containing "nxp,imx8mq-vpu" are the same.

Fix this by encoding what the comment says.

Signed-off-by: Martin Kepplinger <martin.kepplinger@...i.sm>
---

This is more of a bugreport as the solution doesn't look very elegant
to me. I'm happy for advice.

thanks,
                           martin


 drivers/staging/media/hantro/hantro_drv.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index ac232b5f7825..014fab637df0 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -923,10 +923,11 @@ static int hantro_probe(struct platform_device *pdev)
 
 	/*
 	 * Support for nxp,imx8mq-vpu is kept for backwards compatibility
-	 * but it's deprecated. Please update your DTS file to use
-	 * nxp,imx8mq-vpu-g1 or nxp,imx8mq-vpu-g2 instead.
+	 * but it's deprecated.
 	 */
-	if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
+	if ((of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu")) &&
+	    (!of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu-g1")) &&
+	    (!of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu-g2")))
 		dev_warn(&pdev->dev, "%s compatible is deprecated\n",
 			 match->compatible);
 
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ