瀏覽代碼

Avoid signed/unsigned warnings by explicitly making PCI_{BUS,DEV,FUNC}

all return unsigned quantities.
tags/v0.9.3
Michael Brown 19 年之前
父節點
當前提交
b7c55c3951
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. 4
    4
      src/include/pci.h

+ 4
- 4
src/include/pci.h 查看文件

@@ -249,10 +249,10 @@ struct pci_device {
249 249
 	uint8_t			irq;
250 250
 	uint8_t			already_tried;
251 251
 };
252
-#define PCI_BUS(busdevfn)	( ( (busdevfn) >> 8 ) & 0xff )
253
-#define PCI_DEV(busdevfn)	( ( (busdevfn) >> 3 ) & 0x1f )
254
-#define PCI_FUNC(busdevfn)      ( (busdevfn) & 0x07 )
255
-#define PCI_FN0(busdevfn)	( (busdevfn) & 0xfff8 )
252
+#define PCI_BUS(busdevfn)	( ( uint8_t ) ( ( (busdevfn) >> 8 ) & 0xff ) )
253
+#define PCI_DEV(busdevfn)	( ( uint8_t ) ( ( (busdevfn) >> 3 ) & 0x1f ) )
254
+#define PCI_FUNC(busdevfn)      ( ( uint8_t ) ( (busdevfn) & 0x07 ) )
255
+#define PCI_FN0(busdevfn)	( ( uint16_t ) ( (busdevfn) & 0xfff8 ) )
256 256
 
257 257
 /*
258 258
  * An individual PCI device identified by vendor and device IDs

Loading…
取消
儲存