imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,59 +1,60 @@
 static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, uint32_t handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y) {
   struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
   struct drm_gem_object *obj;
   struct amdgpu_bo *aobj;
   int ret;
   if (!handle) {
     /* turn off cursor */
     dce_v10_0_hide_cursor(crtc);
     obj = NULL;
     goto unpin;
   }
   if ((width > amdgpu_crtc->max_cursor_width) || (height > amdgpu_crtc->max_cursor_height)) {
     DRM_ERROR("bad cursor width or height %d x %d\n", width, height);
     return -EINVAL;
   }
   obj = drm_gem_object_lookup(file_priv, handle);
   if (!obj) {
     DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
     return -ENOENT;
   }
   aobj = gem_to_amdgpu_bo(obj);
   ret = amdgpu_bo_reserve(aobj, false);
   if (ret != 0) {
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
-  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM, &amdgpu_crtc->cursor_addr);
+  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM);
   amdgpu_bo_unreserve(aobj);
   if (ret) {
     DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
+  amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
   dce_v10_0_lock_cursor(crtc, true);
   if (width != amdgpu_crtc->cursor_width || height != amdgpu_crtc->cursor_height || hot_x != amdgpu_crtc->cursor_hot_x || hot_y != amdgpu_crtc->cursor_hot_y) {
     int x, y;
     x = amdgpu_crtc->cursor_x + amdgpu_crtc->cursor_hot_x - hot_x;
     y = amdgpu_crtc->cursor_y + amdgpu_crtc->cursor_hot_y - hot_y;
     dce_v10_0_cursor_move_locked(crtc, x, y);
     amdgpu_crtc->cursor_width = width;
     amdgpu_crtc->cursor_height = height;
     amdgpu_crtc->cursor_hot_x = hot_x;
     amdgpu_crtc->cursor_hot_y = hot_y;
   }
   dce_v10_0_show_cursor(crtc);
   dce_v10_0_lock_cursor(crtc, false);
 unpin:
   if (amdgpu_crtc->cursor_bo) {
     struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
     ret = amdgpu_bo_reserve(aobj, true);
     if (likely(ret == 0)) {
       amdgpu_bo_unpin(aobj);
       amdgpu_bo_unreserve(aobj);
     }
     drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
   }
   amdgpu_crtc->cursor_bo = obj;
   return 0;
 }<sep>@@
expression e1,e2,e3,r;
statement S;
@@

        r = amdgpu_bo_pin(e1,e2
-                     ,&e3
                     );
	... when != r
	if (<+...r...+>) S
+       e3 = amdgpu_bo_gpu_offset(e1);
--- initial
+++ final
@@ -1,59 +1,60 @@
 static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, uint32_t handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y) {
   struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
   struct drm_gem_object *obj;
   struct amdgpu_bo *aobj;
   int ret;
   if (!handle) {
     /* turn off cursor */
     dce_v11_0_hide_cursor(crtc);
     obj = NULL;
     goto unpin;
   }
   if ((width > amdgpu_crtc->max_cursor_width) || (height > amdgpu_crtc->max_cursor_height)) {
     DRM_ERROR("bad cursor width or height %d x %d\n", width, height);
     return -EINVAL;
   }
   obj = drm_gem_object_lookup(file_priv, handle);
   if (!obj) {
     DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
     return -ENOENT;
   }
   aobj = gem_to_amdgpu_bo(obj);
   ret = amdgpu_bo_reserve(aobj, false);
   if (ret != 0) {
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
-  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM, &amdgpu_crtc->cursor_addr);
+  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM);
   amdgpu_bo_unreserve(aobj);
   if (ret) {
     DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
+  amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
   dce_v11_0_lock_cursor(crtc, true);
   if (width != amdgpu_crtc->cursor_width || height != amdgpu_crtc->cursor_height || hot_x != amdgpu_crtc->cursor_hot_x || hot_y != amdgpu_crtc->cursor_hot_y) {
     int x, y;
     x = amdgpu_crtc->cursor_x + amdgpu_crtc->cursor_hot_x - hot_x;
     y = amdgpu_crtc->cursor_y + amdgpu_crtc->cursor_hot_y - hot_y;
     dce_v11_0_cursor_move_locked(crtc, x, y);
     amdgpu_crtc->cursor_width = width;
     amdgpu_crtc->cursor_height = height;
     amdgpu_crtc->cursor_hot_x = hot_x;
     amdgpu_crtc->cursor_hot_y = hot_y;
   }
   dce_v11_0_show_cursor(crtc);
   dce_v11_0_lock_cursor(crtc, false);
 unpin:
   if (amdgpu_crtc->cursor_bo) {
     struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
     ret = amdgpu_bo_reserve(aobj, true);
     if (likely(ret == 0)) {
       amdgpu_bo_unpin(aobj);
       amdgpu_bo_unreserve(aobj);
     }
     drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
   }
   amdgpu_crtc->cursor_bo = obj;
   return 0;
 }<sep>@@
