diff --git a/ddbridge/ddbridge-core.c b/ddbridge/ddbridge-core.c index 481d07e..3a50e4f 100644 --- a/ddbridge/ddbridge-core.c +++ b/ddbridge/ddbridge-core.c @@ -252,7 +252,7 @@ static int dma_alloc(struct pci_dev *pdev, struct ddb_dma *dma, int dir) return 0; for (i = 0; i < dma->num; i++) { if (alt_dma) { -#if (KERNEL_VERSION(4, 12, 0) >= LINUX_VERSION_CODE) +#if (KERNEL_VERSION(4, 13, 0) > LINUX_VERSION_CODE) dma->vbuf[i] = kmalloc(dma->size, __GFP_REPEAT); #else dma->vbuf[i] = kmalloc(dma->size, __GFP_RETRY_MAYFAIL); @@ -3362,7 +3362,7 @@ static const struct file_operations ddb_fops = { .release = ddb_release, }; -#if (KERNEL_VERSION(3, 4, 0) >= LINUX_VERSION_CODE) +#if (KERNEL_VERSION(3, 4, 0) > LINUX_VERSION_CODE) static char *ddb_devnode(struct device *device, mode_t *mode) #else static char *ddb_devnode(struct device *device, umode_t *mode) diff --git a/ddbridge/ddbridge-main.c b/ddbridge/ddbridge-main.c index 245a5d5..02ac613 100644 --- a/ddbridge/ddbridge-main.c +++ b/ddbridge/ddbridge-main.c @@ -86,7 +86,7 @@ static void __devexit ddb_remove(struct pci_dev *pdev) pci_disable_device(pdev); } -#if (KERNEL_VERSION(3, 8, 0) < LINUX_VERSION_CODE) +#if (KERNEL_VERSION(3, 8, 0) <= LINUX_VERSION_CODE) #define __devinit #define __devinitdata #endif @@ -97,8 +97,8 @@ static int __devinit ddb_irq_msi(struct ddb *dev, int nr) #ifdef CONFIG_PCI_MSI if (msi && pci_msi_enabled()) { -#if (KERNEL_VERSION(3, 15, 0) < LINUX_VERSION_CODE) -#if (KERNEL_VERSION(4, 11, 0) < LINUX_VERSION_CODE) +#if (KERNEL_VERSION(3, 15, 0) <= LINUX_VERSION_CODE) +#if (KERNEL_VERSION(4, 11, 0) <= LINUX_VERSION_CODE) stat = pci_alloc_irq_vectors(dev->pdev, 1, nr, PCI_IRQ_MSI); #else stat = pci_enable_msi_range(dev->pdev, 1, nr); diff --git a/ddbridge/ddbridge.h b/ddbridge/ddbridge.h index fe38a75..b4b3b0a 100644 --- a/ddbridge/ddbridge.h +++ b/ddbridge/ddbridge.h @@ -28,7 +28,7 @@ #include -#if (KERNEL_VERSION(3, 8, 0) < LINUX_VERSION_CODE) +#if (KERNEL_VERSION(3, 8, 0) <= LINUX_VERSION_CODE) #define __devexit #define __devinit #define __devinitconst