diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:26:27 -0400 | 
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:26:27 -0400 | 
| commit | ddfb43f3881edb47aa0083651ad31983cdc42c33 (patch) | |
| tree | 7128cb13b599d2903a4deb05bbae37508b1c261e /drivers/net/ethernet/i825xx/znet.c | |
| parent | 2d6d649a2e0fa0268c0d03d5b1d330ca7907d33c (diff) | |
| parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) | |
| download | olio-linux-3.10-ddfb43f3881edb47aa0083651ad31983cdc42c33.tar.xz olio-linux-3.10-ddfb43f3881edb47aa0083651ad31983cdc42c33.zip  | |
Merge tag 'v3.6-rc6' into for-3.7
Linux 3.6-rc6 has all our bug fixes.
Conflicts (trivial overlap):
	sound/soc/omap/am3517evm.c
Diffstat (limited to 'drivers/net/ethernet/i825xx/znet.c')
| -rw-r--r-- | drivers/net/ethernet/i825xx/znet.c | 13 | 
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/i825xx/znet.c b/drivers/net/ethernet/i825xx/znet.c index bd1f1ef91e1..ba4e0cea350 100644 --- a/drivers/net/ethernet/i825xx/znet.c +++ b/drivers/net/ethernet/i825xx/znet.c @@ -139,8 +139,11 @@ struct znet_private {  /* Only one can be built-in;-> */  static struct net_device *znet_dev; +#define NETIDBLK_MAGIC		"NETIDBLK" +#define NETIDBLK_MAGIC_SIZE	8 +  struct netidblk { -	char magic[8];		/* The magic number (string) "NETIDBLK" */ +	char magic[NETIDBLK_MAGIC_SIZE];	/* The magic number (string) "NETIDBLK" */  	unsigned char netid[8]; /* The physical station address */  	char nettype, globalopt;  	char vendor[8];		/* The machine vendor and product name. */ @@ -373,14 +376,16 @@ static int __init znet_probe (void)  	struct znet_private *znet;  	struct net_device *dev;  	char *p; +	char *plast = phys_to_virt(0x100000 - NETIDBLK_MAGIC_SIZE);  	int err = -ENOMEM;  	/* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ -	for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++) -		if (*p == 'N'  &&  strncmp(p, "NETIDBLK", 8) == 0) +	for(p = (char *)phys_to_virt(0xf0000); p <= plast; p++) +		if (*p == 'N' && +		    strncmp(p, NETIDBLK_MAGIC, NETIDBLK_MAGIC_SIZE) == 0)  			break; -	if (p >= (char *)phys_to_virt(0x100000)) { +	if (p > plast) {  		if (znet_debug > 1)  			printk(KERN_INFO "No Z-Note ethernet adaptor found.\n");  		return -ENODEV;  |