imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,40 +1,40 @@
 static __poll_t xillybus_poll(struct file *filp, poll_table *wait) {
   struct xilly_channel *channel = filp->private_data;
   __poll_t mask = 0;
   unsigned long flags;
   poll_wait(filp, &channel->endpoint->ep_wait, wait);
   /*
    * poll() won't play ball regarding read() channels which
    * aren't asynchronous and support the nonempty message. Allowing
    * that will create situations where data has been delivered at
    * the FPGA, and users expecting select() to wake up, which it may
    * not.
    */
   if (!channel->wr_synchronous && channel->wr_supports_nonempty) {
     poll_wait(filp, &channel->wr_wait, wait);
     poll_wait(filp, &channel->wr_ready_wait, wait);
     spin_lock_irqsave(&channel->wr_spinlock, flags);
-    if (!channel->wr_empty || channel->wr_ready) mask |= POLLIN | POLLRDNORM;
+    if (!channel->wr_empty || channel->wr_ready) mask |= EPOLLIN | EPOLLRDNORM;
     if (channel->wr_hangup)
       /*
        * Not POLLHUP, because its behavior is in the
        * mist, and POLLIN does what we want: Wake up
        * the read file descriptor so it sees EOF.
        */
-      mask |= POLLIN | POLLRDNORM;
+      mask |= EPOLLIN | EPOLLRDNORM;
     spin_unlock_irqrestore(&channel->wr_spinlock, flags);
   }
   /*
    * If partial data write is disallowed on a write() channel,
    * it's pointless to ever signal OK to write, because is could
    * block despite some space being available.
    */
   if (channel->rd_allow_partial) {
     poll_wait(filp, &channel->rd_wait, wait);
     spin_lock_irqsave(&channel->rd_spinlock, flags);
-    if (!channel->rd_full) mask |= POLLOUT | POLLWRNORM;
+    if (!channel->rd_full) mask |= EPOLLOUT | EPOLLWRNORM;
     spin_unlock_irqrestore(&channel->rd_spinlock, flags);
   }
-  if (channel->endpoint->fatal_error) mask |= POLLERR;
+  if (channel->endpoint->fatal_error) mask |= EPOLLERR;
   return mask;
 }<sep>@@
@@
-               POLLIN
+               EPOLLIN

@@
@@
-               POLLRDNORM
+               EPOLLRDNORM

@@
@@
-               POLLOUT
+               EPOLLOUT

@@
@@
-		POLLWRNORM
+		EPOLLWRNORM

@@
@@
-		POLLERR
+		EPOLLERR
--- initial
+++ final
@@ -1,16 +1,16 @@
 static inline int dio_bio_add_page(struct dio_submit *sdio) {
   int ret;
   ret = bio_add_page(sdio->bio, sdio->cur_page, sdio->cur_page_len, sdio->cur_page_offset);
   if (ret == sdio->cur_page_len) {
     /*
      * Decrement count only, if we are done with this page
      */
     if ((sdio->cur_page_len + sdio->cur_page_offset) == PAGE_SIZE) sdio->pages_in_io--;
-    page_cache_get(sdio->cur_page);
+    get_page(sdio->cur_page);
     sdio->final_block_in_bio = sdio->cur_page_block + (sdio->cur_page_len >> sdio->blkbits);
     ret = 0;
   } else {
     ret = 1;
   }
   return ret;
 }<sep>@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void dentry_update_name_case(struct dentry *dentry, struct qstr *name) {
-  BUG_ON(!mutex_is_locked(&dentry->d_parent->d_inode->i_mutex));
+  BUG_ON(!inode_is_locked(dentry->d_parent->d_inode));
   BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */
   spin_lock(&dentry->d_lock);
   write_seqcount_begin(&dentry->d_seq);
   memcpy((unsigned char *)dentry->d_name.name, name->name, name->len);
   write_seqcount_end(&dentry->d_seq);
   spin_unlock(&dentry->d_lock);
 }<sep>@@