expression e1,e2,e3,r;
statement S;
@@

        r = amdgpu_bo_pin(e1,e2
-                     ,&e3
                     );
	... when != r
	if (<+...r...+>) S
+       e3 = amdgpu_bo_gpu_offset(e1);
--- initial
+++ final
@@ -1,59 +1,60 @@
 static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, uint32_t handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y) {
   struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
   struct drm_gem_object *obj;
   struct amdgpu_bo *aobj;
   int ret;
   if (!handle) {
     /* turn off cursor */
     dce_v6_0_hide_cursor(crtc);
     obj = NULL;
     goto unpin;
   }
   if ((width > amdgpu_crtc->max_cursor_width) || (height > amdgpu_crtc->max_cursor_height)) {
     DRM_ERROR("bad cursor width or height %d x %d\n", width, height);
     return -EINVAL;
   }
   obj = drm_gem_object_lookup(file_priv, handle);
   if (!obj) {
     DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
     return -ENOENT;
   }
   aobj = gem_to_amdgpu_bo(obj);
   ret = amdgpu_bo_reserve(aobj, false);
   if (ret != 0) {
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
-  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM, &amdgpu_crtc->cursor_addr);
+  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM);
   amdgpu_bo_unreserve(aobj);
   if (ret) {
     DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
+  amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
   dce_v6_0_lock_cursor(crtc, true);
   if (width != amdgpu_crtc->cursor_width || height != amdgpu_crtc->cursor_height || hot_x != amdgpu_crtc->cursor_hot_x || hot_y != amdgpu_crtc->cursor_hot_y) {
     int x, y;
     x = amdgpu_crtc->cursor_x + amdgpu_crtc->cursor_hot_x - hot_x;
     y = amdgpu_crtc->cursor_y + amdgpu_crtc->cursor_hot_y - hot_y;
     dce_v6_0_cursor_move_locked(crtc, x, y);
     amdgpu_crtc->cursor_width = width;
     amdgpu_crtc->cursor_height = height;
     amdgpu_crtc->cursor_hot_x = hot_x;
     amdgpu_crtc->cursor_hot_y = hot_y;
   }
   dce_v6_0_show_cursor(crtc);
   dce_v6_0_lock_cursor(crtc, false);
 unpin:
   if (amdgpu_crtc->cursor_bo) {
     struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
     ret = amdgpu_bo_reserve(aobj, true);
     if (likely(ret == 0)) {
       amdgpu_bo_unpin(aobj);
       amdgpu_bo_unreserve(aobj);
     }
     drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
   }
   amdgpu_crtc->cursor_bo = obj;
   return 0;
 }<sep>@@
expression e1,e2,e3,r;
statement S;
@@

        r = amdgpu_bo_pin(e1,e2
-                     ,&e3
                     );
	... when != r
	if (<+...r...+>) S
