imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,67 +1,67 @@
 static struct imon_context *imon_init_intf0(struct usb_interface *intf, const struct usb_device_id *id) {
   struct imon_context *ictx;
   struct urb *rx_urb;
   struct urb *tx_urb;
   struct device *dev = &intf->dev;
   struct usb_host_interface *iface_desc;
   int ret = -ENOMEM;
-  ictx = kzalloc(sizeof(struct imon_context), GFP_KERNEL);
+  ictx = kzalloc(sizeof(*ictx), GFP_KERNEL);
   if (!ictx) goto exit;
   rx_urb = usb_alloc_urb(0, GFP_KERNEL);
   if (!rx_urb) goto rx_urb_alloc_failed;
   tx_urb = usb_alloc_urb(0, GFP_KERNEL);
   if (!tx_urb) goto tx_urb_alloc_failed;
   mutex_init(&ictx->lock);
   spin_lock_init(&ictx->kc_lock);
   mutex_lock(&ictx->lock);
   ictx->dev = dev;
   ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf));
   ictx->rx_urb_intf0 = rx_urb;
   ictx->tx_urb = tx_urb;
   ictx->rf_device = false;
   init_completion(&ictx->tx.finished);
   ictx->vendor = le16_to_cpu(ictx->usbdev_intf0->descriptor.idVendor);
   ictx->product = le16_to_cpu(ictx->usbdev_intf0->descriptor.idProduct);
   /* save drive info for later accessing the panel/knob key table */
   ictx->dev_descr = (struct imon_usb_dev_descr *)id->driver_info;
   /* default send_packet delay is 5ms but some devices need more */
   ictx->send_packet_delay = ictx->dev_descr->flags & IMON_NEED_20MS_PKT_DELAY ? 20 : 5;
   ret = -ENODEV;
   iface_desc = intf->cur_altsetting;
   if (!imon_find_endpoints(ictx, iface_desc)) { goto find_endpoint_failed; }
   usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0, usb_rcvintpipe(ictx->usbdev_intf0, ictx->rx_endpoint_intf0->bEndpointAddress), ictx->usb_rx_buf, sizeof(ictx->usb_rx_buf), usb_rx_callback_intf0, ictx, ictx->rx_endpoint_intf0->bInterval);
   ret = usb_submit_urb(ictx->rx_urb_intf0, GFP_KERNEL);
   if (ret) {
     pr_err("usb_submit_urb failed for intf0 (%d)\n", ret);
     goto urb_submit_failed;
   }
   ictx->idev = imon_init_idev(ictx);
   if (!ictx->idev) {
     dev_err(dev, "%s: input device setup failed\n", __func__);
     goto idev_setup_failed;
   }
   ictx->rdev = imon_init_rdev(ictx);
   if (!ictx->rdev) {
     dev_err(dev, "%s: rc device setup failed\n", __func__);
     goto rdev_setup_failed;
   }
   ictx->dev_present_intf0 = true;
   mutex_unlock(&ictx->lock);
   return ictx;
 rdev_setup_failed:
   input_unregister_device(ictx->idev);
 idev_setup_failed:
   usb_kill_urb(ictx->rx_urb_intf0);
 urb_submit_failed:
 find_endpoint_failed:
   usb_put_dev(ictx->usbdev_intf0);
   mutex_unlock(&ictx->lock);
   usb_free_urb(tx_urb);
 tx_urb_alloc_failed:
   usb_free_urb(rx_urb);
 rx_urb_alloc_failed:
   kfree(ictx);
 exit:
   dev_err(dev, "unable to initialize intf0, err %d\n", ret);
   return NULL;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,59 +1,59 @@
 static int send_packet(struct imon_context *ictx) {
   unsigned int pipe;
   unsigned long timeout;
   int interval = 0;
   int retval = 0;
   struct usb_ctrlrequest *control_req = NULL;
   /* Check if we need to use control or interrupt urb */
   if (!ictx->tx_control) {
     pipe = usb_sndintpipe(ictx->usbdev_intf0, ictx->tx_endpoint->bEndpointAddress);
     interval = ictx->tx_endpoint->bInterval;
     usb_fill_int_urb(ictx->tx_urb, ictx->usbdev_intf0, pipe, ictx->usb_tx_buf, sizeof(ictx->usb_tx_buf), usb_tx_callback, ictx, interval);
     ictx->tx_urb->actual_length = 0;
   } else {
     /* fill request into kmalloc'ed space: */
-    control_req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
+    control_req = kmalloc(sizeof(*control_req), GFP_KERNEL);
     if (control_req == NULL) return -ENOMEM;
     /* setup packet is '21 09 0200 0001 0008' */
     control_req->bRequestType = 0x21;
     control_req->bRequest = 0x09;
     control_req->wValue = cpu_to_le16(0x0200);
     control_req->wIndex = cpu_to_le16(0x0001);
     control_req->wLength = cpu_to_le16(0x0008);
     /* control pipe is endpoint 0x00 */
     pipe = usb_sndctrlpipe(ictx->usbdev_intf0, 0);
     /* build the control urb */
     usb_fill_control_urb(ictx->tx_urb, ictx->usbdev_intf0, pipe, (unsigned char *)control_req, ictx->usb_tx_buf, sizeof(ictx->usb_tx_buf), usb_tx_callback, ictx);
     ictx->tx_urb->actual_length = 0;
   }
   reinit_completion(&ictx->tx.finished);
   ictx->tx.busy = true;
   smp_rmb(); /* ensure later readers know we're busy */
   retval = usb_submit_urb(ictx->tx_urb, GFP_KERNEL);
   if (retval) {
     ictx->tx.busy = false;
     smp_rmb(); /* ensure later readers know we're not busy */
     pr_err_ratelimited("error submitting urb(%d)\n", retval);
   } else {
     /* Wait for transmission to complete (or abort) */
     mutex_unlock(&ictx->lock);
     retval = wait_for_completion_interruptible(&ictx->tx.finished);
     if (retval) {
       usb_kill_urb(ictx->tx_urb);
       pr_err_ratelimited("task interrupted\n");
     }
     mutex_lock(&ictx->lock);
     retval = ictx->tx.status;
     if (retval) pr_err_ratelimited("packet tx failed (%d)\n", retval);
   }
   kfree(control_req);
   /*
    * Induce a mandatory delay before returning, as otherwise,
    * send_packet can get called so rapidly as to overwhelm the device,
    * particularly on faster systems and/or those with quirky usb.
    */
   timeout = msecs_to_jiffies(ictx->send_packet_delay);
   set_current_state(TASK_INTERRUPTIBLE);
   schedule_timeout(timeout);
   return retval;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kmalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,22 +1,22 @@
 static struct clk_hw *__init mclk_clk_register(struct device *dev, const char *name, const char *parent_name, bool is_mspro) {
   struct clk_hw *hw;
   struct clk_mclk *mclk;
   struct clk_init_data init;
   int ret;
-  mclk = kzalloc(sizeof(struct clk_mclk), GFP_KERNEL);
+  mclk = kzalloc(sizeof(*mclk), GFP_KERNEL);
   if (!mclk) return ERR_PTR(-ENOMEM);
   init.name = "mclk";
   init.ops = &mclk_ops;
   init.flags = 0;
   init.parent_names = (parent_name ? &parent_name : NULL);
   init.num_parents = (parent_name ? 1 : 0);
   mclk->hw.init = &init;
   mclk->is_mspro = is_mspro;
   hw = &mclk->hw;
   ret = clk_hw_register(dev, hw);
   if (ret) {
     kfree(mclk);
     hw = ERR_PTR(ret);
   }
   return hw;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,29 +1,29 @@
 static struct clk_hw *__init syscon_clk_register(struct device *dev, const char *name, const char *parent_name, unsigned long flags, bool hw_ctrld, void __iomem *res_reg, u8 res_bit, void __iomem *en_reg, u8 en_bit, u16 clk_val) {
   struct clk_hw *hw;
   struct clk_syscon *sclk;
   struct clk_init_data init;
   int ret;
-  sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL);
+  sclk = kzalloc(sizeof(*sclk), GFP_KERNEL);
   if (!sclk) return ERR_PTR(-ENOMEM);
   init.name = name;
   init.ops = &syscon_clk_ops;
   init.flags = flags;
   init.parent_names = (parent_name ? &parent_name : NULL);
   init.num_parents = (parent_name ? 1 : 0);
   sclk->hw.init = &init;
   sclk->hw_ctrld = hw_ctrld;
   /* Assume the block is in reset at registration */
   sclk->reset = true;
   sclk->res_reg = res_reg;
   sclk->res_bit = res_bit;
   sclk->en_reg = en_reg;
   sclk->en_bit = en_bit;
   sclk->clk_val = clk_val;
   hw = &sclk->hw;
   ret = clk_hw_register(dev, hw);
   if (ret) {
     kfree(sclk);
     hw = ERR_PTR(ret);
   }
   return hw;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,25 +1,25 @@
 int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *timings) {
   struct s3c2410_iobank_timing *bt;
   unsigned long bankcon;
   unsigned long bwscon;
   int bank;
   bwscon = __raw_readl(S3C2410_BWSCON);
   /* look through all banks to see what is currently set. */
   for (bank = 0; bank < MAX_BANKS; bank++) {
     bankcon = __raw_readl(bank_reg(bank));
     if (!bank_is_io(bankcon)) continue;
     s3c_freq_iodbg("%s: bank %d: con %08lx\n", __func__, bank, bankcon);
-    bt = kzalloc(sizeof(struct s3c2410_iobank_timing), GFP_KERNEL);
+    bt = kzalloc(sizeof(*bt), GFP_KERNEL);
     if (!bt) return -ENOMEM;
     /* find out in nWait is enabled for bank. */
     if (bank != 0) {
       unsigned long tmp = S3C2410_BWSCON_GET(bwscon, bank);
       if (tmp & S3C2410_BWSCON_WS) bt->nwait_en = 1;
     }
     timings->bank[bank].io_2410 = bt;
     bt->bankcon = bankcon;
     s3c2410_iotiming_getbank(cfg, bt);
   }
   s3c2410_print_timing("get", timings);
   return 0;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,15 +1,15 @@
 int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *timings) {
   struct s3c2412_iobank_timing *bt;
   u32 bankcfg = __raw_readl(S3C2412_EBI_BANKCFG);
   unsigned int bank;
   /* look through all banks to see what is currently set. */
   for (bank = 0; bank < MAX_BANKS; bank++) {
     if (!bank_is_io(bank, bankcfg)) continue;
-    bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL);
+    bt = kzalloc(sizeof(*bt), GFP_KERNEL);
     if (!bt) return -ENOMEM;
     timings->bank[bank].io_2412 = bt;
     s3c2412_iotiming_getbank(cfg, bt, bank);
   }
   s3c2412_print_timing("get", timings);
   return 0;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,13 +1,13 @@
 struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, void (*select)(struct s3c_adc_client *client, unsigned int selected), void (*conv)(struct s3c_adc_client *client, unsigned d0, unsigned d1, unsigned *samples_left), unsigned int is_ts) {
   struct s3c_adc_client *client;
   WARN_ON(!pdev);
   if (!select) select = s3c_adc_default_select;
   if (!pdev) return ERR_PTR(-EINVAL);
-  client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL);
+  client = kzalloc(sizeof(*client), GFP_KERNEL);
   if (!client) return ERR_PTR(-ENOMEM);
   client->pdev = pdev;
   client->is_ts = is_ts;
   client->select_cb = select;
   client->convert_cb = conv;
   return client;
 }<sep>@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,6 +1,6 @@
 void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd) {
   struct dwc2_hsotg_plat *npd;
-  npd = s3c_set_platdata(pd, sizeof(struct dwc2_hsotg_plat), &s3c_device_usb_hsotg);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_usb_hsotg);
   if (!npd->phy_init) npd->phy_init = s5p_usb_phy_init;
   if (!npd->phy_exit) npd->phy_exit = s5p_usb_phy_exit;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 0;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c0);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c0);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c0_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 1;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c1);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c1);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c1_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 2;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c2);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c2);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c2_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 3;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c3);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c3);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c3_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 4;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c4);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c4);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c4_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 5;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c5);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c5);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c5_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 6;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c6);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c6);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c6_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd) {
   struct s3c2410_platform_i2c *npd;
   if (!pd) {
     pd = &default_i2c_data;
     pd->bus_num = 7;
   }
-  npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), &s3c_device_i2c7);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c7);
   if (!npd->cfg_gpio) npd->cfg_gpio = s3c_i2c7_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,32 +1,32 @@
 void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand) {
   struct s3c2410_platform_nand *npd;
   int size;
   int ret;
   /* note, if we get a failure in allocation, we simply drop out of the
    * function. If there is so little memory available at initialisation
    * time then there is little chance the system is going to run.
    */
-  npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand), &s3c_device_nand);
+  npd = s3c_set_platdata(nand, sizeof(*npd), &s3c_device_nand);
   if (!npd) return;
   /* now see if we need to copy any of the nand set data */
   size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
   if (size) {
     struct s3c2410_nand_set *from = npd->sets;
     struct s3c2410_nand_set *to;
     int i;
     to = kmemdup(from, size, GFP_KERNEL);
     npd->sets = to; /* set, even if we failed */
     if (!to) {
       printk(KERN_ERR "%s: no memory for sets\n", __func__);
       return;
     }
     for (i = 0; i < npd->nr_sets; i++) {
       ret = s3c_nand_copy_set(to);
       if (ret) {
         printk(KERN_ERR "%s: failed to copy set %d\n", __func__, i);
         return;
       }
       to++;
     }
   }
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,5 +1,5 @@
 void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd) {
   struct samsung_keypad_platdata *npd;
-  npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata), &samsung_device_keypad);
+  npd = s3c_set_platdata(pd, sizeof(*npd), &samsung_device_keypad);
   if (!npd->cfg_gpio) npd->cfg_gpio = samsung_keypad_cfg_gpio;
 }<sep>@@