expression e1;
@@
-	mutex_is_locked(&(e1->i_mutex))
+	inode_is_locked(e1)
--- initial
+++ final
@@ -1,21 +1,21 @@
 static __poll_t ep0_poll(struct file *fd, poll_table *wait) {
   struct dev_data *dev = fd->private_data;
   __poll_t mask = 0;
   if (dev->state <= STATE_DEV_OPENED) return DEFAULT_POLLMASK;
   poll_wait(fd, &dev->wait, wait);
   spin_lock_irq(&dev->lock);
   /* report fd mode change before acting on it */
   if (dev->setup_abort) {
     dev->setup_abort = 0;
-    mask = POLLHUP;
+    mask = EPOLLHUP;
     goto out;
   }
   if (dev->state == STATE_DEV_SETUP) {
-    if (dev->setup_in || dev->setup_can_stall) mask = POLLOUT;
+    if (dev->setup_in || dev->setup_can_stall) mask = EPOLLOUT;
   } else {
-    if (dev->ev_next != 0) mask = POLLIN;
+    if (dev->ev_next != 0) mask = EPOLLIN;
   }
 out:
   spin_unlock_irq(&dev->lock);
   return mask;
 }<sep>@@
@@
-               POLLIN
+               EPOLLIN

@@
@@
-               POLLOUT
+               EPOLLOUT

@@
@@
-		POLLHUP
+		EPOLLHUP
--- initial
+++ final
@@ -1,18 +1,18 @@
 static int __d_unalias(struct inode *inode, struct dentry *dentry, struct dentry *alias) {
   struct mutex *m1 = NULL, *m2 = NULL;
   int ret = -ESTALE;
   /* If alias and dentry share a parent, then no extra locks required */
   if (alias->d_parent == dentry->d_parent) goto out_unalias;
   /* See lock_rename() */
   if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex)) goto out_err;
   m1 = &dentry->d_sb->s_vfs_rename_mutex;
-  if (!mutex_trylock(&alias->d_parent->d_inode->i_mutex)) goto out_err;
+  if (!inode_trylock(alias->d_parent->d_inode)) goto out_err;
   m2 = &alias->d_parent->d_inode->i_mutex;
 out_unalias:
   __d_move(alias, dentry, false);
   ret = 0;
 out_err:
   if (m2) mutex_unlock(m2);
   if (m1) mutex_unlock(m1);
   return ret;
 }<sep>@@
expression e1;
@@
-	mutex_trylock(&(e1->i_mutex))
+	inode_trylock(e1)
--- initial
+++ final
@@ -1,21 +1,21 @@
 ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos) {
   mm_segment_t old_fs;
   const char __user *p;
   ssize_t ret;
-  if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write)) return -EINVAL;
+  if (!file->f_op->write && !file->f_op->aio_write) return -EINVAL;
   old_fs = get_fs();
   set_fs(get_ds());
   p = (__force const char __user *)buf;
   if (count > MAX_RW_COUNT) count = MAX_RW_COUNT;
   if (file->f_op->write)
     ret = file->f_op->write(file, p, count, pos);
   else
     ret = do_sync_write(file, p, count, pos);
   set_fs(old_fs);
   if (ret > 0) {
     fsnotify_modify(file);
     add_wchar(current, ret);
   }
   inc_syscw(current);
   return ret;
 }<sep>@expression@
expression file, e;
@@

- file->f_op == NULL || (e)
+ e
--- initial
+++ final
@@ -1,33 +1,33 @@
 static int ext4_mb_get_buddy_page_lock(struct super_block *sb, ext4_group_t group, struct ext4_buddy *e4b, gfp_t gfp) {
   struct inode *inode = EXT4_SB(sb)->s_buddy_cache;
   int block, pnum, poff;
   int blocks_per_page;
   struct page *page;
   e4b->bd_buddy_page = NULL;
   e4b->bd_bitmap_page = NULL;
-  blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize;
+  blocks_per_page = PAGE_SIZE / sb->s_blocksize;
   /*
    * the buddy cache inode stores the block bitmap
    * and buddy information in consecutive blocks.
    * So for each group we need two blocks.
    */
   block = group * 2;
   pnum = block / blocks_per_page;
   poff = block % blocks_per_page;
   page = find_or_create_page(inode->i_mapping, pnum, gfp);
   if (!page) return -ENOMEM;
   BUG_ON(page->mapping != inode->i_mapping);
   e4b->bd_bitmap_page = page;
   e4b->bd_bitmap = page_address(page) + (poff * sb->s_blocksize);
   if (blocks_per_page >= 2) {
     /* buddy and bitmap are on the same page */
     return 0;
   }
   block++;
   pnum = block / blocks_per_page;
   page = find_or_create_page(inode->i_mapping, pnum, gfp);
   if (!page) return -ENOMEM;
   BUG_ON(page->mapping != inode->i_mapping);
   e4b->bd_buddy_page = page;
   return 0;
 }<sep>@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE
