imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,51 +1,51 @@
 enum ia_css_err ia_css_spctrl_load_fw(sp_ID_t sp_id, ia_css_spctrl_cfg *spctrl_cfg) {
   hrt_vaddress code_addr = mmgr_NULL;
   struct ia_css_sp_init_dmem_cfg *init_dmem_cfg;
   if ((sp_id >= N_SP_ID) || (spctrl_cfg == 0)) return IA_CSS_ERR_INVALID_ARGUMENTS;
   spctrl_cofig_info[sp_id].code_addr = mmgr_NULL;
 #if defined(HRT_UNSCHED)
   (void)init_dmem_cfg;
   code_addr = mmgr_malloc(1);
   if (code_addr == mmgr_NULL) return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
 #else
   init_dmem_cfg = &spctrl_cofig_info[sp_id].dmem_config;
   init_dmem_cfg->dmem_data_addr = spctrl_cfg->dmem_data_addr;
   init_dmem_cfg->dmem_bss_addr = spctrl_cfg->dmem_bss_addr;
   init_dmem_cfg->data_size = spctrl_cfg->data_size;
   init_dmem_cfg->bss_size = spctrl_cfg->bss_size;
   init_dmem_cfg->sp_id = sp_id;
   spctrl_cofig_info[sp_id].spctrl_config_dmem_addr = spctrl_cfg->spctrl_config_dmem_addr;
   spctrl_cofig_info[sp_id].spctrl_state_dmem_addr = spctrl_cfg->spctrl_state_dmem_addr;
   /* store code (text + icache) and data to DDR
    *
    * Data used to be stored separately, because of access alignment constraints,
    * fix the FW generation instead
    */
   code_addr = mmgr_malloc(spctrl_cfg->code_size);
   if (code_addr == mmgr_NULL) return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
   mmgr_store(code_addr, spctrl_cfg->code, spctrl_cfg->code_size);
   if (sizeof(hrt_vaddress) > sizeof(hrt_data)) {
     ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR, "size of hrt_vaddress can not be greater than hrt_data\n");
-    mmgr_free(code_addr);
+    hmm_free(code_addr);
     code_addr = mmgr_NULL;
     return IA_CSS_ERR_INTERNAL_ERROR;
   }
   init_dmem_cfg->ddr_data_addr = code_addr + spctrl_cfg->ddr_data_offset;
   if ((init_dmem_cfg->ddr_data_addr % HIVE_ISP_DDR_WORD_BYTES) != 0) {
     ia_css_debug_dtrace(IA_CSS_DEBUG_ERROR, "DDR address pointer is not properly aligned for DMA transfer\n");
-    mmgr_free(code_addr);
+    hmm_free(code_addr);
     code_addr = mmgr_NULL;
     return IA_CSS_ERR_INTERNAL_ERROR;
   }
 #endif
   spctrl_cofig_info[sp_id].sp_entry = spctrl_cfg->sp_entry;
   spctrl_cofig_info[sp_id].code_addr = code_addr;
   spctrl_cofig_info[sp_id].program_name = spctrl_cfg->program_name;
   /* now we program the base address into the icache and
    * invalidate the cache.
    */
   sp_ctrl_store(sp_id, SP_ICACHE_ADDR_REG, (hrt_data)spctrl_cofig_info[sp_id].code_addr);
   sp_ctrl_setbit(sp_id, SP_ICACHE_INV_REG, SP_ICACHE_INV_BIT);
   spctrl_loaded[sp_id] = true;
   return IA_CSS_SUCCESS;
 }<sep>@@
expression e;
@@
-       mmgr_free
+       hmm_free
		(e)
