From nobody Fri Jul 24 21:53:40 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF2A941D62A for ; Fri, 24 Jul 2026 09:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784886140; cv=none; b=WMrnlMMwADWIZu3nyqntgM/NfEuhkDFJFmopDLxURJRL2hvJN8X5S1NSRlrv8iMIQPvn2IDLf047LoqYyGNAGvm/sPDSS8K7Mm5nfOXAG9gU+nCTrvzvHJrdSwfEusH2EApcImiIROnfInOS5TSG9X8cQ5q6rJ7cNsbMATgFYwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784886140; c=relaxed/simple; bh=OEKWyDKUqn7mYMHsvObQ8gIHTvJyS0Z80LOYGPJQK/4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=En5K0bW9ZSn3E/x0vONq7LWGAkRbNLiGsggvM7eePdsy0w9lTTmOwPwpqo6K0hxqqt54qWUfL4yMSyf+n3OwwBKL7zUbyzsdDcBPqhraNBtevVgfA7EGMT10yc0im7mEO8Ov1beeVxjef+vDulclKPMh4er0e7tSfmWgu4JFWys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=JQjrY6qk; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="JQjrY6qk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=+7 vgOXwFia2PA2VK3zcQUj1a5yj/36+AItIzTr4qu1k=; b=JQjrY6qkOVuDu7M9Kg n/mDgrZNOig3zif4wokPlnNOQZvbsRYpzJJ0oEMwmZXBFUxol8Zs5fxl/sLsAHjd p2sk2cw+QWHNjDLuMh1FSLDC62IXTfr93zrsSomjI35SAV/+MijkXVh12tObeXUU aMmqTT0GcX1NLCXJ8Ppr2f6Cw= Received: from localhost.localdomain (unknown []) by gzsmtp3 (Coremail) with SMTP id PigvCgCHlctVM2Nq7FqhJQ--.2367S2; Fri, 24 Jul 2026 17:41:42 +0800 (CST) From: oushixiong1025@163.com To: Thomas Zimmermann Cc: Javier Martinez Canillas , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.or, linux-kernel@vger.kernel.org, Shixiong Ou Subject: [PATCH] drm/sysfb: ofdrm: Fix is_avivo() constant comparison bug Date: Fri, 24 Jul 2026 17:41:40 +0800 Message-Id: <20260724094140.799730-1-oushixiong1025@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: PigvCgCHlctVM2Nq7FqhJQ--.2367S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WFyUXrWUJrWktF1DWr45Wrg_yoW8Gr1UpF sxG3s5trs8Kr1UK3yDuFWfZayrZan3t3yfGrsrK39Y9rn8Ar90qFZ5JFyYya45A397C3WS q3Z8Gw1xX3WUCr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UkKsbUUUUU= X-CM-SenderInfo: xrxvxxx0lr0wirqskqqrwthudrp/xtbC-hZVZGpjM1aonAAA3B Content-Type: text/plain; charset="utf-8" From: Shixiong Ou The is_avivo() function has a logic error where it compares a constant to another constant instead of checking the device parameter: (PCI_VENDOR_ID_ATI_R600 >=3D 0x9400) However, according to the code comment and the OFDRM_MODEL_AVIVO definition ("ATI R5xx"), this function is intended to match only R5xx cards (device IDs 0x7100-0x7800), not R6xx or later. The second condition checking for R600 is erroneous and should be removed. Signed-off-by: Shixiong Ou --- drivers/gpu/drm/sysfb/ofdrm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sysfb/ofdrm.c b/drivers/gpu/drm/sysfb/ofdrm.c index a6dc34b9ec0f..ea1db1cfe3ed 100644 --- a/drivers/gpu/drm/sysfb/ofdrm.c +++ b/drivers/gpu/drm/sysfb/ofdrm.c @@ -238,8 +238,7 @@ static bool is_avivo(u32 vendor, u32 device) { /* This will match most R5xx */ return (vendor =3D=3D PCI_VENDOR_ID_ATI) && - ((device >=3D PCI_VENDOR_ID_ATI_R520 && device < 0x7800) || - (PCI_VENDOR_ID_ATI_R600 >=3D 0x9400)); + (device >=3D PCI_VENDOR_ID_ATI_R520 && device < 0x7800); } =20 static enum ofdrm_model display_get_model_of(struct drm_device *dev, struc= t device_node *of_node) --=20 2.25.1 No virus found Checked by Hillstone Network AntiVirus