--- initial
+++ final
@@ -1,48 +1,48 @@
 static bool load_and_init_attrdef(ntfs_volume *vol) {
   loff_t i_size;
   struct super_block *sb = vol->sb;
   struct inode *ino;
   struct page *page;
   pgoff_t index, max_index;
   unsigned int size;
   ntfs_debug("Entering.");
   /* Read attrdef table and setup vol->attrdef and vol->attrdef_size. */
   ino = ntfs_iget(sb, FILE_AttrDef);
   if (IS_ERR(ino) || is_bad_inode(ino)) {
     if (!IS_ERR(ino)) iput(ino);
     goto failed;
   }
   NInoSetSparseDisabled(NTFS_I(ino));
   /* The size of FILE_AttrDef must be above 0 and fit inside 31 bits. */
   i_size = i_size_read(ino);
   if (i_size <= 0 || i_size > 0x7fffffff) goto iput_failed;
   vol->attrdef = (ATTR_DEF *)ntfs_malloc_nofs(i_size);
   if (!vol->attrdef) goto iput_failed;
   index = 0;
-  max_index = i_size >> PAGE_CACHE_SHIFT;
-  size = PAGE_CACHE_SIZE;
+  max_index = i_size >> PAGE_SHIFT;
+  size = PAGE_SIZE;
   while (index < max_index) {
     /* Read the attrdef table and copy it into the linear buffer. */
   read_partial_attrdef_page:
     page = ntfs_map_page(ino->i_mapping, index);
     if (IS_ERR(page)) goto free_iput_failed;
-    memcpy((u8 *)vol->attrdef + (index++ << PAGE_CACHE_SHIFT), page_address(page), size);
+    memcpy((u8 *)vol->attrdef + (index++ << PAGE_SHIFT), page_address(page), size);
     ntfs_unmap_page(page);
   };
-  if (size == PAGE_CACHE_SIZE) {
-    size = i_size & ~PAGE_CACHE_MASK;
+  if (size == PAGE_SIZE) {
+    size = i_size & ~PAGE_MASK;
     if (size) goto read_partial_attrdef_page;
   }
   vol->attrdef_size = i_size;
   ntfs_debug("Read %llu bytes from $AttrDef.", i_size);
   iput(ino);
   return true;
 free_iput_failed:
   ntfs_free(vol->attrdef);
   vol->attrdef = NULL;
 iput_failed:
   iput(ino);
 failed:
   ntfs_error(sb, "Failed to initialize attribute definition table.");
   return false;
 }<sep>@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT

@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE

@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK
--- initial
+++ final
@@ -1,19 +1,19 @@
 static int regs_dbg_open(struct inode *inode, struct file *file) {
   struct usba_udc *udc;
   unsigned int i;
   u32 *data;
   int ret = -ENOMEM;
-  mutex_lock(&inode->i_mutex);
+  inode_lock(inode);
   udc = inode->i_private;
   data = kmalloc(inode->i_size, GFP_KERNEL);
   if (!data) goto out;
   spin_lock_irq(&udc->lock);
   for (i = 0; i < inode->i_size / 4; i++)
     data[i] = usba_io_readl(udc->regs + i * 4);
   spin_unlock_irq(&udc->lock);
   file->private_data = data;
   ret = 0;
 out:
-  mutex_unlock(&inode->i_mutex);
+  inode_unlock(inode);
   return ret;
 }<sep>@@
expression e1;
@@
-       mutex_lock(&(e1->i_mutex));
+       inode_lock(e1);

@@
expression e1;
@@
-       mutex_unlock(&(e1->i_mutex));
+       inode_unlock(e1);
--- initial
+++ final
@@ -1 +1 @@
-static int can_rcvlist_proc_open(struct inode *inode, struct file *file) { return single_open(file, can_rcvlist_proc_show, PDE(inode)->data); }
+static int can_rcvlist_proc_open(struct inode *inode, struct file *file) { return single_open(file, can_rcvlist_proc_show, PDE_DATA(inode)); }<sep>@@
struct inode *i;
@@
-       PDE(i)->data
+       PDE_DATA(i)
--- initial
+++ final
@@ -1,27 +1,27 @@
 static long saa6588_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) {
   struct saa6588 *s = to_saa6588(sd);
   struct saa6588_command *a = arg;
   switch (cmd) {
     /* --- close() for /dev/radio --- */
   case SAA6588_CMD_CLOSE:
     s->data_available_for_read = 1;
     wake_up_interruptible(&s->read_queue);
     s->data_available_for_read = 0;
     a->result = 0;
     break;
     /* --- read() for /dev/radio --- */
   case SAA6588_CMD_READ:
     read_from_buf(s, a);
     break;
     /* --- poll() for /dev/radio --- */
   case SAA6588_CMD_POLL:
     a->result = 0;
-    if (s->data_available_for_read) a->result |= POLLIN | POLLRDNORM;
+    if (s->data_available_for_read) a->result |= EPOLLIN | EPOLLRDNORM;
     poll_wait(a->instance, &s->read_queue, a->event_list);
     break;
   default:
     /* nothing */
     return -ENOIOCTLCMD;
   }
   return 0;
 }<sep>@@
