Commit fe89aafd authored by Jeff Garzik's avatar Jeff Garzik

Merge redhat.com:/spare/repo/netdev-2.6/janitor

into redhat.com:/spare/repo/net-drivers-2.5
parents 5ef7ab1c a49286ee
...@@ -165,7 +165,9 @@ static void ne_block_output(struct net_device *dev, const int count, ...@@ -165,7 +165,9 @@ static void ne_block_output(struct net_device *dev, const int count,
static int __init do_ne_probe(struct net_device *dev) static int __init do_ne_probe(struct net_device *dev)
{ {
unsigned int base_addr = dev->base_addr; unsigned int base_addr = dev->base_addr;
int irq = dev->irq; #ifndef MODULE
int orig_irq = dev->irq;
#endif
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
...@@ -183,7 +185,7 @@ static int __init do_ne_probe(struct net_device *dev) ...@@ -183,7 +185,7 @@ static int __init do_ne_probe(struct net_device *dev)
/* Last resort. The semi-risky ISA auto-probe. */ /* Last resort. The semi-risky ISA auto-probe. */
for (base_addr = 0; netcard_portlist[base_addr] != 0; base_addr++) { for (base_addr = 0; netcard_portlist[base_addr] != 0; base_addr++) {
int ioaddr = netcard_portlist[base_addr]; int ioaddr = netcard_portlist[base_addr];
dev->irq = irq; dev->irq = orig_irq;
if (ne_probe1(dev, ioaddr) == 0) if (ne_probe1(dev, ioaddr) == 0)
return 0; return 0;
} }
......
...@@ -136,8 +136,6 @@ in the event that chatty debug messages are desired - jjs 12/30/98 */ ...@@ -136,8 +136,6 @@ in the event that chatty debug messages are desired - jjs 12/30/98 */
#define DPRINTK(format, args...) printk("%s: " format, dev->name , ## args) #define DPRINTK(format, args...) printk("%s: " format, dev->name , ## args)
#define DPRINTD(format, args...) DummyCall("%s: " format, dev->name , ## args) #define DPRINTD(format, args...) DummyCall("%s: " format, dev->name , ## args)
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
/* version and credits */ /* version and credits */
#ifndef PCMCIA #ifndef PCMCIA
...@@ -730,47 +728,47 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) ...@@ -730,47 +728,47 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
*/ */
if (!ti->page_mask) { if (!ti->page_mask) {
ti->avail_shared_ram= ti->avail_shared_ram=
MIN(ti->mapped_ram_size,ti->avail_shared_ram); min(ti->mapped_ram_size,ti->avail_shared_ram);
} }
switch (ti->avail_shared_ram) { switch (ti->avail_shared_ram) {
case 16: /* 8KB shared RAM */ case 16: /* 8KB shared RAM */
ti->dhb_size4mb = MIN(ti->dhb_size4mb, 2048); ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)2048);
ti->rbuf_len4 = 1032; ti->rbuf_len4 = 1032;
ti->rbuf_cnt4=2; ti->rbuf_cnt4=2;
ti->dhb_size16mb = MIN(ti->dhb_size16mb, 2048); ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)2048);
ti->rbuf_len16 = 1032; ti->rbuf_len16 = 1032;
ti->rbuf_cnt16=2; ti->rbuf_cnt16=2;
break; break;
case 32: /* 16KB shared RAM */ case 32: /* 16KB shared RAM */
ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464);
ti->rbuf_len4 = 1032; ti->rbuf_len4 = 1032;
ti->rbuf_cnt4=4; ti->rbuf_cnt4=4;
ti->dhb_size16mb = MIN(ti->dhb_size16mb, 4096); ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)4096);
ti->rbuf_len16 = 1032; /*1024 usable */ ti->rbuf_len16 = 1032; /*1024 usable */
ti->rbuf_cnt16=4; ti->rbuf_cnt16=4;
break; break;
case 64: /* 32KB shared RAM */ case 64: /* 32KB shared RAM */
ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464);
ti->rbuf_len4 = 1032; ti->rbuf_len4 = 1032;
ti->rbuf_cnt4=6; ti->rbuf_cnt4=6;
ti->dhb_size16mb = MIN(ti->dhb_size16mb, 10240); ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)10240);
ti->rbuf_len16 = 1032; ti->rbuf_len16 = 1032;
ti->rbuf_cnt16=6; ti->rbuf_cnt16=6;
break; break;
case 127: /* 63.5KB shared RAM */ case 127: /* 63.5KB shared RAM */
ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464);
ti->rbuf_len4 = 1032; ti->rbuf_len4 = 1032;
ti->rbuf_cnt4=6; ti->rbuf_cnt4=6;
ti->dhb_size16mb = MIN(ti->dhb_size16mb, 16384); ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)16384);
ti->rbuf_len16 = 1032; ti->rbuf_len16 = 1032;
ti->rbuf_cnt16=16; ti->rbuf_cnt16=16;
break; break;
case 128: /* 64KB shared RAM */ case 128: /* 64KB shared RAM */
ti->dhb_size4mb = MIN(ti->dhb_size4mb, 4464); ti->dhb_size4mb = min(ti->dhb_size4mb, (unsigned short)4464);
ti->rbuf_len4 = 1032; ti->rbuf_len4 = 1032;
ti->rbuf_cnt4=6; ti->rbuf_cnt4=6;
ti->dhb_size16mb = MIN(ti->dhb_size16mb, 17960); ti->dhb_size16mb = min(ti->dhb_size16mb, (unsigned short)17960);
ti->rbuf_len16 = 1032; ti->rbuf_len16 = 1032;
ti->rbuf_cnt16=16; ti->rbuf_cnt16=16;
break; break;
......
...@@ -82,6 +82,7 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE"; ...@@ -82,6 +82,7 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE";
/* Header files */ /* Header files */
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -454,10 +455,7 @@ static spinlock_t strip_lock = SPIN_LOCK_UNLOCKED; ...@@ -454,10 +455,7 @@ static spinlock_t strip_lock = SPIN_LOCK_UNLOCKED;
#define READDEC(X) ((X)>='0' && (X)<='9' ? (X)-'0' : 0) #define READDEC(X) ((X)>='0' && (X)<='9' ? (X)-'0' : 0)
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) #define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)]))
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
#define ELEMENTS_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ARRAY_END(X) (&((X)[ELEMENTS_OF(X)]))
#define JIFFIE_TO_SEC(X) ((X) / HZ) #define JIFFIE_TO_SEC(X) ((X) / HZ)
...@@ -847,7 +845,7 @@ static __u8 *radio_address_to_string(const MetricomAddress * addr, ...@@ -847,7 +845,7 @@ static __u8 *radio_address_to_string(const MetricomAddress * addr,
static int allocate_buffers(struct strip *strip_info, int mtu) static int allocate_buffers(struct strip *strip_info, int mtu)
{ {
struct net_device *dev = strip_info->dev; struct net_device *dev = strip_info->dev;
int sx_size = MAX(STRIP_ENCAP_SIZE(MAX_RECV_MTU), 4096); int sx_size = max_t(int, STRIP_ENCAP_SIZE(MAX_RECV_MTU), 4096);
int tx_size = STRIP_ENCAP_SIZE(mtu) + MaxCommandStringLength; int tx_size = STRIP_ENCAP_SIZE(mtu) + MaxCommandStringLength;
__u8 *r = kmalloc(MAX_RECV_MTU, GFP_ATOMIC); __u8 *r = kmalloc(MAX_RECV_MTU, GFP_ATOMIC);
__u8 *s = kmalloc(sx_size, GFP_ATOMIC); __u8 *s = kmalloc(sx_size, GFP_ATOMIC);
...@@ -953,6 +951,7 @@ static void strip_unlock(struct strip *strip_info) ...@@ -953,6 +951,7 @@ static void strip_unlock(struct strip *strip_info)
* ascii representation of the number plus 9 charactes for the " seconds" * ascii representation of the number plus 9 charactes for the " seconds"
* and the null character. * and the null character.
*/ */
#ifdef CONFIG_PROC_FS
static char *time_delta(char buffer[], long time) static char *time_delta(char buffer[], long time)
{ {
time -= jiffies; time -= jiffies;
...@@ -1173,6 +1172,7 @@ static struct file_operations strip_seq_fops = { ...@@ -1173,6 +1172,7 @@ static struct file_operations strip_seq_fops = {
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release, .release = seq_release,
}; };
#endif
...@@ -1465,7 +1465,7 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb) ...@@ -1465,7 +1465,7 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb)
/* Cycle to next periodic command? */ /* Cycle to next periodic command? */
if (strip_info->firmware_level >= StructuredMessages) if (strip_info->firmware_level >= StructuredMessages)
if (++strip_info->next_command >= if (++strip_info->next_command >=
ELEMENTS_OF(CommandString)) ARRAY_SIZE(CommandString))
strip_info->next_command = 0; strip_info->next_command = 0;
#ifdef EXT_COUNTERS #ifdef EXT_COUNTERS
strip_info->tx_ebytes += ts.length; strip_info->tx_ebytes += ts.length;
...@@ -1709,7 +1709,7 @@ static void get_radio_version(struct strip *strip_info, __u8 * ptr, __u8 * end) ...@@ -1709,7 +1709,7 @@ static void get_radio_version(struct strip *strip_info, __u8 * ptr, __u8 * end)
p++; p++;
len = value_end - value_begin; len = value_end - value_begin;
len = MIN(len, sizeof(FirmwareVersion) - 1); len = min_t(int, len, sizeof(FirmwareVersion) - 1);
if (strip_info->firmware_version.c[0] == 0) if (strip_info->firmware_version.c[0] == 0)
printk(KERN_INFO "%s: Radio Firmware: %.*s\n", printk(KERN_INFO "%s: Radio Firmware: %.*s\n",
strip_info->dev->name, len, value_begin); strip_info->dev->name, len, value_begin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment