瀏覽代碼

[xhci] Fix comparison of signed and unsigned integers

gcc 4.8.2 fails to report this erroneous comparison unless assertions
are enabled.

Reported-by: Mary-Ann Johnson <MaryAnn.Johnson@displaylink.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 年之前
父節點
當前提交
6d195c5669
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/drivers/usb/xhci.c

+ 1
- 1
src/drivers/usb/xhci.c 查看文件

@@ -2622,7 +2622,7 @@ static int xhci_device_open ( struct usb_device *usb ) {
2622 2622
 		rc = id;
2623 2623
 		goto err_enable_slot;
2624 2624
 	}
2625
-	assert ( ( id > 0 ) && ( id <= xhci->slots ) );
2625
+	assert ( ( id > 0 ) && ( ( unsigned int ) id <= xhci->slots ) );
2626 2626
 	assert ( xhci->slot[id] == NULL );
2627 2627
 
2628 2628
 	/* Allocate and initialise structure */

Loading…
取消
儲存