@@
-               POLLIN
+               EPOLLIN

@@
@@
-               POLLRDNORM
+               EPOLLRDNORM
--- initial
+++ final
@@ -1,11 +1,11 @@
 static __poll_t ns_revision_poll(struct file *file, poll_table *pt) {
   struct aa_revision *rev = file->private_data;
   __poll_t mask = 0;
   if (rev) {
     mutex_lock_nested(&rev->ns->lock, rev->ns->level);
     poll_wait(file, &rev->ns->wait, pt);
-    if (rev->last_read < rev->ns->revision) mask |= POLLIN | POLLRDNORM;
+    if (rev->last_read < rev->ns->revision) mask |= EPOLLIN | EPOLLRDNORM;
     mutex_unlock(&rev->ns->lock);
   }
   return mask;
 }<sep>@@
@@
-               POLLIN
+               EPOLLIN

@@
@@
-               POLLRDNORM
+               EPOLLRDNORM
--- initial
+++ final
@@ -1,44 +1,41 @@
 static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf) {
   sigset_t set;
   int err;
   err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set));
-  if (err == 0) {
-    sigdelsetmask(&set, ~_BLOCKABLE);
-    set_current_blocked(&set);
-  }
+  if (err == 0) set_current_blocked(&set);
   err |= __get_user(regs->UCreg_00, &sf->uc.uc_mcontext.regs.UCreg_00);
   err |= __get_user(regs->UCreg_01, &sf->uc.uc_mcontext.regs.UCreg_01);
   err |= __get_user(regs->UCreg_02, &sf->uc.uc_mcontext.regs.UCreg_02);
   err |= __get_user(regs->UCreg_03, &sf->uc.uc_mcontext.regs.UCreg_03);
   err |= __get_user(regs->UCreg_04, &sf->uc.uc_mcontext.regs.UCreg_04);
   err |= __get_user(regs->UCreg_05, &sf->uc.uc_mcontext.regs.UCreg_05);
   err |= __get_user(regs->UCreg_06, &sf->uc.uc_mcontext.regs.UCreg_06);
   err |= __get_user(regs->UCreg_07, &sf->uc.uc_mcontext.regs.UCreg_07);
   err |= __get_user(regs->UCreg_08, &sf->uc.uc_mcontext.regs.UCreg_08);
   err |= __get_user(regs->UCreg_09, &sf->uc.uc_mcontext.regs.UCreg_09);
   err |= __get_user(regs->UCreg_10, &sf->uc.uc_mcontext.regs.UCreg_10);
   err |= __get_user(regs->UCreg_11, &sf->uc.uc_mcontext.regs.UCreg_11);
   err |= __get_user(regs->UCreg_12, &sf->uc.uc_mcontext.regs.UCreg_12);
   err |= __get_user(regs->UCreg_13, &sf->uc.uc_mcontext.regs.UCreg_13);
   err |= __get_user(regs->UCreg_14, &sf->uc.uc_mcontext.regs.UCreg_14);
   err |= __get_user(regs->UCreg_15, &sf->uc.uc_mcontext.regs.UCreg_15);
   err |= __get_user(regs->UCreg_16, &sf->uc.uc_mcontext.regs.UCreg_16);
   err |= __get_user(regs->UCreg_17, &sf->uc.uc_mcontext.regs.UCreg_17);
   err |= __get_user(regs->UCreg_18, &sf->uc.uc_mcontext.regs.UCreg_18);
   err |= __get_user(regs->UCreg_19, &sf->uc.uc_mcontext.regs.UCreg_19);
   err |= __get_user(regs->UCreg_20, &sf->uc.uc_mcontext.regs.UCreg_20);
   err |= __get_user(regs->UCreg_21, &sf->uc.uc_mcontext.regs.UCreg_21);
   err |= __get_user(regs->UCreg_22, &sf->uc.uc_mcontext.regs.UCreg_22);
   err |= __get_user(regs->UCreg_23, &sf->uc.uc_mcontext.regs.UCreg_23);
   err |= __get_user(regs->UCreg_24, &sf->uc.uc_mcontext.regs.UCreg_24);
   err |= __get_user(regs->UCreg_25, &sf->uc.uc_mcontext.regs.UCreg_25);
   err |= __get_user(regs->UCreg_26, &sf->uc.uc_mcontext.regs.UCreg_26);
   err |= __get_user(regs->UCreg_fp, &sf->uc.uc_mcontext.regs.UCreg_fp);
   err |= __get_user(regs->UCreg_ip, &sf->uc.uc_mcontext.regs.UCreg_ip);
   err |= __get_user(regs->UCreg_sp, &sf->uc.uc_mcontext.regs.UCreg_sp);
   err |= __get_user(regs->UCreg_lr, &sf->uc.uc_mcontext.regs.UCreg_lr);
   err |= __get_user(regs->UCreg_pc, &sf->uc.uc_mcontext.regs.UCreg_pc);
   err |= __get_user(regs->UCreg_asr, &sf->uc.uc_mcontext.regs.UCreg_asr);
   err |= !valid_user_regs(regs);
   return err;
 }<sep>@@ 
