[PATCH] Incorrect kernel version checks

Brian Gerst (bgerst@quark.vpplus.com)
Fri, 19 Nov 1999 21:53:44 -0500


This is a multi-part message in MIME format.
--------------67F8F955D280558073F55359
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

tlan.c and aic7xxx.c check LINUX_KERNEL_VERSION instead of
LINUX_VERSION_CODE. In the tlan case, this caused the TX/RX statistics
to not be counted. For aic7xx, the compatability pci functions were
still being used.

-- 

Brian Gerst --------------67F8F955D280558073F55359 Content-Type: text/plain; charset=us-ascii; name="diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff"

--- linux-2.3.28/drivers/net/tlan.c Wed Sep 29 18:32:15 1999 +++ linux-2.3.28a/drivers/net/tlan.c Mon Nov 15 19:59:30 1999 @@ -1130,8 +1130,8 @@ printk( "TLAN: Received interrupt for uncompleted TX frame.\n" ); } -#if LINUX_KERNEL_VERSION > 0x20100 - priv->stats->tx_bytes += head_list->frameSize; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) + priv->stats.tx_bytes += head_list->frameSize; #endif head_list->cStat = TLAN_CSTAT_UNUSED; @@ -1250,8 +1250,8 @@ skb_reserve( skb, 2 ); t = (void *) skb_put( skb, head_list->frameSize ); -#if LINUX_KERNEL_VERSION > 0x20100 - priv->stats->rx_bytes += head_list->frameSize; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) + priv->stats.rx_bytes += head_list->frameSize; #endif memcpy( t, head_buffer, head_list->frameSize ); @@ -1274,8 +1274,8 @@ skb = (struct sk_buff *) head_list->buffer[9].address; head_list->buffer[9].address = 0; skb_trim( skb, head_list->frameSize ); -#if LINUX_KERNEL_VERSION > 0x20100 - priv->stats->rx_bytes += head_list->frameSize; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0) + priv->stats.rx_bytes += head_list->frameSize; #endif skb->protocol = eth_type_trans( skb, dev ); --- linux-2.3.28/drivers/scsi/aic7xxx.c Sat Nov 13 14:56:55 1999 +++ linux-2.3.28a/drivers/scsi/aic7xxx.c Mon Nov 15 18:40:03 1999 @@ -280,10 +280,6 @@ # define FALSE 0 #endif -#ifndef KERNEL_VERSION -# define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z)) -#endif - /* * We need the bios32.h file if we are kernel version 2.1.92 or less. The * full set of pci_* changes wasn't in place until 2.1.93 @@ -8019,7 +8015,7 @@ { unsigned char devconfig; -#if LINUX_KERNEL_VERSION > KERNEL_VERSION(2,1,92) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,92) pci_read_config_byte(p->pdev, DEVCONFIG, &devconfig); #else pcibios_read_config_byte(p->pci_bus, p->pci_device_fn, @@ -8037,7 +8033,7 @@ if (aic7xxx_verbose & VERBOSE_PROBE2) printk("(scsi%d) Force clearing STPWLEV bit\n", p->host_no); } -#if LINUX_KERNEL_VERSION > KERNEL_VERSION(2,1,92) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,92) pci_write_config_byte(p->pdev, DEVCONFIG, devconfig); #else pcibios_write_config_byte(p->pci_bus, p->pci_device_fn, @@ -9656,7 +9652,7 @@ devconfig |= 0x80000040; pcibios_write_config_dword(pci_bus, pci_devfn, DEVCONFIG, devconfig); #endif /* AIC7XXX_STRICT_PCI_SETUP */ -#endif /* LINUIX_VERSION_CODE > KERNEL_VERSION(2,1,92) */ +#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2,1,92) */ temp_p->unpause = INTEN; temp_p->pause = temp_p->unpause | PAUSE;

--------------67F8F955D280558073F55359--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/