expression e,e1,e2;
type T;
@@

e = s3c_set_platdata(e1,
-               sizeof(T)
+               sizeof(*e)
		,e2)
--- initial
+++ final
@@ -1,81 +1,81 @@
 int perf_event_release_kernel(struct perf_event *event) {
   struct perf_event_context *ctx = event->ctx;
   struct perf_event *child, *tmp;
   /*
    * If we got here through err_file: fput(event_file); we will not have
    * attached to a context yet.
    */
   if (!ctx) {
     WARN_ON_ONCE(event->attach_state & (PERF_ATTACH_CONTEXT | PERF_ATTACH_GROUP));
     goto no_ctx;
   }
   if (!is_kernel_event(event)) perf_remove_from_owner(event);
   ctx = perf_event_ctx_lock(event);
   WARN_ON_ONCE(ctx->parent_ctx);
   perf_remove_from_context(event, DETACH_GROUP);
   raw_spin_lock_irq(&ctx->lock);
   /*
    * Mark this event as STATE_DEAD, there is no external reference to it
    * anymore.
    *
    * Anybody acquiring event->child_mutex after the below loop _must_
    * also see this, most importantly inherit_event() which will avoid
    * placing more children on the list.
    *
    * Thus this guarantees that we will in fact observe and kill _ALL_
    * child events.
    */
   event->state = PERF_EVENT_STATE_DEAD;
   raw_spin_unlock_irq(&ctx->lock);
   perf_event_ctx_unlock(event, ctx);
 again:
   mutex_lock(&event->child_mutex);
   list_for_each_entry(child, &event->child_list, child_list) {
     /*
      * Cannot change, child events are not migrated, see the
      * comment with perf_event_ctx_lock_nested().
      */
-    ctx = lockless_dereference(child->ctx);
+    ctx = READ_ONCE(child->ctx);
     /*
      * Since child_mutex nests inside ctx::mutex, we must jump
      * through hoops. We start by grabbing a reference on the ctx.
      *
      * Since the event cannot get freed while we hold the
      * child_mutex, the context must also exist and have a !0
      * reference count.
      */
     get_ctx(ctx);
     /*
      * Now that we have a ctx ref, we can drop child_mutex, and
      * acquire ctx::mutex without fear of it going away. Then we
      * can re-acquire child_mutex.
      */
     mutex_unlock(&event->child_mutex);
     mutex_lock(&ctx->mutex);
     mutex_lock(&event->child_mutex);
     /*
      * Now that we hold ctx::mutex and child_mutex, revalidate our
      * state, if child is still the first entry, it didn't get freed
      * and we can continue doing so.
      */
     tmp = list_first_entry_or_null(&event->child_list, struct perf_event, child_list);
     if (tmp == child) {
       perf_remove_from_context(child, DETACH_GROUP);
       list_del(&child->child_list);
       free_event(child);
       /*
        * This matches the refcount bump in inherit_event();
        * this can't be the last reference.
        */
       put_event(event);
     }
     mutex_unlock(&event->child_mutex);
     mutex_unlock(&ctx->mutex);
     put_ctx(ctx);
     goto again;
   }
   mutex_unlock(&event->child_mutex);
 no_ctx:
   put_event(event); /* Must be the 'last' reference */
   return 0;
 }<sep>@@