expression e,e1;
statement S,S1;
@@
  if (e)
- {
-       sigdelsetmask(e1, ~_BLOCKABLE);
	S
- }
  else S1
--- initial
+++ final
@@ -1,27 +1,27 @@
 struct page *swapin_readahead(swp_entry_t entry, gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr) {
   struct page *page;
   unsigned long entry_offset = swp_offset(entry);
   unsigned long offset = entry_offset;
   unsigned long start_offset, end_offset;
   unsigned long mask;
   struct blk_plug plug;
   mask = swapin_nr_pages(offset) - 1;
   if (!mask) goto skip;
   /* Read a page_cluster sized and aligned cluster around offset. */
   start_offset = offset & ~mask;
   end_offset = offset | mask;
   if (!start_offset) /* First page is swap header. */
     start_offset++;
   blk_start_plug(&plug);
   for (offset = start_offset; offset <= end_offset; offset++) {
     /* Ok, do the async read-ahead now */
     page = read_swap_cache_async(swp_entry(swp_type(entry), offset), gfp_mask, vma, addr);
     if (!page) continue;
     if (offset != entry_offset) SetPageReadahead(page);
-    page_cache_release(page);
+    put_page(page);
   }
   blk_finish_plug(&plug);
   lru_add_drain(); /* Push any new pages onto the LRU now */
 skip:
   return read_swap_cache_async(entry, gfp_mask, vma, addr);
 }<sep>@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)
