File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
drivers/net/ethernet/i825xx Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,11 @@ struct znet_private {
139
139
/* Only one can be built-in;-> */
140
140
static struct net_device * znet_dev ;
141
141
142
+ #define NETIDBLK_MAGIC "NETIDBLK"
143
+ #define NETIDBLK_MAGIC_SIZE 8
144
+
142
145
struct netidblk {
143
- char magic [8 ]; /* The magic number (string) "NETIDBLK" */
146
+ char magic [NETIDBLK_MAGIC_SIZE ]; /* The magic number (string) "NETIDBLK" */
144
147
unsigned char netid [8 ]; /* The physical station address */
145
148
char nettype , globalopt ;
146
149
char vendor [8 ]; /* The machine vendor and product name. */
@@ -373,14 +376,16 @@ static int __init znet_probe (void)
373
376
struct znet_private * znet ;
374
377
struct net_device * dev ;
375
378
char * p ;
379
+ char * plast = phys_to_virt (0x100000 - NETIDBLK_MAGIC_SIZE );
376
380
int err = - ENOMEM ;
377
381
378
382
/* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */
379
- for (p = (char * )phys_to_virt (0xf0000 ); p < (char * )phys_to_virt (0x100000 ); p ++ )
380
- if (* p == 'N' && strncmp (p , "NETIDBLK" , 8 ) == 0 )
383
+ for (p = (char * )phys_to_virt (0xf0000 ); p <= plast ; p ++ )
384
+ if (* p == 'N' &&
385
+ strncmp (p , NETIDBLK_MAGIC , NETIDBLK_MAGIC_SIZE ) == 0 )
381
386
break ;
382
387
383
- if (p >= ( char * ) phys_to_virt ( 0x100000 ) ) {
388
+ if (p > plast ) {
384
389
if (znet_debug > 1 )
385
390
printk (KERN_INFO "No Z-Note ethernet adaptor found.\n" );
386
391
return - ENODEV ;
You can’t perform that action at this time.
0 commit comments