expression e1;
@@
-               lockless_dereference
+               READ_ONCE
		(e1)
--- initial
+++ final
@@ -1,43 +1,43 @@
 static void perf_remove_from_owner(struct perf_event *event) {
   struct task_struct *owner;
   rcu_read_lock();
   /*
    * Matches the smp_store_release() in perf_event_exit_task(). If we
    * observe !owner it means the list deletion is complete and we can
    * indeed free this event, otherwise we need to serialize on
    * owner->perf_event_mutex.
    */
-  owner = lockless_dereference(event->owner);
+  owner = READ_ONCE(event->owner);
   if (owner) {
     /*
      * Since delayed_put_task_struct() also drops the last
      * task reference we can safely take a new reference
      * while holding the rcu_read_lock().
      */
     get_task_struct(owner);
   }
   rcu_read_unlock();
   if (owner) {
     /*
      * If we're here through perf_event_exit_task() we're already
      * holding ctx->mutex which would be an inversion wrt. the
      * normal lock order.
      *
      * However we can safely take this lock because its the child
      * ctx->mutex.
      */
     mutex_lock_nested(&owner->perf_event_mutex, SINGLE_DEPTH_NESTING);
     /*
      * We have to re-check the event->owner field, if it is cleared
      * we raced with perf_event_exit_task(), acquiring the mutex
      * ensured they're done, and we can proceed with freeing the
      * event.
      */
     if (event->owner) {
       list_del_init(&event->owner_entry);
       smp_store_release(&event->owner, NULL);
     }
     mutex_unlock(&owner->perf_event_mutex);
     put_task_struct(owner);
   }
 }<sep>@@
