imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,33 +1,33 @@
 int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, int lnum, int offs) {
   int err, l;
   struct ubifs_ch *ch = buf;
   dbg_io("LEB %d:%d, %s, length %d", lnum, offs, dbg_ntype(type), len);
-  ubifs_assert(lnum >= 0 && lnum < c->leb_cnt && offs >= 0);
-  ubifs_assert(len >= UBIFS_CH_SZ && offs + len <= c->leb_size);
-  ubifs_assert(!(offs & 7) && offs < c->leb_size);
-  ubifs_assert(type >= 0 && type < UBIFS_NODE_TYPES_CNT);
+  ubifs_assert(c, lnum >= 0 && lnum < c->leb_cnt && offs >= 0);
+  ubifs_assert(c, len >= UBIFS_CH_SZ && offs + len <= c->leb_size);
+  ubifs_assert(c, !(offs & 7) && offs < c->leb_size);
+  ubifs_assert(c, type >= 0 && type < UBIFS_NODE_TYPES_CNT);
   err = ubifs_leb_read(c, lnum, buf, offs, len, 0);
   if (err && err != -EBADMSG) return err;
   if (type != ch->node_type) {
     ubifs_errc(c, "bad node type (%d but expected %d)", ch->node_type, type);
     goto out;
   }
   err = ubifs_check_node(c, buf, lnum, offs, 0, 0);
   if (err) {
     ubifs_errc(c, "expected node type %d", type);
     return err;
   }
   l = le32_to_cpu(ch->len);
   if (l != len) {
     ubifs_errc(c, "bad node length %d, expected %d", l, len);
     goto out;
   }
   return 0;
 out:
   ubifs_errc(c, "bad node at LEB %d:%d, LEB mapping status %d", lnum, offs, ubi_is_mapped(c->ubi, lnum));
   if (!c->probing) {
     ubifs_dump_node(c, buf);
     dump_stack();
   }
   return -EINVAL;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,10 +1,10 @@
 const struct ubifs_lprops *ubifs_fast_find_empty(struct ubifs_info *c) {
   struct ubifs_lprops *lprops;
-  ubifs_assert(mutex_is_locked(&c->lp_mutex));
+  ubifs_assert(c, mutex_is_locked(&c->lp_mutex));
   if (list_empty(&c->empty_list)) return NULL;
   lprops = list_entry(c->empty_list.next, struct ubifs_lprops, list);
-  ubifs_assert(!(lprops->flags & LPROPS_TAKEN));
-  ubifs_assert(!(lprops->flags & LPROPS_INDEX));
-  ubifs_assert(lprops->free == c->leb_size);
+  ubifs_assert(c, !(lprops->flags & LPROPS_TAKEN));
+  ubifs_assert(c, !(lprops->flags & LPROPS_INDEX));
+  ubifs_assert(c, lprops->free == c->leb_size);
   return lprops;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,15 +1,15 @@
 int ubifs_leb_map(struct ubifs_info *c, int lnum) {
   int err;
-  ubifs_assert(!c->ro_media && !c->ro_mount);
+  ubifs_assert(c, !c->ro_media && !c->ro_mount);
   if (c->ro_error) return -EROFS;
   if (!dbg_is_tst_rcvry(c))
     err = ubi_leb_map(c->ubi, lnum);
   else
     err = dbg_leb_map(c, lnum);
   if (err) {
     ubifs_err(c, "mapping LEB %d failed, error %d", lnum, err);
     ubifs_ro_mode(c, err);
     dump_stack();
   }
   return err;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,14 +1,14 @@
 static void remove_from_lpt_heap(struct ubifs_info *c, struct ubifs_lprops *lprops, int cat) {
   struct ubifs_lpt_heap *heap;
   int hpos = lprops->hpos;
   heap = &c->lpt_heap[cat - 1];
-  ubifs_assert(hpos >= 0 && hpos < heap->cnt);
-  ubifs_assert(heap->arr[hpos] == lprops);
+  ubifs_assert(c, hpos >= 0 && hpos < heap->cnt);
+  ubifs_assert(c, heap->arr[hpos] == lprops);
   heap->cnt -= 1;
   if (hpos < heap->cnt) {
     heap->arr[hpos] = heap->arr[heap->cnt];
     heap->arr[hpos]->hpos = hpos;
     adjust_lpt_heap(c, heap, heap->arr[hpos], hpos, cat);
   }
   dbg_check_heap(c, heap, cat, -1);
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,24 +1,24 @@
 int ubifs_orphan_start_commit(struct ubifs_info *c) {
   struct ubifs_orphan *orphan, **last;
   spin_lock(&c->orphan_lock);
   last = &c->orph_cnext;
   list_for_each_entry(orphan, &c->orph_new, new_list) {
-    ubifs_assert(orphan->new);
-    ubifs_assert(!orphan->cmt);
+    ubifs_assert(c, orphan->new);
+    ubifs_assert(c, !orphan->cmt);
     orphan->new = 0;
     orphan->cmt = 1;
     *last = orphan;
     last = &orphan->cnext;
   }
   *last = NULL;
   c->cmt_orphans = c->new_orphans;
   c->new_orphans = 0;
   dbg_cmt("%d orphans to commit", c->cmt_orphans);
   INIT_LIST_HEAD(&c->orph_new);
   if (c->tot_orphans == 0)
     c->no_orphs = 1;
   else
     c->no_orphs = 0;
   spin_unlock(&c->orphan_lock);
   return 0;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,79 +1,79 @@
 static int do_truncation(struct ubifs_info *c, struct inode *inode, const struct iattr *attr) {
   int err;
   struct ubifs_budget_req req;
   loff_t old_size = inode->i_size, new_size = attr->ia_size;
   int offset = new_size & (UBIFS_BLOCK_SIZE - 1), budgeted = 1;
   struct ubifs_inode *ui = ubifs_inode(inode);
   dbg_gen("ino %lu, size %lld -> %lld", inode->i_ino, old_size, new_size);
   memset(&req, 0, sizeof(struct ubifs_budget_req));
   /*
    * If this is truncation to a smaller size, and we do not truncate on a
    * block boundary, budget for changing one data block, because the last
    * block will be re-written.
    */
   if (new_size & (UBIFS_BLOCK_SIZE - 1)) req.dirtied_page = 1;
   req.dirtied_ino = 1;
   /* A funny way to budget for truncation node */
   req.dirtied_ino_d = UBIFS_TRUN_NODE_SZ;
   err = ubifs_budget_space(c, &req);
   if (err) {
     /*
      * Treat truncations to zero as deletion and always allow them,
      * just like we do for '->unlink()'.
      */
     if (new_size || err != -ENOSPC) return err;
     budgeted = 0;
   }
   truncate_setsize(inode, new_size);
   if (offset) {
     pgoff_t index = new_size >> PAGE_SHIFT;
     struct page *page;
     page = find_lock_page(inode->i_mapping, index);
     if (page) {
       if (PageDirty(page)) {
         /*
          * 'ubifs_jnl_truncate()' will try to truncate
          * the last data node, but it contains
          * out-of-date data because the page is dirty.
          * Write the page now, so that
          * 'ubifs_jnl_truncate()' will see an already
          * truncated (and up to date) data node.
          */
-        ubifs_assert(PagePrivate(page));
+        ubifs_assert(c, PagePrivate(page));
         clear_page_dirty_for_io(page);
         if (UBIFS_BLOCKS_PER_PAGE_SHIFT) offset = new_size & (PAGE_SIZE - 1);
         err = do_writepage(page, offset);
         put_page(page);
         if (err) goto out_budg;
         /*
          * We could now tell 'ubifs_jnl_truncate()' not
          * to read the last block.
          */
       } else {
         /*
          * We could 'kmap()' the page and pass the data
          * to 'ubifs_jnl_truncate()' to save it from
          * having to read it.
          */
         unlock_page(page);
         put_page(page);
       }
     }
   }
   mutex_lock(&ui->ui_mutex);
   ui->ui_size = inode->i_size;
   /* Truncation changes inode [mc]time */
   inode->i_mtime = inode->i_ctime = current_time(inode);
   /* Other attributes may be changed at the same time as well */
   do_attr_changes(inode, attr);
   err = ubifs_jnl_truncate(c, inode, old_size, new_size);
   mutex_unlock(&ui->ui_mutex);
 out_budg:
   if (budgeted)
     ubifs_release_budget(c, &req);
   else {
     c->bi.nospace = c->bi.nospace_rp = 0;
     smp_wmb();
   }
   return err;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,10 +1,10 @@
 static int check_lpt_type(const struct ubifs_info *c, uint8_t **addr, int *pos, int type) {
   int node_type;
-  node_type = ubifs_unpack_bits(addr, pos, UBIFS_LPT_TYPE_BITS);
+  node_type = ubifs_unpack_bits(c, addr, pos, UBIFS_LPT_TYPE_BITS);
   if (node_type != type) {
     ubifs_err(c, "invalid type (%d) in LPT node type %d", node_type, type);
     dump_stack();
     return -EINVAL;
   }
   return 0;
 }<sep>@@
identifier f,c;
expression e1,e2,e3;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_unpack_bits(
+             c,
              e1,e2,e3)
...>
}
--- initial
+++ final
@@ -1,15 +1,15 @@
 int ubifs_leb_unmap(struct ubifs_info *c, int lnum) {
   int err;
-  ubifs_assert(!c->ro_media && !c->ro_mount);
+  ubifs_assert(c, !c->ro_media && !c->ro_mount);
   if (c->ro_error) return -EROFS;
   if (!dbg_is_tst_rcvry(c))
     err = ubi_leb_unmap(c->ubi, lnum);
   else
     err = dbg_leb_unmap(c, lnum);
   if (err) {
     ubifs_err(c, "unmap LEB %d failed, error %d", lnum, err);
     ubifs_ro_mode(c, err);
     dump_stack();
   }
   return err;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,32 +1,32 @@
 static int consolidate(struct ubifs_info *c) {
   int tot_avail = tot_avail_orphs(c), err = 0;
   spin_lock(&c->orphan_lock);
   dbg_cmt("there is space for %d orphans and there are %d", tot_avail, c->tot_orphans);
   if (c->tot_orphans - c->new_orphans <= tot_avail) {
     struct ubifs_orphan *orphan, **last;
     int cnt = 0;
     /* Change the cnext list to include all non-new orphans */
     last = &c->orph_cnext;
     list_for_each_entry(orphan, &c->orph_list, list) {
       if (orphan->new) continue;
       orphan->cmt = 1;
       *last = orphan;
       last = &orphan->cnext;
       cnt += 1;
     }
     *last = NULL;
-    ubifs_assert(cnt == c->tot_orphans - c->new_orphans);
+    ubifs_assert(c, cnt == c->tot_orphans - c->new_orphans);
     c->cmt_orphans = cnt;
     c->ohead_lnum = c->orph_first;
     c->ohead_offs = 0;
   } else {
     /*
      * We limit the number of orphans so that this should
      * never happen.
      */
     ubifs_err(c, "out of space in orphan area");
     err = -EINVAL;
   }
   spin_unlock(&c->orphan_lock);
   return err;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,20 +1,20 @@
 static void ubifs_remove_from_cat(struct ubifs_info *c, struct ubifs_lprops *lprops, int cat) {
   switch (cat) {
   case LPROPS_DIRTY:
   case LPROPS_DIRTY_IDX:
   case LPROPS_FREE: remove_from_lpt_heap(c, lprops, cat); break;
   case LPROPS_FREEABLE:
     c->freeable_cnt -= 1;
-    ubifs_assert(c->freeable_cnt >= 0);
+    ubifs_assert(c, c->freeable_cnt >= 0);
     /* Fall through */
   case LPROPS_UNCAT:
   case LPROPS_EMPTY:
   case LPROPS_FRDI_IDX:
-    ubifs_assert(!list_empty(&lprops->list));
+    ubifs_assert(c, !list_empty(&lprops->list));
     list_del(&lprops->list);
     break;
-  default: ubifs_assert(0);
+  default: ubifs_assert(c, 0);
   }
   c->in_a_category_cnt -= 1;
-  ubifs_assert(c->in_a_category_cnt >= 0);
+  ubifs_assert(c, c->in_a_category_cnt >= 0);
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,31 +1,31 @@
 static void ubifs_remount_ro(struct ubifs_info *c) {
   int i, err;
-  ubifs_assert(!c->need_recovery);
-  ubifs_assert(!c->ro_mount);
+  ubifs_assert(c, !c->need_recovery);
+  ubifs_assert(c, !c->ro_mount);
   mutex_lock(&c->umount_mutex);
   if (c->bgt) {
     kthread_stop(c->bgt);
     c->bgt = NULL;
   }
   dbg_save_space_info(c);
   for (i = 0; i < c->jhead_cnt; i++) {
     err = ubifs_wbuf_sync(&c->jheads[i].wbuf);
     if (err) ubifs_ro_mode(c, err);
   }
   c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_DIRTY);
   c->mst_node->flags |= cpu_to_le32(UBIFS_MST_NO_ORPHS);
   c->mst_node->gc_lnum = cpu_to_le32(c->gc_lnum);
   err = ubifs_write_master(c);
   if (err) ubifs_ro_mode(c, err);
   vfree(c->orph_buf);
   c->orph_buf = NULL;
   kfree(c->write_reserve_buf);
   c->write_reserve_buf = NULL;
   vfree(c->ileb_buf);
   c->ileb_buf = NULL;
   ubifs_lpt_free(c, 1);
   c->ro_mount = 1;
   err = dbg_check_space_info(c);
   if (err) ubifs_ro_mode(c, err);
   mutex_unlock(&c->umount_mutex);
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,67 +1,67 @@
 static int power_cut_emulated(struct ubifs_info *c, int lnum, int write) {
   struct ubifs_debug_info *d = c->dbg;
-  ubifs_assert(dbg_is_tst_rcvry(c));
+  ubifs_assert(c, dbg_is_tst_rcvry(c));
   if (!d->pc_cnt) {
     /* First call - decide delay to the power cut */
     if (chance(1, 2)) {
       unsigned long delay;
       if (chance(1, 2)) {
         d->pc_delay = 1;
         /* Fail within 1 minute */
         delay = prandom_u32() % 60000;
         d->pc_timeout = jiffies;
         d->pc_timeout += msecs_to_jiffies(delay);
         ubifs_warn(c, "failing after %lums", delay);
       } else {
         d->pc_delay = 2;
         delay = prandom_u32() % 10000;
         /* Fail within 10000 operations */
         d->pc_cnt_max = delay;
         ubifs_warn(c, "failing after %lu calls", delay);
       }
     }
     d->pc_cnt += 1;
   }
   /* Determine if failure delay has expired */
   if (d->pc_delay == 1 && time_before(jiffies, d->pc_timeout)) return 0;
   if (d->pc_delay == 2 && d->pc_cnt++ < d->pc_cnt_max) return 0;
   if (lnum == UBIFS_SB_LNUM) {
     if (write && chance(1, 2)) return 0;
     if (chance(19, 20)) return 0;
     ubifs_warn(c, "failing in super block LEB %d", lnum);
   } else if (lnum == UBIFS_MST_LNUM || lnum == UBIFS_MST_LNUM + 1) {
     if (chance(19, 20)) return 0;
     ubifs_warn(c, "failing in master LEB %d", lnum);
   } else if (lnum >= UBIFS_LOG_LNUM && lnum <= c->log_last) {
     if (write && chance(99, 100)) return 0;
     if (chance(399, 400)) return 0;
     ubifs_warn(c, "failing in log LEB %d", lnum);
   } else if (lnum >= c->lpt_first && lnum <= c->lpt_last) {
     if (write && chance(7, 8)) return 0;
     if (chance(19, 20)) return 0;
     ubifs_warn(c, "failing in LPT LEB %d", lnum);
   } else if (lnum >= c->orph_first && lnum <= c->orph_last) {
     if (write && chance(1, 2)) return 0;
     if (chance(9, 10)) return 0;
     ubifs_warn(c, "failing in orphan LEB %d", lnum);
   } else if (lnum == c->ihead_lnum) {
     if (chance(99, 100)) return 0;
     ubifs_warn(c, "failing in index head LEB %d", lnum);
   } else if (c->jheads && lnum == c->jheads[GCHD].wbuf.lnum) {
     if (chance(9, 10)) return 0;
     ubifs_warn(c, "failing in GC head LEB %d", lnum);
   } else if (write && !RB_EMPTY_ROOT(&c->buds) && !ubifs_search_bud(c, lnum)) {
     if (chance(19, 20)) return 0;
     ubifs_warn(c, "failing in non-bud LEB %d", lnum);
   } else if (c->cmt_state == COMMIT_RUNNING_BACKGROUND || c->cmt_state == COMMIT_RUNNING_REQUIRED) {
     if (chance(999, 1000)) return 0;
     ubifs_warn(c, "failing in bud LEB %d commit running", lnum);
   } else {
     if (chance(9999, 10000)) return 0;
     ubifs_warn(c, "failing in bud LEB %d commit not running", lnum);
   }
   d->pc_happened = 1;
   ubifs_warn(c, "========== Power cut emulated ==========");
   dump_stack();
   return 1;
 }<sep>@@
identifier f,c;
expression e;
@@

f(...,struct ubifs_info *c,...) {
<...
 ubifs_assert(
+             c,
              e)
...>
}
--- initial
+++ final
@@ -1,14 +1,13 @@
 static void prism2sta_inf_hostscanresults(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf) {
   hfa384x_t *hw = (hfa384x_t *)wlandev->priv;
   int nbss;
   nbss = (inf->framelen - 3) / 32;
   pr_debug("Received %d hostscan results\n", nbss);
   if (nbss > 32) nbss = 32;
   kfree(hw->scanresults);
-  hw->scanresults = kmalloc(sizeof(hfa384x_InfFrame_t), GFP_ATOMIC);
-  memcpy(hw->scanresults, inf, sizeof(hfa384x_InfFrame_t));
+  hw->scanresults = kmemdup(inf, sizeof(hfa384x_InfFrame_t), GFP_ATOMIC);
   if (nbss == 0) nbss = -1;
   /* Notify/wake the sleeping caller. */
   hw->scanflag = nbss;
   wake_up_interruptible(&hw->cmdq);
 }<sep>@@
expression from,to,size,flag;
statement S;
@@
    
-  to = \(kmalloc\|kzalloc\)(size,flag);
-  memcpy(to, from, size);
+  to = kmemdup(from,size,flag);
--- initial
+++ final
@@ -1,18 +1,18 @@
 static int vbox_connector_init(struct drm_device *dev, struct vbox_crtc *vbox_crtc, struct drm_encoder *encoder) {
   struct vbox_connector *vbox_connector;
   struct drm_connector *connector;
   vbox_connector = kzalloc(sizeof(*vbox_connector), GFP_KERNEL);
   if (!vbox_connector) return -ENOMEM;
   connector = &vbox_connector->base;
   vbox_connector->vbox_crtc = vbox_crtc;
   drm_connector_init(dev, connector, &vbox_connector_funcs, DRM_MODE_CONNECTOR_VGA);
   drm_connector_helper_add(connector, &vbox_connector_helper_funcs);
   connector->interlace_allowed = 0;
   connector->doublescan_allowed = 0;
   drm_mode_create_suggested_offset_properties(dev);
   drm_object_attach_property(&connector->base, dev->mode_config.suggested_x_property, 0);
   drm_object_attach_property(&connector->base, dev->mode_config.suggested_y_property, 0);
   drm_connector_register(connector);
-  drm_mode_connector_attach_encoder(connector, encoder);
+  drm_connector_attach_encoder(connector, encoder);
   return 0;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)
--- initial
+++ final
@@ -1,22 +1,22 @@
 static int adv7511_bridge_attach(struct drm_bridge *bridge) {
   struct adv7511 *adv = bridge_to_adv7511(bridge);
   int ret;
   if (!bridge->encoder) {
     DRM_ERROR("Parent encoder object not found");
     return -ENODEV;
   }
   if (adv->i2c_main->irq)
     adv->connector.polled = DRM_CONNECTOR_POLL_HPD;
   else
     adv->connector.polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
   ret = drm_connector_init(bridge->dev, &adv->connector, &adv7511_connector_funcs, DRM_MODE_CONNECTOR_HDMIA);
   if (ret) {
     DRM_ERROR("Failed to initialize connector with drm\n");
     return ret;
   }
   drm_connector_helper_add(&adv->connector, &adv7511_connector_helper_funcs);
-  drm_mode_connector_attach_encoder(&adv->connector, bridge->encoder);
+  drm_connector_attach_encoder(&adv->connector, bridge->encoder);
   if (adv->type == ADV7533) ret = adv7533_attach_dsi(adv);
   if (adv->i2c_main->irq) regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0), ADV7511_INT0_HPD);
   return ret;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)
--- initial
+++ final
@@ -1,20 +1,20 @@
 static struct drm_connector *panel_connector_create(struct drm_device *dev, struct panel_module *mod, struct drm_encoder *encoder) {
   struct panel_connector *panel_connector;
   struct drm_connector *connector;
   int ret;
   panel_connector = devm_kzalloc(dev->dev, sizeof(*panel_connector), GFP_KERNEL);
   if (!panel_connector) return NULL;
   panel_connector->encoder = encoder;
   panel_connector->mod = mod;
   connector = &panel_connector->base;
   drm_connector_init(dev, connector, &panel_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
   drm_connector_helper_add(connector, &panel_connector_helper_funcs);
   connector->interlace_allowed = 0;
   connector->doublescan_allowed = 0;
-  ret = drm_mode_connector_attach_encoder(connector, encoder);
+  ret = drm_connector_attach_encoder(connector, encoder);
   if (ret) goto fail;
   return connector;
 fail:
   panel_connector_destroy(connector);
   return NULL;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)
--- initial
+++ final
@@ -1,11 +1,11 @@
 static int dw_hdmi_bridge_attach(struct drm_bridge *bridge) {
   struct dw_hdmi *hdmi = bridge->driver_private;
   struct drm_encoder *encoder = bridge->encoder;
   struct drm_connector *connector = &hdmi->connector;
   connector->interlace_allowed = 1;
   connector->polled = DRM_CONNECTOR_POLL_HPD;
   drm_connector_helper_add(connector, &dw_hdmi_connector_helper_funcs);
   drm_connector_init(bridge->dev, connector, &dw_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA);
-  drm_mode_connector_attach_encoder(connector, encoder);
+  drm_connector_attach_encoder(connector, encoder);
   return 0;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)
--- initial
+++ final
@@ -1,31 +1,31 @@
 int nv04_dfp_create(struct drm_connector *connector, struct dcb_output *entry) {
   const struct drm_encoder_helper_funcs *helper;
   struct nouveau_encoder *nv_encoder = NULL;
   struct drm_encoder *encoder;
   int type;
   switch (entry->type) {
   case DCB_OUTPUT_TMDS:
     type = DRM_MODE_ENCODER_TMDS;
     helper = &nv04_tmds_helper_funcs;
     break;
   case DCB_OUTPUT_LVDS:
     type = DRM_MODE_ENCODER_LVDS;
     helper = &nv04_lvds_helper_funcs;
     break;
   default: return -EINVAL;
   }
   nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL);
   if (!nv_encoder) return -ENOMEM;
   nv_encoder->enc_save = nv04_dfp_save;
   nv_encoder->enc_restore = nv04_dfp_restore;
   encoder = to_drm_encoder(nv_encoder);
   nv_encoder->dcb = entry;
   nv_encoder->or = ffs(entry->or) - 1;
   drm_encoder_init(connector->dev, encoder, &nv04_dfp_funcs, type, NULL);
   drm_encoder_helper_add(encoder, helper);
   encoder->possible_crtcs = entry->heads;
   encoder->possible_clones = 0;
   if (entry->type == DCB_OUTPUT_TMDS && entry->location != DCB_LOC_ON_CHIP) nv04_tmds_slave_init(encoder);
-  drm_mode_connector_attach_encoder(connector, encoder);
+  drm_connector_attach_encoder(connector, encoder);
   return 0;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)
--- initial
+++ final
@@ -1,22 +1,22 @@
 int shmob_drm_connector_create(struct shmob_drm_device *sdev, struct drm_encoder *encoder) {
   struct drm_connector *connector = &sdev->connector.connector;
   int ret;
   sdev->connector.encoder = encoder;
   connector->display_info.width_mm = sdev->pdata->panel.width_mm;
   connector->display_info.height_mm = sdev->pdata->panel.height_mm;
   ret = drm_connector_init(sdev->ddev, connector, &connector_funcs, DRM_MODE_CONNECTOR_LVDS);
   if (ret < 0) return ret;
   drm_connector_helper_add(connector, &connector_helper_funcs);
   ret = shmob_drm_backlight_init(&sdev->connector);
   if (ret < 0) goto err_cleanup;
-  ret = drm_mode_connector_attach_encoder(connector, encoder);
+  ret = drm_connector_attach_encoder(connector, encoder);
   if (ret < 0) goto err_backlight;
   drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
   drm_object_property_set_value(&connector->base, sdev->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF);
   return 0;
 err_backlight:
   shmob_drm_backlight_exit(&sdev->connector);
 err_cleanup:
   drm_connector_cleanup(connector);
   return ret;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)
--- initial
+++ final
@@ -1,23 +1,23 @@
 int nv04_dac_create(struct drm_connector *connector, struct dcb_output *entry) {
   const struct drm_encoder_helper_funcs *helper;
   struct nouveau_encoder *nv_encoder = NULL;
   struct drm_device *dev = connector->dev;
   struct drm_encoder *encoder;
   nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL);
   if (!nv_encoder) return -ENOMEM;
   encoder = to_drm_encoder(nv_encoder);
   nv_encoder->dcb = entry;
   nv_encoder->or = ffs(entry->or) - 1;
   nv_encoder->enc_save = nv04_dac_save;
   nv_encoder->enc_restore = nv04_dac_restore;
   if (nv_gf4_disp_arch(dev))
     helper = &nv17_dac_helper_funcs;
   else
     helper = &nv04_dac_helper_funcs;
   drm_encoder_init(dev, encoder, &nv04_dac_funcs, DRM_MODE_ENCODER_DAC, NULL);
   drm_encoder_helper_add(encoder, helper);
   encoder->possible_crtcs = entry->heads;
   encoder->possible_clones = 0;
-  drm_mode_connector_attach_encoder(connector, encoder);
+  drm_connector_attach_encoder(connector, encoder);
   return 0;
 }<sep>@@
expression e1,e2;
@@
-        drm_mode_connector_attach_encoder
+        drm_connector_attach_encoder
		(e1,e2)