--- initial
+++ final
@@ -1,7 +1,7 @@
 enum ia_css_err ia_css_spctrl_unload_fw(sp_ID_t sp_id) {
   if ((sp_id >= N_SP_ID) || ((sp_id < N_SP_ID) && (!spctrl_loaded[sp_id]))) return IA_CSS_ERR_INVALID_ARGUMENTS;
   /*  freeup the resource */
-  if (spctrl_cofig_info[sp_id].code_addr) mmgr_free(spctrl_cofig_info[sp_id].code_addr);
+  if (spctrl_cofig_info[sp_id].code_addr) hmm_free(spctrl_cofig_info[sp_id].code_addr);
   spctrl_loaded[sp_id] = false;
   return IA_CSS_SUCCESS;
 }<sep>@@
expression e;
@@
-       mmgr_free
+       hmm_free
		(e)
--- initial
+++ final
@@ -1,17 +1,17 @@
 static ssize_t bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) {
   struct bsg_device *bd = file->private_data;
   ssize_t bytes_written;
   int ret;
   dprintk("%s: write %zd bytes\n", bd->name, count);
-  if (unlikely(segment_eq(get_fs(), KERNEL_DS))) return -EINVAL;
+  if (uaccess_kernel()) return -EINVAL;
   bsg_set_block(bd, file);
   bytes_written = 0;
   ret = __bsg_write(bd, buf, count, &bytes_written, file->f_mode & FMODE_WRITE);
   *ppos = bytes_written;
   /*
    * return bytes written on non-fatal errors
    */
   if (!bytes_written || err_block_err(ret)) bytes_written = ret;
   dprintk("%s: returning %zd\n", bd->name, bytes_written);
   return bytes_written;
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,14 +1,14 @@
 void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, unsigned long nr_segs, size_t count) {
   /* It will get better.  Eventually... */
-  if (segment_eq(get_fs(), KERNEL_DS)) {
+  if (uaccess_kernel()) {
     direction |= ITER_KVEC;
     i->type = direction;
     i->kvec = (struct kvec *)iov;
   } else {
     i->type = direction;
     i->iov = iov;
   }
   i->nr_segs = nr_segs;
   i->iov_offset = 0;
   i->count = count;
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,14 +1,14 @@
 void __might_fault(const char *file, int line) {
   /*
    * Some code (nfs/sunrpc) uses socket ops on kernel memory while
    * holding the mmap_sem, this is safe because kernel memory doesn't
    * get paged out, therefore we'll never actually fault, and the
    * below annotations will generate false positives.
    */
-  if (segment_eq(get_fs(), KERNEL_DS)) return;
+  if (uaccess_kernel()) return;
   if (pagefault_disabled()) return;
   __might_sleep(file, line, 0);
 #if defined(CONFIG_DEBUG_ATOMIC_SLEEP)
   if (current->mm) might_lock_read(&current->mm->mmap_sem);
 #endif
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,4 +1,4 @@
 static bool tomoyo_kernel_service(void) {
   /* Nothing to do if I am a kernel service. */
-  return segment_eq(get_fs(), KERNEL_DS);
+  return uaccess_kernel();
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,35 +1,35 @@
 void __show_regs(struct pt_regs *regs) {
   unsigned long flags;
   char buf[64];
   show_regs_print_info(KERN_DEFAULT);
   print_symbol("PC is at %s\n", instruction_pointer(regs));
   print_symbol("LR is at %s\n", regs->UCreg_lr);
   printk(KERN_DEFAULT "pc : [<%08lx>]    lr : [<%08lx>]    psr: %08lx\n"
                       "sp : %08lx  ip : %08lx  fp : %08lx\n",
          regs->UCreg_pc, regs->UCreg_lr, regs->UCreg_asr, regs->UCreg_sp, regs->UCreg_ip, regs->UCreg_fp);
   printk(KERN_DEFAULT "r26: %08lx  r25: %08lx  r24: %08lx\n", regs->UCreg_26, regs->UCreg_25, regs->UCreg_24);
   printk(KERN_DEFAULT "r23: %08lx  r22: %08lx  r21: %08lx  r20: %08lx\n", regs->UCreg_23, regs->UCreg_22, regs->UCreg_21, regs->UCreg_20);
   printk(KERN_DEFAULT "r19: %08lx  r18: %08lx  r17: %08lx  r16: %08lx\n", regs->UCreg_19, regs->UCreg_18, regs->UCreg_17, regs->UCreg_16);
   printk(KERN_DEFAULT "r15: %08lx  r14: %08lx  r13: %08lx  r12: %08lx\n", regs->UCreg_15, regs->UCreg_14, regs->UCreg_13, regs->UCreg_12);
   printk(KERN_DEFAULT "r11: %08lx  r10: %08lx  r9 : %08lx  r8 : %08lx\n", regs->UCreg_11, regs->UCreg_10, regs->UCreg_09, regs->UCreg_08);
   printk(KERN_DEFAULT "r7 : %08lx  r6 : %08lx  r5 : %08lx  r4 : %08lx\n", regs->UCreg_07, regs->UCreg_06, regs->UCreg_05, regs->UCreg_04);
   printk(KERN_DEFAULT "r3 : %08lx  r2 : %08lx  r1 : %08lx  r0 : %08lx\n", regs->UCreg_03, regs->UCreg_02, regs->UCreg_01, regs->UCreg_00);
   flags = regs->UCreg_asr;
   buf[0] = flags & PSR_S_BIT ? 'S' : 's';
   buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z';
   buf[2] = flags & PSR_C_BIT ? 'C' : 'c';
   buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
   buf[4] = '\0';
-  printk(KERN_DEFAULT "Flags: %s  INTR o%s  REAL o%s  Mode %s  Segment %s\n", buf, interrupts_enabled(regs) ? "n" : "ff", fast_interrupts_enabled(regs) ? "n" : "ff", processor_modes[processor_mode(regs)], segment_eq(get_fs(), get_ds()) ? "kernel" : "user");
+  printk(KERN_DEFAULT "Flags: %s  INTR o%s  REAL o%s  Mode %s  Segment %s\n", buf, interrupts_enabled(regs) ? "n" : "ff", fast_interrupts_enabled(regs) ? "n" : "ff", processor_modes[processor_mode(regs)], uaccess_kernel() ? "kernel" : "user");
   {
     unsigned int ctrl;
     buf[0] = '\0';
     {
       unsigned int transbase;
       asm("movc %0, p0.c2, #0\n" : "=r"(transbase));
       snprintf(buf, sizeof(buf), "  Table: %08x", transbase);
     }
     asm("movc %0, p0.c1, #0\n" : "=r"(ctrl));
     printk(KERN_DEFAULT "Control: %08x%s\n", ctrl, buf);
   }
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(),
-                           get_ds()))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,9 +1,9 @@
 int _access_ok(unsigned long addr, unsigned long size) {
   if (!size) return 1;
   if (!addr || addr > (0xffffffffUL - (size - 1))) goto _bad_access;
-  if (segment_eq(get_fs(), KERNEL_DS)) return 1;
+  if (uaccess_kernel()) return 1;
   if (memory_start <= addr && (addr + size - 1) < memory_end) return 1;
 _bad_access:
   pr_debug("Bad access attempt: pid[%d] addr[%08lx] size[0x%lx]\n", current->pid, addr, size);
   return 0;
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,7 +1,7 @@
 unsigned long __clear_user(void __user *mem, unsigned long len) {
-  if (segment_eq(get_fs(), KERNEL_DS)) {
+  if (uaccess_kernel()) {
     memset((__force void *)mem, 0, len);
     return 0;
   }
   return buffer_op((unsigned long)mem, len, 1, clear_chunk, NULL);
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,7 +1,7 @@
 long __copy_from_user(void *to, const void __user *from, unsigned long n) {
-  if (segment_eq(get_fs(), KERNEL_DS)) {
+  if (uaccess_kernel()) {
     memcpy(to, (__force void *)from, n);
     return 0;
   }
   return buffer_op((unsigned long)from, n, 0, copy_chunk_from_user, &to);
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,7 +1,7 @@
 long __copy_to_user(void __user *to, const void *from, unsigned long n) {
-  if (segment_eq(get_fs(), KERNEL_DS)) {
+  if (uaccess_kernel()) {
     memcpy((__force void *)to, from, n);
     return 0;
   }
   return buffer_op((unsigned long)to, n, 1, copy_chunk_to_user, &from);
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,11 +1,11 @@
 long __strncpy_from_user(char *dst, const char __user *src, long count) {
   long n;
   char *ptr = dst;
-  if (segment_eq(get_fs(), KERNEL_DS)) {
+  if (uaccess_kernel()) {
     strncpy(dst, (__force void *)src, count);
     return strnlen(dst, count);
   }
   n = buffer_op((unsigned long)src, count, 0, strncpy_chunk_from_user, &ptr);
   if (n != 0) return -EFAULT;
   return strnlen(dst, count);
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,7 +1,7 @@
 long __strnlen_user(const void __user *str, long len) {
   int count = 0, n;
-  if (segment_eq(get_fs(), KERNEL_DS)) return strnlen((__force char *)str, len) + 1;
+  if (uaccess_kernel()) return strnlen((__force char *)str, len) + 1;
   n = buffer_op((unsigned long)str, len, 0, strnlen_chunk, &count);
   if (n == 0) return count + 1;
   return 0;
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,32 +1,32 @@
 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) {
   unsigned long ua_flags;
-  if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+  if (uaccess_kernel()) {
     memset((void *)addr, 0, n);
     return 0;
   }
   down_read(&current->mm->mmap_sem);
   while (n) {
     pte_t *pte;
     spinlock_t *ptl;
     int tocopy;
     while (!pin_page_for_write(addr, &pte, &ptl)) {
       up_read(&current->mm->mmap_sem);
       if (__put_user(0, (char __user *)addr)) goto out;
       down_read(&current->mm->mmap_sem);
     }
     tocopy = (~(unsigned long)addr & ~PAGE_MASK) + 1;
     if (tocopy > n) tocopy = n;
     ua_flags = uaccess_save_and_enable();
     memset((void *)addr, 0, tocopy);
     uaccess_restore(ua_flags);
     addr += tocopy;
     n -= tocopy;
     if (pte)
       pte_unmap_unlock(pte, ptl);
     else
       spin_unlock(ptl);
   }
   up_read(&current->mm->mmap_sem);
 out:
   return n;
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,36 +1,36 @@
 static unsigned long noinline __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n) {
   unsigned long ua_flags;
   int atomic;
-  if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
+  if (uaccess_kernel()) {
     memcpy((void *)to, from, n);
     return 0;
   }
   /* the mmap semaphore is taken only if not in an atomic context */
   atomic = faulthandler_disabled();
   if (!atomic) down_read(&current->mm->mmap_sem);
   while (n) {
     pte_t *pte;
     spinlock_t *ptl;
     int tocopy;
     while (!pin_page_for_write(to, &pte, &ptl)) {
       if (!atomic) up_read(&current->mm->mmap_sem);
       if (__put_user(0, (char __user *)to)) goto out;
       if (!atomic) down_read(&current->mm->mmap_sem);
     }
     tocopy = (~(unsigned long)to & ~PAGE_MASK) + 1;
     if (tocopy > n) tocopy = n;
     ua_flags = uaccess_save_and_enable();
     memcpy((void *)to, from, tocopy);
     uaccess_restore(ua_flags);
     to += tocopy;
     from += tocopy;
     n -= tocopy;
     if (pte)
       pte_unmap_unlock(pte, ptl);
     else
       spin_unlock(ptl);
   }
   if (!atomic) up_read(&current->mm->mmap_sem);
 out:
   return n;
 }<sep>@@
@@
-       unlikely(segment_eq(get_fs(), KERNEL_DS))
+       uaccess_kernel()
--- initial
+++ final
@@ -1,24 +1,24 @@
 static void hauppauge_eeprom(struct au0828_dev *dev, u8 *eeprom_data) {
   struct tveeprom tv;
-  tveeprom_hauppauge_analog(&dev->i2c_client, &tv, eeprom_data);
+  tveeprom_hauppauge_analog(&tv, eeprom_data);
   dev->board.tuner_type = tv.tuner_type;
   /* Make sure we support the board model */
   switch (tv.model) {
   case 72000: /* WinTV-HVR950q (Retail, IR, ATSC/QAM */
   case 72001: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
   case 72101: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
   case 72201: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
   case 72211: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
   case 72221: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
   case 72231: /* WinTV-HVR950q (OEM, IR, ATSC/QAM and analog video */
   case 72241: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
   case 72251: /* WinTV-HVR950q (Retail, IR, ATSC/QAM and analog video */
   case 72261: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
   case 72271: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
   case 72281: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM and analog video */
   case 72301: /* WinTV-HVR850 (Retail, IR, ATSC and analog video */
   case 72500: /* WinTV-HVR950q (OEM, No IR, ATSC/QAM */ break;
   default: pr_warn("%s: warning: unknown hauppauge model #%d\n", __func__, tv.model); break;
   }
   pr_info("%s: hauppauge eeprom: model=%d\n", __func__, tv.model);
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,17 +1,17 @@
 static void hauppauge_eeprom(struct bttv *btv) {
   struct tveeprom tv;
-  tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
+  tveeprom_hauppauge_analog(&tv, eeprom_data);
   btv->tuner_type = tv.tuner_type;
   btv->has_radio = tv.has_radio;
   pr_info("%d: Hauppauge eeprom indicates model#%d\n", btv->c.nr, tv.model);
   /*
    * Some of the 878 boards have duplicate PCI IDs. Switch the board
    * type based on model #.
    */
   if (tv.model == 64900) {
     pr_info("%d: Switching board type from %s to %s\n", btv->c.nr, bttv_tvcards[btv->c.type].name, bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
     btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
   }
   /* The 61334 needs the msp3410 to do the radio demod to get sound */
   if (tv.model == 61334) btv->radio_uses_msp_demodulator = 1;
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,28 +1,28 @@
 void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) {
   struct i2c_client *c;
   u8 eedata[256];
   memset(tv, 0, sizeof(*tv));
   c = kzalloc(sizeof(*c), GFP_KERNEL);
   if (!c) return;
   strlcpy(c->name, "cx18 tveeprom tmp", sizeof(c->name));
   c->adapter = &cx->i2c_adap[0];
   c->addr = 0xa0 >> 1;
   if (tveeprom_read(c, eedata, sizeof(eedata))) goto ret;
   switch (cx->card->type) {
   case CX18_CARD_HVR_1600_ESMT:
   case CX18_CARD_HVR_1600_SAMSUNG:
-  case CX18_CARD_HVR_1600_S5H1411: tveeprom_hauppauge_analog(c, tv, eedata); break;
+  case CX18_CARD_HVR_1600_S5H1411: tveeprom_hauppauge_analog(tv, eedata); break;
   case CX18_CARD_YUAN_MPC718:
   case CX18_CARD_GOTVIEW_PCI_DVD3:
     tv->model = 0x718;
     cx18_eeprom_dump(cx, eedata, sizeof(eedata));
     CX18_INFO("eeprom PCI ID: %02x%02x:%02x%02x\n", eedata[2], eedata[1], eedata[4], eedata[3]);
     break;
   default:
     tv->model = 0xffffffff;
     cx18_eeprom_dump(cx, eedata, sizeof(eedata));
     break;
   }
 ret:
   kfree(c);
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,42 +1,42 @@
 void cx231xx_card_setup(struct cx231xx *dev) {
   cx231xx_set_model(dev);
   dev->tuner_type = cx231xx_boards[dev->model].tuner_type;
   if (cx231xx_boards[dev->model].tuner_addr) dev->tuner_addr = cx231xx_boards[dev->model].tuner_addr;
   /* request some modules */
   if (dev->board.decoder == CX231XX_AVDECODER) {
     dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, cx231xx_get_i2c_adap(dev, I2C_0), "cx25840", 0x88 >> 1, NULL);
     if (dev->sd_cx25840 == NULL) dev_err(dev->dev, "cx25840 subdev registration failure\n");
     cx25840_call(dev, core, load_fw);
   }
   /* Initialize the tuner */
   if (dev->board.tuner_type != TUNER_ABSENT) {
     struct i2c_adapter *tuner_i2c = cx231xx_get_i2c_adap(dev, dev->board.tuner_i2c_master);
     dev->sd_tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, tuner_i2c, "tuner", dev->tuner_addr, NULL);
     if (dev->sd_tuner == NULL)
       dev_err(dev->dev, "tuner subdev registration failure\n");
     else
       cx231xx_config_tuner(dev);
   }
   switch (dev->model) {
   case CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx:
   case CX231XX_BOARD_HAUPPAUGE_930C_HD_1114xx:
   case CX231XX_BOARD_HAUPPAUGE_955Q: {
     struct eeprom {
       struct tveeprom tvee;
       u8 eeprom[256];
       struct i2c_client client;
     };
     struct eeprom *e = kzalloc(sizeof(*e), GFP_KERNEL);
     if (e == NULL) {
       dev_err(dev->dev, "failed to allocate memory to read eeprom\n");
       break;
     }
     e->client.adapter = cx231xx_get_i2c_adap(dev, I2C_1_MUX_1);
     e->client.addr = 0xa0 >> 1;
     read_eeprom(dev, &e->client, e->eeprom, sizeof(e->eeprom));
-    tveeprom_hauppauge_analog(&e->client, &e->tvee, e->eeprom + 0xc0);
+    tveeprom_hauppauge_analog(&e->tvee, e->eeprom + 0xc0);
     kfree(e);
     break;
   }
   }
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,50 +1,50 @@
 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) {
   struct tveeprom tv;
-  tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
+  tveeprom_hauppauge_analog(&tv, eeprom_data);
   core->board.tuner_type = tv.tuner_type;
   core->tuner_formats = tv.tuner_formats;
   core->board.radio.type = tv.has_radio ? CX88_RADIO : 0;
   core->model = tv.model;
   /* Make sure we support the board model */
   switch (tv.model) {
   case 14009: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in) */
   case 14019: /* WinTV-HVR3000 (Retail, IR Blaster, b/panel video, 3.5mm audio in) */
   case 14029: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge) */
   case 14109: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - low profile) */
   case 14129: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge - LP) */
   case 14559: /* WinTV-HVR3000 (OEM, no IR, b/panel video, 3.5mm audio in) */
   case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
   case 14659: /* WinTV-HVR3000 (OEM, no IR, b/panel video, RCA audio in - Low profile) */
   case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low profile) */
   case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
   case 34519: /* WinTV-PCI-FM */
   case 69009:
     /* WinTV-HVR4000 (DVBS/S2/T, Video and IR, back panel inputs) */
   case 69100: /* WinTV-HVR4000LITE (DVBS/S2, IR) */
   case 69500: /* WinTV-HVR4000LITE (DVBS/S2, No IR) */
   case 69559:
     /* WinTV-HVR4000 (DVBS/S2/T, Video no IR, back panel inputs) */
   case 69569: /* WinTV-HVR4000 (DVBS/S2/T, Video no IR) */
   case 90002: /* Nova-T-PCI (9002) */
   case 92001: /* Nova-S-Plus (Video and IR) */
   case 92002: /* Nova-S-Plus (Video and IR) */
   case 90003: /* Nova-T-PCI (9002 No RF out) */
   case 90500: /* Nova-T-PCI (oem) */
   case 90501: /* Nova-T-PCI (oem/IR) */
   case 92000: /* Nova-SE2 (OEM, No Video or IR) */
   case 92900: /* WinTV-IROnly (No analog or digital Video inputs) */
   case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
   case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
   case 96009: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX) */
   case 96019: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX/TX) */
   case 96559: /* WinTV-HVR1300 (PAL Video, MPEG Video no IR) */
   case 96569: /* WinTV-HVR1300 () */
   case 96659: /* WinTV-HVR1300 () */
   case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
     /* known */
     break;
   case CX88_BOARD_SAMSUNG_SMT_7020: cx_set(MO_GP0_IO, 0x008989FF); break;
   default: pr_warn("warning: unknown hauppauge model #%d\n", tv.model); break;
   }
   pr_info("hauppauge eeprom: model=%d\n", tv.model);
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,6 +1,6 @@
 void ivtv_read_eeprom(struct ivtv *itv, struct tveeprom *tv) {
   u8 eedata[256];
   itv->i2c_client.addr = 0xA0 >> 1;
   tveeprom_read(&itv->i2c_client, eedata, sizeof(eedata));
-  tveeprom_hauppauge_analog(&itv->i2c_client, tv, eedata);
+  tveeprom_hauppauge_analog(tv, eedata);
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,29 +1,29 @@
 static int mxl111sf_init(struct dvb_usb_device *d) {
   struct mxl111sf_state *state = d_to_priv(d);
   int ret;
   static u8 eeprom[256];
   u8 reg = 0;
   struct i2c_msg msg[2] = {
       {.addr = 0xa0 >> 1, .len = 1, .buf = &reg},
       {.addr = 0xa0 >> 1, .flags = I2C_M_RD, .len = sizeof(eeprom), .buf = eeprom},
   };
   ret = get_chip_info(state);
   if (mxl_fail(ret)) pr_err("failed to get chip info during probe");
   mutex_init(&state->fe_lock);
   if (state->chip_rev > MXL111SF_V6) mxl111sf_config_pin_mux_modes(state, PIN_MUX_TS_SPI_IN_MODE_1);
   ret = i2c_transfer(&d->i2c_adap, msg, 2);
   if (mxl_fail(ret)) return 0;
-  tveeprom_hauppauge_analog(NULL, &state->tv, (0x84 == eeprom[0xa0]) ? eeprom + 0xa0 : eeprom + 0x80);
+  tveeprom_hauppauge_analog(&state->tv, (0x84 == eeprom[0xa0]) ? eeprom + 0xa0 : eeprom + 0x80);
 #if 0
 	switch (state->tv.model) {
 	case 117001:
 	case 126001:
 	case 138001:
 		break;
 	default:
 		printk(KERN_WARNING "%s: warning: unknown hauppauge model #%d\n",
 		       __func__, state->tv.model);
 	}
 #endif
   return 0;
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)
--- initial
+++ final
@@ -1,24 +1,24 @@
 int pvr2_eeprom_analyze(struct pvr2_hdw *hdw) {
   u8 *eeprom;
   struct tveeprom tvdata;
   memset(&tvdata, 0, sizeof(tvdata));
   eeprom = pvr2_eeprom_fetch(hdw);
   if (!eeprom) return -EINVAL;
-  tveeprom_hauppauge_analog(NULL, &tvdata, eeprom);
+  tveeprom_hauppauge_analog(&tvdata, eeprom);
   trace_eeprom("eeprom assumed v4l tveeprom module");
   trace_eeprom("eeprom direct call results:");
   trace_eeprom("has_radio=%d", tvdata.has_radio);
   trace_eeprom("tuner_type=%d", tvdata.tuner_type);
   trace_eeprom("tuner_formats=0x%x", tvdata.tuner_formats);
   trace_eeprom("audio_processor=%d", tvdata.audio_processor);
   trace_eeprom("model=%d", tvdata.model);
   trace_eeprom("revision=%d", tvdata.revision);
   trace_eeprom("serial_number=%d", tvdata.serial_number);
   trace_eeprom("rev_str=%s", tvdata.rev_str);
   hdw->tuner_type = tvdata.tuner_type;
   hdw->tuner_updated = !0;
   hdw->serial_number = tvdata.serial_number;
   hdw->std_mask_eeprom = tvdata.tuner_formats;
   kfree(eeprom);
   return 0;
 }<sep>@@
expression e1,e2,e3;
@@
tveeprom_hauppauge_analog(
- e1,
  e2,e3)