if (checksum != ee[21]) 
if (checksum != ee[21]) 
static void __devinit osprey_eeprom(struct bttv *btv){       int i = 0;       unsigned char *ee = eeprom_data;       unsigned long serial = 0;       if (btv->c.type == 0) {               /* this might be an antique... check for MMAC label in eeprom */               if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {                       unsigned char checksum = 0;                       for (i =0; i<21; i++)			       checksum += ee[i];                       if (checksum != ee[21])			       return;		       btv->c.type = BTTV_BOARD_OSPREY1x0_848;		       for (i = 12; i < 21; i++)			       serial *= 10, serial += ee[i] - '0';               }       } else {	       unsigned short type;               int offset = 4*16;               for(; offset < 8*16; offset += 16) {                       unsigned short checksum = 0;                       /* verify the checksum */                       for(i = 0; i<14; i++) checksum += ee[i+offset];                               checksum = ~checksum;  /* no idea why */                               if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&                                   ((checksum & 0x0FF) == ee[offset+15])) {                               break;                       }               }               if (offset >= 8*16)		       return;	       /* found a valid descriptor */	       type = (ee[offset+4]<<8) | (ee[offset+5]);	       switch(type) {	       /* 848 based */	       case 0x0004:		       btv->c.type = BTTV_BOARD_OSPREY1x0_848;		       break;	       case 0x0005:		       btv->c.type = BTTV_BOARD_OSPREY101_848;		       break;               /* 878 based */	       case 0x0012:	       case 0x0013:		       btv->c.type = BTTV_BOARD_OSPREY1x0;		       break;	       case 0x0014:	       case 0x0015:		       btv->c.type = BTTV_BOARD_OSPREY1x1;		       break;	       case 0x0016:	       case 0x0017:	       case 0x0020:		       btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;		       break;	       case 0x0018:	       case 0x0019:	       case 0x001E:	       case 0x001F:		       btv->c.type = BTTV_BOARD_OSPREY2xx;		       break;	       case 0x001A:	       case 0x001B:		       btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;		       break;	       case 0x0040:		       btv->c.type = BTTV_BOARD_OSPREY500;		       break;	       case 0x0050:	       case 0x0056:		       btv->c.type = BTTV_BOARD_OSPREY540;		       /* bttv_osprey_540_init(btv); */		       break;	       case 0x0060:	       case 0x0070:		       btv->c.type = BTTV_BOARD_OSPREY2x0;		       /* enable output on select control lines */		       gpio_inout(0xffffff,0x000303);		       break;	       default:		       /* unknown...leave generic, but get serial # */		       break;	       }	       serial =  (ee[offset+6] << 24)		       | (ee[offset+7] << 16)		       | (ee[offset+8] <<  8)		       | (ee[offset+9]);       }       printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",	      btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/bttv-cards.c/buggy/drivers/media/video/bttv-cards.c