+       e3 = amdgpu_bo_gpu_offset(e1);
--- initial
+++ final
@@ -1,59 +1,60 @@
 static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, uint32_t handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y) {
   struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
   struct drm_gem_object *obj;
   struct amdgpu_bo *aobj;
   int ret;
   if (!handle) {
     /* turn off cursor */
     dce_v8_0_hide_cursor(crtc);
     obj = NULL;
     goto unpin;
   }
   if ((width > amdgpu_crtc->max_cursor_width) || (height > amdgpu_crtc->max_cursor_height)) {
     DRM_ERROR("bad cursor width or height %d x %d\n", width, height);
     return -EINVAL;
   }
   obj = drm_gem_object_lookup(file_priv, handle);
   if (!obj) {
     DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, amdgpu_crtc->crtc_id);
     return -ENOENT;
   }
   aobj = gem_to_amdgpu_bo(obj);
   ret = amdgpu_bo_reserve(aobj, false);
   if (ret != 0) {
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
-  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM, &amdgpu_crtc->cursor_addr);
+  ret = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM);
   amdgpu_bo_unreserve(aobj);
   if (ret) {
     DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret);
     drm_gem_object_put_unlocked(obj);
     return ret;
   }
+  amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj);
   dce_v8_0_lock_cursor(crtc, true);
   if (width != amdgpu_crtc->cursor_width || height != amdgpu_crtc->cursor_height || hot_x != amdgpu_crtc->cursor_hot_x || hot_y != amdgpu_crtc->cursor_hot_y) {
     int x, y;
     x = amdgpu_crtc->cursor_x + amdgpu_crtc->cursor_hot_x - hot_x;
     y = amdgpu_crtc->cursor_y + amdgpu_crtc->cursor_hot_y - hot_y;
     dce_v8_0_cursor_move_locked(crtc, x, y);
     amdgpu_crtc->cursor_width = width;
     amdgpu_crtc->cursor_height = height;
     amdgpu_crtc->cursor_hot_x = hot_x;
     amdgpu_crtc->cursor_hot_y = hot_y;
   }
   dce_v8_0_show_cursor(crtc);
   dce_v8_0_lock_cursor(crtc, false);
 unpin:
   if (amdgpu_crtc->cursor_bo) {
     struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
     ret = amdgpu_bo_reserve(aobj, true);
     if (likely(ret == 0)) {
       amdgpu_bo_unpin(aobj);
       amdgpu_bo_unreserve(aobj);
     }
     drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo);
   }
   amdgpu_crtc->cursor_bo = obj;
   return 0;
 }<sep>@@
expression e1,e2,e3,r;
statement S;
@@

        r = amdgpu_bo_pin(e1,e2
-                     ,&e3
                     );
	... when != r
	if (<+...r...+>) S
+       e3 = amdgpu_bo_gpu_offset(e1);
--- initial
+++ final
@@ -1,12 +1,12 @@
 STATIC int xfs_scrub_bmap_btree(struct xfs_scrub_context *sc, int whichfork, struct xfs_scrub_bmap_info *info) {
   struct xfs_owner_info oinfo;
   struct xfs_mount *mp = sc->mp;
   struct xfs_inode *ip = sc->ip;
   struct xfs_btree_cur *cur;
   int error;
   cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork);
   xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
   error = xfs_scrub_btree(sc, cur, xfs_scrub_bmapbt_rec, &oinfo, info);
-  xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+  xfs_btree_del_cursor(cur, error);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,21 +1,21 @@
 STATIC int xfs_scrub_bmap_check_ag_rmaps(struct xfs_scrub_context *sc, int whichfork, xfs_agnumber_t agno) {
   struct xfs_scrub_bmap_check_rmap_info sbcri;
   struct xfs_btree_cur *cur;
   struct xfs_buf *agf;
   int error;
   error = xfs_alloc_read_agf(sc->mp, sc->tp, agno, 0, &agf);
   if (error) return error;
   cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, agf, agno);
   if (!cur) {
     error = -ENOMEM;
     goto out_agf;
   }
   sbcri.sc = sc;
   sbcri.whichfork = whichfork;
   error = xfs_rmap_query_all(cur, xfs_scrub_bmap_check_rmap, &sbcri);
   if (error == XFS_BTREE_QUERY_RANGE_ABORT) error = 0;