expression e1;
@@
-               lockless_dereference
+               READ_ONCE
		(e1)
--- initial
+++ final
@@ -1,20 +1,20 @@
 static inline int dentry_cmp(const struct dentry *dentry, const unsigned char *ct, unsigned tcount) {
   /*
    * Be careful about RCU walk racing with rename:
    * use 'lockless_dereference' to fetch the name pointer.
    *
    * NOTE! Even if a rename will mean that the length
    * was not loaded atomically, we don't care. The
    * RCU walk will check the sequence count eventually,
    * and catch it. And we won't overrun the buffer,
    * because we're reading the name pointer atomically,
    * and a dentry name is guaranteed to be properly
    * terminated with a NUL byte.
    *
    * End result: even if 'len' is wrong, we'll exit
    * early because the data cannot match (there can
    * be no NUL in the ct/tcount data)
    */
-  const unsigned char *cs = lockless_dereference(dentry->d_name.name);
+  const unsigned char *cs = READ_ONCE(dentry->d_name.name);
   return dentry_string_cmp(cs, ct, tcount);
 }<sep>@@
expression e1;
@@
-               lockless_dereference
+               READ_ONCE
		(e1)
--- initial
+++ final
@@ -1,34 +1,34 @@
 static int __multipath_map_bio(struct multipath *m, struct bio *bio, struct dm_mpath_io *mpio) {
   size_t nr_bytes = bio->bi_iter.bi_size;
   struct pgpath *pgpath;
   unsigned long flags;
   bool queue_io;
   /* Do we need to select a new pgpath? */
-  pgpath = lockless_dereference(m->current_pgpath);
+  pgpath = READ_ONCE(m->current_pgpath);
   queue_io = test_bit(MPATHF_QUEUE_IO, &m->flags);
   if (!pgpath || !queue_io) pgpath = choose_pgpath(m, nr_bytes);
   if ((pgpath && queue_io) || (!pgpath && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))) {
     /* Queue for the daemon to resubmit */
     spin_lock_irqsave(&m->lock, flags);
     bio_list_add(&m->queued_bios, bio);
     spin_unlock_irqrestore(&m->lock, flags);
     /* PG_INIT_REQUIRED cannot be set without QUEUE_IO */
     if (queue_io || test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags))
       pg_init_all_paths(m);
     else if (!queue_io)
       queue_work(kmultipathd, &m->process_queued_bios);
     return DM_MAPIO_SUBMITTED;
   }
   if (!pgpath) {
     if (test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)) return DM_MAPIO_REQUEUE;
     dm_report_EIO(m);
     return DM_MAPIO_KILL;
   }
   mpio->pgpath = pgpath;
   mpio->nr_bytes = nr_bytes;
   bio->bi_status = 0;
   bio_set_dev(bio, pgpath->path.dev->bdev);
   bio->bi_opf |= REQ_FAILFAST_TRANSPORT;
   if (pgpath->pg->ps.type->start_io) pgpath->pg->ps.type->start_io(&pgpath->pg->ps, &pgpath->path, nr_bytes);
   return DM_MAPIO_REMAPPED;
 }<sep>@@
expression e1;
@@
-               lockless_dereference
+               READ_ONCE
		(e1)