[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231026021056.850680-1-suhui@nfschina.com>
Date: Thu, 26 Oct 2023 10:10:57 +0800
From: Su Hui <suhui@...china.com>
To: lukas@...ner.de, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com,
daniel@...ll.ch
Cc: Su Hui <suhui@...china.com>, tiwai@...e.de, Jim.Qu@....com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] vga_switcheroo: Fix impossible judgment condition
'id' is enum type like unsigned int, so it will never be less than zero.
Fixes: 4aaf448fa975 ("vga_switcheroo: set audio client id according to bound GPU id")
Signed-off-by: Su Hui <suhui@...china.com>
---
drivers/gpu/vga/vga_switcheroo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 365e6ddbe90f..d3064466fd3a 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -375,7 +375,7 @@ int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
mutex_lock(&vgasr_mutex);
if (vgasr_priv.active) {
id = vgasr_priv.handler->get_client_id(vga_dev);
- if (id < 0) {
+ if ((int)id < 0) {
mutex_unlock(&vgasr_mutex);
return -EINVAL;
}
--
2.30.2
Powered by blists - more mailing lists