-  xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+  xfs_btree_del_cursor(cur, error);
 out_agf:
   xfs_trans_brelse(sc->tp, agf);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,23 +1,23 @@
 int xfs_repair_find_ag_btree_roots(struct xfs_scrub_context *sc, struct xfs_buf *agf_bp, struct xfs_repair_find_ag_btree *btree_info, struct xfs_buf *agfl_bp) {
   struct xfs_mount *mp = sc->mp;
   struct xfs_repair_findroot ri;
   struct xfs_repair_find_ag_btree *fab;
   struct xfs_btree_cur *cur;
   int error;
   ASSERT(xfs_buf_islocked(agf_bp));
   ASSERT(agfl_bp == NULL || xfs_buf_islocked(agfl_bp));
   ri.sc = sc;
   ri.btree_info = btree_info;
   ri.agf = XFS_BUF_TO_AGF(agf_bp);
   ri.agfl_bp = agfl_bp;
   for (fab = btree_info; fab->buf_ops; fab++) {
     ASSERT(agfl_bp || fab->rmap_owner != XFS_RMAP_OWN_AG);
     ASSERT(XFS_RMAP_NON_INODE_OWNER(fab->rmap_owner));
     fab->root = NULLAGBLOCK;
     fab->height = 0;
   }
   cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno);
   error = xfs_rmap_query_all(cur, xfs_repair_findroot_rmap, &ri);
-  xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+  xfs_btree_del_cursor(cur, error);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,16 +1,16 @@
 int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip, int whichfork, xfs_ino_t new_owner, struct list_head *buffer_list) {
   struct xfs_btree_cur *cur;
   int error;
   ASSERT(tp || buffer_list);
   ASSERT(!(tp && buffer_list));
   if (whichfork == XFS_DATA_FORK)
     ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_BTREE);
   else
     ASSERT(ip->i_d.di_aformat == XFS_DINODE_FMT_BTREE);
   cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
   if (!cur) return -ENOMEM;
   cur->bc_private.b.flags |= XFS_BTCUR_BPRV_INVALID_OWNER;
   error = xfs_btree_change_owner(cur, new_owner, buffer_list);
-  xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+  xfs_btree_del_cursor(cur, error);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,16 +1,16 @@
 STATIC int                                          /* error */
 xfs_bmap_add_attrfork_extents(struct xfs_trans *tp, /* transaction pointer */
                               struct xfs_inode *ip, /* incore inode pointer */
                               int *flags)           /* inode logging flags */
 {
   xfs_btree_cur_t *cur; /* bmap btree cursor */
   int error;            /* error return value */
   if (ip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t) <= XFS_IFORK_DSIZE(ip)) return 0;
   cur = NULL;
   error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags, XFS_DATA_FORK);
   if (cur) {
     cur->bc_private.b.allocated = 0;
-    xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+    xfs_btree_del_cursor(cur, error);
   }
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,59 +1,59 @@
 int xfs_bmap_collapse_extents(struct xfs_trans *tp, struct xfs_inode *ip, xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, bool *done) {
   int whichfork = XFS_DATA_FORK;
   struct xfs_mount *mp = ip->i_mount;
   struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
   struct xfs_btree_cur *cur = NULL;
   struct xfs_bmbt_irec got, prev;
   struct xfs_iext_cursor icur;
   xfs_fileoff_t new_startoff;
   int error = 0;
   int logflags = 0;
   if (unlikely(XFS_TEST_ERROR((XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), mp, XFS_ERRTAG_BMAPIFORMAT))) {
     XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, mp);
     return -EFSCORRUPTED;
   }
   if (XFS_FORCED_SHUTDOWN(mp)) return -EIO;
   ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
   if (!(ifp->if_flags & XFS_IFEXTENTS)) {
     error = xfs_iread_extents(tp, ip, whichfork);
     if (error) return error;
   }
   if (ifp->if_flags & XFS_IFBROOT) {
     cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
     cur->bc_private.b.flags = 0;
   }
   if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
     *done = true;
     goto del_cursor;
   }
   XFS_WANT_CORRUPTED_GOTO(mp, !isnullstartblock(got.br_startblock), del_cursor);
   new_startoff = got.br_startoff - offset_shift_fsb;
   if (xfs_iext_peek_prev_extent(ifp, &icur, &prev)) {
     if (new_startoff < prev.br_startoff + prev.br_blockcount) {
       error = -EINVAL;
       goto del_cursor;
     }
     if (xfs_bmse_can_merge(&prev, &got, offset_shift_fsb)) {
       error = xfs_bmse_merge(ip, whichfork, offset_shift_fsb, &icur, &got, &prev, cur, &logflags, tp->t_dfops);
       if (error) goto del_cursor;
       goto done;
     }
   } else {
     if (got.br_startoff < offset_shift_fsb) {
       error = -EINVAL;
       goto del_cursor;
     }
   }
   error = xfs_bmap_shift_update_extent(ip, whichfork, &icur, &got, cur, &logflags, tp->t_dfops, new_startoff);
   if (error) goto del_cursor;
 done:
   if (!xfs_iext_next_extent(ifp, &icur, &got)) {
     *done = true;
     goto del_cursor;
   }
   *next_fsb = got.br_startoff;
 del_cursor:
-  if (cur) xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+  if (cur) xfs_btree_del_cursor(cur, error);
   if (logflags) xfs_trans_log_inode(tp, ip, logflags);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,67 +1,67 @@
 int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip, xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, bool *done, xfs_fileoff_t stop_fsb) {
   int whichfork = XFS_DATA_FORK;
   struct xfs_mount *mp = ip->i_mount;
   struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
   struct xfs_btree_cur *cur = NULL;
   struct xfs_bmbt_irec got, next;
   struct xfs_iext_cursor icur;
   xfs_fileoff_t new_startoff;
   int error = 0;
   int logflags = 0;
   if (unlikely(XFS_TEST_ERROR((XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), mp, XFS_ERRTAG_BMAPIFORMAT))) {
     XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, mp);
     return -EFSCORRUPTED;
   }
   if (XFS_FORCED_SHUTDOWN(mp)) return -EIO;
   ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
   if (!(ifp->if_flags & XFS_IFEXTENTS)) {
     error = xfs_iread_extents(tp, ip, whichfork);
     if (error) return error;
   }
   if (ifp->if_flags & XFS_IFBROOT) {
     cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
     cur->bc_private.b.flags = 0;
   }
   if (*next_fsb == NULLFSBLOCK) {
     xfs_iext_last(ifp, &icur);
     if (!xfs_iext_get_extent(ifp, &icur, &got) || stop_fsb > got.br_startoff) {
       *done = true;
       goto del_cursor;
     }
   } else {
     if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
       *done = true;
       goto del_cursor;
     }
   }
   XFS_WANT_CORRUPTED_GOTO(mp, !isnullstartblock(got.br_startblock), del_cursor);
   if (stop_fsb >= got.br_startoff + got.br_blockcount) {
     error = -EIO;
     goto del_cursor;
   }
   new_startoff = got.br_startoff + offset_shift_fsb;
   if (xfs_iext_peek_next_extent(ifp, &icur, &next)) {
     if (new_startoff + got.br_blockcount > next.br_startoff) {
       error = -EINVAL;
       goto del_cursor;
     }
     /*
      * Unlike a left shift (which involves a hole punch), a right
      * shift does not modify extent neighbors in any way.  We should
      * never find mergeable extents in this scenario.  Check anyways
      * and warn if we encounter two extents that could be one.
      */
     if (xfs_bmse_can_merge(&got, &next, offset_shift_fsb)) WARN_ON_ONCE(1);
   }
   error = xfs_bmap_shift_update_extent(ip, whichfork, &icur, &got, cur, &logflags, tp->t_dfops, new_startoff);
   if (error) goto del_cursor;
   if (!xfs_iext_prev_extent(ifp, &icur, &got) || stop_fsb >= got.br_startoff + got.br_blockcount) {
     *done = true;
     goto del_cursor;
   }
   *next_fsb = got.br_startoff;
 del_cursor:
-  if (cur) xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+  if (cur) xfs_btree_del_cursor(cur, error);
   if (logflags) xfs_trans_log_inode(tp, ip, logflags);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)
--- initial
+++ final
@@ -1,76 +1,76 @@
 STATIC int xfs_bmap_split_extent_at(struct xfs_trans *tp, struct xfs_inode *ip, xfs_fileoff_t split_fsb) {
   int whichfork = XFS_DATA_FORK;
   struct xfs_btree_cur *cur = NULL;
   struct xfs_bmbt_irec got;
   struct xfs_bmbt_irec new; /* split extent */
   struct xfs_mount *mp = ip->i_mount;
   struct xfs_ifork *ifp;
   xfs_fsblock_t gotblkcnt; /* new block count for got */
   struct xfs_iext_cursor icur;
   int error = 0;
   int logflags = 0;
   int i = 0;
   if (unlikely(XFS_TEST_ERROR((XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), mp, XFS_ERRTAG_BMAPIFORMAT))) {
     XFS_ERROR_REPORT("xfs_bmap_split_extent_at", XFS_ERRLEVEL_LOW, mp);
     return -EFSCORRUPTED;
   }
   if (XFS_FORCED_SHUTDOWN(mp)) return -EIO;
   ifp = XFS_IFORK_PTR(ip, whichfork);
   if (!(ifp->if_flags & XFS_IFEXTENTS)) {
     /* Read in all the extents */
     error = xfs_iread_extents(tp, ip, whichfork);
     if (error) return error;
   }
   /*
    * If there are not extents, or split_fsb lies in a hole we are done.
    */
   if (!xfs_iext_lookup_extent(ip, ifp, split_fsb, &icur, &got) || got.br_startoff >= split_fsb) return 0;
   gotblkcnt = split_fsb - got.br_startoff;
   new.br_startoff = split_fsb;
   new.br_startblock = got.br_startblock + gotblkcnt;
   new.br_blockcount = got.br_blockcount - gotblkcnt;
   new.br_state = got.br_state;
   if (ifp->if_flags & XFS_IFBROOT) {
     cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
     cur->bc_private.b.flags = 0;
     error = xfs_bmbt_lookup_eq(cur, &got, &i);
     if (error) goto del_cursor;
     XFS_WANT_CORRUPTED_GOTO(mp, i == 1, del_cursor);
   }
   got.br_blockcount = gotblkcnt;
   xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), &icur, &got);
   logflags = XFS_ILOG_CORE;
   if (cur) {
     error = xfs_bmbt_update(cur, &got);
     if (error) goto del_cursor;
   } else
     logflags |= XFS_ILOG_DEXT;
   /* Add new extent */
   xfs_iext_next(ifp, &icur);
   xfs_iext_insert(ip, &icur, &new, 0);
   XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) + 1);
   if (cur) {
     error = xfs_bmbt_lookup_eq(cur, &new, &i);
     if (error) goto del_cursor;
     XFS_WANT_CORRUPTED_GOTO(mp, i == 0, del_cursor);
     error = xfs_btree_insert(cur, &i);
     if (error) goto del_cursor;
     XFS_WANT_CORRUPTED_GOTO(mp, i == 1, del_cursor);
   }
   /*
    * Convert to a btree if necessary.
    */
   if (xfs_bmap_needs_btree(ip, whichfork)) {
     int tmp_logflags; /* partial log flag return val */
     ASSERT(cur == NULL);
     error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, &tmp_logflags, whichfork);
     logflags |= tmp_logflags;
   }
 del_cursor:
   if (cur) {
     cur->bc_private.b.allocated = 0;
-    xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
+    xfs_btree_del_cursor(cur, error);
   }
   if (logflags) xfs_trans_log_inode(tp, ip, logflags);
   return error;
 }<sep>@@
expression e,error;
@@

                xfs_btree_del_cursor(e, 
-                       (error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR)
+			error
		)