--- initial
+++ final
@@ -1,62 +1,62 @@
 static int __devinit ps2_probe(struct sa1111_dev *dev) {
   struct ps2if *ps2if;
   struct serio *serio;
   int ret;
   ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL);
   serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
   if (!ps2if || !serio) {
     ret = -ENOMEM;
     goto free;
   }
   serio->id.type = SERIO_8042;
   serio->write = ps2_write;
   serio->open = ps2_open;
   serio->close = ps2_close;
   strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name));
   strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
   serio->port_data = ps2if;
   serio->dev.parent = &dev->dev;
   ps2if->io = serio;
   ps2if->dev = dev;
   sa1111_set_drvdata(dev, ps2if);
   spin_lock_init(&ps2if->lock);
   /*
    * Request the physical region for this PS2 port.
    */
-  if (!request_mem_region(dev->res.start, dev->res.end - dev->res.start + 1, SA1111_DRIVER_NAME(dev))) {
+  if (!request_mem_region(dev->res.start, resource_size(&dev->res), SA1111_DRIVER_NAME(dev))) {
     ret = -EBUSY;
     goto free;
   }
   /*
    * Our parent device has already mapped the region.
    */
   ps2if->base = dev->mapbase;
   sa1111_enable_device(ps2if->dev);
   /* Incoming clock is 8MHz */
   sa1111_writel(0, ps2if->base + SA1111_PS2CLKDIV);
   sa1111_writel(127, ps2if->base + SA1111_PS2PRECNT);
   /*
    * Flush any pending input.
    */
   ps2_clear_input(ps2if);
   /*
    * Test the keyboard interface.
    */
   ret = ps2_test(ps2if);
   if (ret) goto out;
   /*
    * Flush any pending input.
    */
   ps2_clear_input(ps2if);
   sa1111_disable_device(ps2if->dev);
   serio_register_port(ps2if->io);
   return 0;
 out:
   sa1111_disable_device(ps2if->dev);
-  release_mem_region(dev->res.start, dev->res.end - dev->res.start + 1);
+  release_mem_region(dev->res.start, resource_size(&dev->res));
 free:
   sa1111_set_drvdata(dev, NULL);
   kfree(ps2if);
   kfree(serio);
   return ret;
 }<sep>@@
expression ptr;
@@

- ((ptr.end) - (ptr.start) + 1)
+ resource_size(&ptr)
--- initial
+++ final
@@ -1,37 +1,37 @@
 static ssize_t spufs_wbox_write(struct file *file, const char __user *buf, size_t len, loff_t *pos) {
   struct spu_context *ctx = file->private_data;
   u32 wbox_data, __user *udata;
   ssize_t count;
   if (len < 4) return -EINVAL;
   udata = (void __user *)buf;
-  if (!access_ok(VERIFY_READ, buf, len)) return -EFAULT;
+  if (!access_ok(buf, len)) return -EFAULT;
   if (__get_user(wbox_data, udata)) return -EFAULT;
   count = spu_acquire(ctx);
   if (count) goto out;
   /*
    * make sure we can at least write one element, by waiting
    * in case of !O_NONBLOCK
    */
   count = 0;
   if (file->f_flags & O_NONBLOCK) {
     if (!spu_wbox_write(ctx, wbox_data)) {
       count = -EAGAIN;
       goto out_unlock;
     }
   } else {
     count = spufs_wait(ctx->wbox_wq, spu_wbox_write(ctx, wbox_data));
     if (count) goto out;
   }
   /* write as much as possible */
   for (count = 4, udata++; (count + 4) <= len; count += 4, udata++) {
     int ret;
     ret = __get_user(wbox_data, udata);
     if (ret) break;
     ret = spu_wbox_write(ctx, wbox_data);
     if (ret == 0) break;
   }
 out_unlock:
   spu_release(ctx);
 out:
   return count;
 }<sep>@@
expression e1,e2,e3;
@@
  access_ok(
-        e1,
      e2,e3)
--- initial
+++ final
@@ -1,12 +1,11 @@
 static int flexcan_remove(struct platform_device *pdev) {
   struct net_device *dev = platform_get_drvdata(pdev);
   struct flexcan_priv *priv = netdev_priv(dev);
   struct resource *mem;
   unregister_flexcandev(dev);
-  platform_set_drvdata(pdev, NULL);
   iounmap(priv->base);
   mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   release_mem_region(mem->start, resource_size(mem));
   free_candev(dev);
   return 0;
 }<sep>@@
expression dev;
@@

- platform_set_drvdata(dev, NULL);
--- initial
+++ final
@@ -1,7 +1,6 @@
 static int pcsp_remove(struct platform_device *dev) {
   struct snd_pcsp *chip = platform_get_drvdata(dev);
   alsa_card_pcsp_exit(chip);
   pcspkr_input_remove(chip->input_dev);
-  platform_set_drvdata(dev, NULL);
   return 0;
 }<sep>@@
expression dev;
@@

- platform_set_drvdata(dev, NULL);
--- initial
+++ final
@@ -1,4 +1 @@
-static void snd_sonic_remove(struct pci_dev *pci) {
-  snd_card_free(pci_get_drvdata(pci));
-  pci_set_drvdata(pci, NULL);
-}
+static void snd_sonic_remove(struct pci_dev *pci) { snd_card_free(pci_get_drvdata(pci)); }<sep>@@
expression pci;
@@

- pci_set_drvdata(pci, NULL);
--- initial
+++ final
@@ -1,29 +1,28 @@
 static int pm860x_codec_probe(struct platform_device *pdev) {
   struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
   struct pm860x_priv *pm860x;
   struct resource *res;
   int i, ret;
   pm860x = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_priv), GFP_KERNEL);
   if (pm860x == NULL) return -ENOMEM;
   pm860x->chip = chip;
   pm860x->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
   platform_set_drvdata(pdev, pm860x);
   for (i = 0; i < 4; i++) {
     res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
     if (!res) {
       dev_err(&pdev->dev, "Failed to get IRQ resources\n");
       goto out;
     }
     pm860x->irq[i] = res->start + chip->irq_base;
     strncpy(pm860x->name[i], res->name, MAX_NAME_LEN);
   }
   ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_pm860x, pm860x_dai, ARRAY_SIZE(pm860x_dai));
   if (ret) {
     dev_err(&pdev->dev, "Failed to register codec\n");
     goto out;
   }
   return ret;
 out:
-  platform_set_drvdata(pdev, NULL);
   return -EINVAL;
 }<sep>@@
expression dev;
@@

- platform_set_drvdata(dev, NULL);
--- initial
+++ final
@@ -1,9 +1,8 @@
 static int matrix_keypad_remove(struct platform_device *pdev) {
   struct matrix_keypad *keypad = platform_get_drvdata(pdev);
   device_init_wakeup(&pdev->dev, 0);
   matrix_keypad_free_gpio(keypad);
   input_unregister_device(keypad->input_dev);
   kfree(keypad);
-  platform_set_drvdata(pdev, NULL);
   return 0;
 }<sep>@@
expression dev;
@@

- platform_set_drvdata(dev, NULL);
--- initial
+++ final
@@ -1,16 +1,15 @@
 static int bigmac_sbus_remove(struct platform_device *op) {
   struct bigmac *bp = platform_get_drvdata(op);
   struct device *parent = op->dev.parent;
   struct net_device *net_dev = bp->dev;
   struct platform_device *qec_op;
   qec_op = to_platform_device(parent);
   unregister_netdev(net_dev);
   of_iounmap(&qec_op->resource[0], bp->gregs, GLOB_REG_SIZE);
   of_iounmap(&op->resource[0], bp->creg, CREG_REG_SIZE);
   of_iounmap(&op->resource[1], bp->bregs, BMAC_REG_SIZE);
   of_iounmap(&op->resource[2], bp->tregs, TCVR_REG_SIZE);
   dma_free_coherent(&op->dev, PAGE_SIZE, bp->bmac_block, bp->bblock_dvma);
   free_netdev(net_dev);
-  dev_set_drvdata(&op->dev, NULL);
   return 0;
 }<sep>@@
expression dev;
@@

- dev_set_drvdata(dev, NULL);