imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,22 +1,22 @@
 static int opal_handle_hmi_event(struct notifier_block *nb, unsigned long msg_type, void *msg) {
   unsigned long flags;
   struct OpalHMIEvent *hmi_evt;
   struct opal_msg *hmi_msg = msg;
   struct OpalHmiEvtNode *msg_node;
   /* Sanity Checks */
   if (msg_type != OPAL_MSG_HMI_EVT) return 0;
   /* HMI event info starts from param[0] */
   hmi_evt = (struct OpalHMIEvent *)&hmi_msg->params[0];
   /* Delay the logging of HMI events to workqueue. */
   msg_node = kzalloc(sizeof(*msg_node), GFP_ATOMIC);
   if (!msg_node) {
     pr_err("HMI: out of memory, Opal message event not handled\n");
     return -ENOMEM;
   }
-  memcpy(&msg_node->hmi_evt, hmi_evt, sizeof(struct OpalHMIEvent));
+  memcpy(&msg_node->hmi_evt, hmi_evt, sizeof(msg_node->hmi_evt));
   spin_lock_irqsave(&opal_hmi_evt_lock, flags);
   list_add(&msg_node->list, &opal_hmi_evt_list);
   spin_unlock_irqrestore(&opal_hmi_evt_lock, flags);
   schedule_work(&hmi_event_work);
   return 0;
 }<sep>@@
type T,T1;
idexpression T *e;
expression f;
@@

f(...,(T1)e,...,sizeof(
- T
+ *e
 ),...)

@@
expression e1,e2;
type T;
@@

memcpy (&e1,e2,
- sizeof(T)
+ sizeof(e1)
  )

@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,30 +1,30 @@
 static int imc_get_mem_addr_nest(struct device_node *node, struct imc_pmu *pmu_ptr, u32 offset) {
   int nr_chips = 0, i;
   u64 *base_addr_arr, baddr;
   u32 *chipid_arr;
   nr_chips = of_property_count_u32_elems(node, "chip-id");
   if (nr_chips <= 0) return -ENODEV;
-  base_addr_arr = kcalloc(nr_chips, sizeof(u64), GFP_KERNEL);
+  base_addr_arr = kcalloc(nr_chips, sizeof(*base_addr_arr), GFP_KERNEL);
   if (!base_addr_arr) return -ENOMEM;
-  chipid_arr = kcalloc(nr_chips, sizeof(u32), GFP_KERNEL);
+  chipid_arr = kcalloc(nr_chips, sizeof(*chipid_arr), GFP_KERNEL);
   if (!chipid_arr) return -ENOMEM;
   if (of_property_read_u32_array(node, "chip-id", chipid_arr, nr_chips)) goto error;
   if (of_property_read_u64_array(node, "base-addr", base_addr_arr, nr_chips)) goto error;
-  pmu_ptr->mem_info = kcalloc(nr_chips, sizeof(struct imc_mem_info), GFP_KERNEL);
+  pmu_ptr->mem_info = kcalloc(nr_chips, sizeof(*pmu_ptr->mem_info), GFP_KERNEL);
   if (!pmu_ptr->mem_info) goto error;
   for (i = 0; i < nr_chips; i++) {
     pmu_ptr->mem_info[i].id = chipid_arr[i];
     baddr = base_addr_arr[i] + offset;
     pmu_ptr->mem_info[i].vbase = phys_to_virt(baddr);
   }
   pmu_ptr->imc_counter_mmaped = true;
   export_imc_mode_and_cmd(node, pmu_ptr);
   kfree(base_addr_arr);
   kfree(chipid_arr);
   return 0;
 error:
   kfree(pmu_ptr->mem_info);
   kfree(base_addr_arr);
   kfree(chipid_arr);
   return -1;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2,y;
type T;
@@

e1 = kcalloc (y,
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,28 +1,28 @@
 static int imc_pmu_create(struct device_node *parent, int pmu_index, int domain) {
   int ret = 0;
   struct imc_pmu *pmu_ptr;
   u32 offset;
   /* memory for pmu */
-  pmu_ptr = kzalloc(sizeof(struct imc_pmu), GFP_KERNEL);
+  pmu_ptr = kzalloc(sizeof(*pmu_ptr), GFP_KERNEL);
   if (!pmu_ptr) return -ENOMEM;
   /* Set the domain */
   pmu_ptr->domain = domain;
   ret = of_property_read_u32(parent, "size", &pmu_ptr->counter_mem_size);
   if (ret) {
     ret = -EINVAL;
     goto free_pmu;
   }
   if (!of_property_read_u32(parent, "offset", &offset)) {
     if (imc_get_mem_addr_nest(parent, pmu_ptr, offset)) {
       ret = -EINVAL;
       goto free_pmu;
     }
   }
   /* Function to register IMC pmu */
   ret = init_imc_pmu(parent, pmu_ptr, pmu_index);
   if (ret) pr_err("IMC PMU %s Register failed\n", pmu_ptr->pmu.name);
   return 0;
 free_pmu:
   kfree(pmu_ptr);
   return ret;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,17 +1,17 @@
 static int opal_memory_err_event(struct notifier_block *nb, unsigned long msg_type, void *msg) {
   unsigned long flags;
   struct OpalMsgNode *msg_node;
   if (msg_type != OPAL_MSG_MEM_ERR) return 0;
   msg_node = kzalloc(sizeof(*msg_node), GFP_ATOMIC);
   if (!msg_node) {
     pr_err("MEMORY_ERROR: out of memory, Opal message event not"
            "handled\n");
     return -ENOMEM;
   }
-  memcpy(&msg_node->msg, msg, sizeof(struct opal_msg));
+  memcpy(&msg_node->msg, msg, sizeof(msg_node->msg));
   spin_lock_irqsave(&opal_mem_err_lock, flags);
   list_add(&msg_node->list, &opal_memory_err_list);
   spin_unlock_irqrestore(&opal_mem_err_lock, flags);
   schedule_work(&mem_error_work);
   return 0;
 }<sep>@@
expression e1,e2;
type T;
@@

memcpy (&e1,e2,
- sizeof(T)
+ sizeof(e1)
  )

@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,34 +1,34 @@
 void __init opal_psr_init(void) {
   struct device_node *psr, *node;
   int i = 0;
   psr = of_find_compatible_node(NULL, NULL, "ibm,opal-power-shift-ratio");
   if (!psr) {
     pr_devel("Power-shift-ratio node not found\n");
     return;
   }
-  psr_attrs = kcalloc(of_get_child_count(psr), sizeof(struct psr_attr), GFP_KERNEL);
+  psr_attrs = kcalloc(of_get_child_count(psr), sizeof(*psr_attrs), GFP_KERNEL);
   if (!psr_attrs) return;
   psr_kobj = kobject_create_and_add("psr", opal_kobj);
   if (!psr_kobj) {
     pr_warn("Failed to create psr kobject\n");
     goto out;
   }
   for_each_child_of_node(psr, node) {
     if (of_property_read_u32(node, "handle", &psr_attrs[i].handle)) goto out_kobj;
     sysfs_attr_init(&psr_attrs[i].attr.attr);
     if (of_property_read_string(node, "label", &psr_attrs[i].attr.attr.name)) goto out_kobj;
     psr_attrs[i].attr.attr.mode = 0664;
     psr_attrs[i].attr.show = psr_show;
     psr_attrs[i].attr.store = psr_store;
     if (sysfs_create_file(psr_kobj, &psr_attrs[i].attr.attr)) {
       pr_devel("Failed to create psr sysfs file %s\n", psr_attrs[i].attr.attr.name);
       goto out_kobj;
     }
     i++;
   }
   return;
 out_kobj:
   kobject_put(psr_kobj);
 out:
   kfree(psr_attrs);
 }<sep>@@
expression e1,e2,y;
type T;
@@

e1 = kcalloc (y,
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,54 +1,54 @@
 void __init opal_sensor_groups_init(void) {
   struct device_node *sg, *node;
   int i = 0;
   sg = of_find_compatible_node(NULL, NULL, "ibm,opal-sensor-group");
   if (!sg) {
     pr_devel("Sensor groups node not found\n");
     return;
   }
   sgs = kcalloc(of_get_child_count(sg), sizeof(*sgs), GFP_KERNEL);
   if (!sgs) return;
   sg_kobj = kobject_create_and_add("sensor_groups", opal_kobj);
   if (!sg_kobj) {
     pr_warn("Failed to create sensor group kobject\n");
     goto out_sgs;
   }
   for_each_child_of_node(sg, node) {
     const __be32 *ops;
     u32 sgid, len, nr_attrs, chipid;
     ops = of_get_property(node, "ops", &len);
     if (!ops) continue;
     nr_attrs = get_nr_attrs(ops, len);
     if (!nr_attrs) continue;
-    sgs[i].sgattrs = kcalloc(nr_attrs, sizeof(struct sg_attr), GFP_KERNEL);
+    sgs[i].sgattrs = kcalloc(nr_attrs, sizeof(*sgs[i].sgattrs), GFP_KERNEL);
     if (!sgs[i].sgattrs) goto out_sgs_sgattrs;
-    sgs[i].sg.attrs = kcalloc(nr_attrs + 1, sizeof(struct attribute *), GFP_KERNEL);
+    sgs[i].sg.attrs = kcalloc(nr_attrs + 1, sizeof(*sgs[i].sg.attrs), GFP_KERNEL);
     if (!sgs[i].sg.attrs) {
       kfree(sgs[i].sgattrs);
       goto out_sgs_sgattrs;
     }
     if (of_property_read_u32(node, "sensor-group-id", &sgid)) {
       pr_warn("sensor-group-id property not found\n");
       goto out_sgs_sgattrs;
     }
     if (!of_property_read_u32(node, "ibm,chip-id", &chipid))
       sprintf(sgs[i].name, "%s%d", node->name, chipid);
     else
       sprintf(sgs[i].name, "%s", node->name);
     sgs[i].sg.name = sgs[i].name;
     if (add_attr_group(ops, len, &sgs[i], sgid)) {
       pr_warn("Failed to create sensor attribute group %s\n", sgs[i].sg.name);
       goto out_sgs_sgattrs;
     }
     i++;
   }
   return;
 out_sgs_sgattrs:
   while (--i >= 0) {
     kfree(sgs[i].sgattrs);
     kfree(sgs[i].sg.attrs);
   }
   kobject_put(sg_kobj);
 out_sgs:
   kfree(sgs);
 }<sep>@@
expression e1,e2,y;
type T;
@@

e1 = kcalloc (y,
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static scom_map_t opal_scom_map(struct device_node *dev, u64 reg, u64 count) {
   struct opal_scom_map *m;
   const __be32 *gcid;
   if (!of_get_property(dev, "scom-controller", NULL)) {
     pr_err("%s: device %pOF is not a SCOM controller\n", __func__, dev);
     return SCOM_MAP_INVALID;
   }
   gcid = of_get_property(dev, "ibm,chip-id", NULL);
   if (!gcid) {
     pr_err("%s: device %pOF has no ibm,chip-id\n", __func__, dev);
     return SCOM_MAP_INVALID;
   }
-  m = kmalloc(sizeof(struct opal_scom_map), GFP_KERNEL);
+  m = kmalloc(sizeof(*m), GFP_KERNEL);
   if (!m) return NULL;
   m->chip = be32_to_cpup(gcid);
   m->addr = reg;
   return (scom_map_t)m;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kmalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,7 +1,7 @@
 static void pnv_ioda_free_pe(struct pnv_ioda_pe *pe) {
   struct pnv_phb *phb = pe->phb;
   unsigned int pe_num = pe->pe_number;
   WARN_ON(pe->pdev);
-  memset(pe, 0, sizeof(struct pnv_ioda_pe));
+  memset(pe, 0, sizeof(*pe));
   clear_bit(pe_num, phb->ioda.pe_alloc);
 }<sep>@@
type T,T1;
idexpression T *e;
expression f;
@@

f(...,(T1)e,...,sizeof(
- T
+ *e
 ),...)
--- initial
+++ final
@@ -1,37 +1,37 @@
 static int pmf_add_function_prop(struct pmf_device *dev, void *driverdata, const char *name, u32 *data, unsigned int length) {
   int count = 0;
   struct pmf_function *func = NULL;
   DBG("pmf: Adding functions for platform-do-%s\n", name);
   while (length >= 12) {
     /* Allocate a structure */
-    func = kzalloc(sizeof(struct pmf_function), GFP_KERNEL);
+    func = kzalloc(sizeof(*func), GFP_KERNEL);
     if (func == NULL) goto bail;
     kref_init(&func->ref);
     INIT_LIST_HEAD(&func->irq_clients);
     func->node = dev->node;
     func->driver_data = driverdata;
     func->name = name;
     func->phandle = data[0];
     func->flags = data[1];
     data += 2;
     length -= 8;
     func->data = data;
     func->length = length;
     func->dev = dev;
     DBG("pmf: idx %d: flags=%08x, phandle=%08x "
         " %d bytes remaining, parsing...\n",
         count + 1, func->flags, func->phandle, length);
     if (pmf_parse_one(func, NULL, NULL, NULL)) {
       kfree(func);
       goto bail;
     }
     length -= func->length;
     data = (u32 *)(((u8 *)data) + func->length);
     list_add(&func->link, &dev->functions);
     pmf_get_device(dev);
     count++;
   }
 bail:
   DBG("pmf: Added %d functions\n", count);
   return count;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,35 +1,35 @@
 int pmf_register_driver(struct device_node *np, struct pmf_handlers *handlers, void *driverdata) {
   struct pmf_device *dev;
   unsigned long flags;
   int rc = 0;
   if (handlers == NULL) return -EINVAL;
   DBG("pmf: registering driver for node %pOF\n", np);
   spin_lock_irqsave(&pmf_lock, flags);
   dev = pmf_find_device(np);
   spin_unlock_irqrestore(&pmf_lock, flags);
   if (dev != NULL) {
     DBG("pmf: already there !\n");
     pmf_put_device(dev);
     return -EBUSY;
   }
-  dev = kzalloc(sizeof(struct pmf_device), GFP_KERNEL);
+  dev = kzalloc(sizeof(*dev), GFP_KERNEL);
   if (dev == NULL) {
     DBG("pmf: no memory !\n");
     return -ENOMEM;
   }
   kref_init(&dev->ref);
   dev->node = of_node_get(np);
   dev->handlers = handlers;
   INIT_LIST_HEAD(&dev->functions);
   rc = pmf_add_functions(dev, driverdata);
   if (rc == 0) {
     DBG("pmf: no functions, disposing.. \n");
     of_node_put(np);
     kfree(dev);
     return -ENODEV;
   }
   spin_lock_irqsave(&pmf_lock, flags);
   list_add(&dev->link, &pmf_devices);
   spin_unlock_irqrestore(&pmf_lock, flags);
   return 0;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,32 +1,32 @@
 int __init spiderpci_iowa_init(struct iowa_bus *bus, void *data) {
   void __iomem *regs = NULL;
   struct spiderpci_iowa_private *priv;
   struct device_node *np = bus->phb->dn;
   struct resource r;
   unsigned long offset = (unsigned long)data;
   pr_debug("SPIDERPCI-IOWA:Bus initialize for spider(%pOF)\n", np);
-  priv = kzalloc(sizeof(struct spiderpci_iowa_private), GFP_KERNEL);
+  priv = kzalloc(sizeof(*priv), GFP_KERNEL);
   if (!priv) {
     pr_err("SPIDERPCI-IOWA:"
            "Can't allocate struct spiderpci_iowa_private");
     return -1;
   }
   if (of_address_to_resource(np, 0, &r)) {
     pr_err("SPIDERPCI-IOWA:Can't get resource.\n");
     goto error;
   }
   regs = ioremap(r.start + offset, SPIDER_PCI_REG_SIZE);
   if (!regs) {
     pr_err("SPIDERPCI-IOWA:ioremap failed.\n");
     goto error;
   }
   priv->regs = regs;
   bus->private = priv;
   if (spiderpci_pci_setup_chip(bus->phb, regs)) goto error;
   return 0;
 error:
   kfree(priv);
   bus->private = NULL;
   if (regs) iounmap(regs);
   return -1;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,55 +1,55 @@
 static int prepare_cached_spu_info(struct spu *spu, unsigned long objectId) {
   unsigned long flags;
   struct vma_to_fileoffset_map *new_map;
   int retval = 0;
   struct cached_info *info;
   /* We won't bother getting cache_lock here since
    * don't do anything with the cached_info that's returned.
    */
   info = get_cached_info(spu, spu->number);
   if (info) {
     pr_debug("Found cached SPU info.\n");
     goto out;
   }
   /* Create cached_info and set spu_info[spu->number] to point to it.
    * spu->number is a system-wide value, not a per-node value.
    */
-  info = kzalloc(sizeof(struct cached_info), GFP_KERNEL);
+  info = kzalloc(sizeof(*info), GFP_KERNEL);
   if (!info) {
     printk(KERN_ERR "SPU_PROF: "
                     "%s, line %d: create vma_map failed\n",
            __func__, __LINE__);
     retval = -ENOMEM;
     goto err_alloc;
   }
   new_map = create_vma_map(spu, objectId);
   if (!new_map) {
     printk(KERN_ERR "SPU_PROF: "
                     "%s, line %d: create vma_map failed\n",
            __func__, __LINE__);
     retval = -ENOMEM;
     goto err_alloc;
   }
   pr_debug("Created vma_map\n");
   info->map = new_map;
   info->the_spu = spu;
   kref_init(&info->cache_ref);
   spin_lock_irqsave(&cache_lock, flags);
   spu_info[spu->number] = info;
   /* Increment count before passing off ref to SPUFS. */
   kref_get(&info->cache_ref);
   /* We increment the module refcount here since SPUFS is
    * responsible for the final destruction of the cached_info,
    * and it must be able to access the destroy_cached_info()
    * function defined in the OProfile module.  We decrement
    * the module refcount in destroy_cached_info.
    */
   try_module_get(THIS_MODULE);
   spu_set_profile_private_kref(spu->ctx, &info->cache_ref, destroy_cached_info);
   spin_unlock_irqrestore(&cache_lock, flags);
   goto out;
 err_alloc:
   kfree(info);
 out:
   return retval;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,15 +1,15 @@
 static struct vma_to_fileoffset_map *vma_map_add(struct vma_to_fileoffset_map *map, unsigned int vma, unsigned int size, unsigned int offset, unsigned int guard_ptr, unsigned int guard_val) {
-  struct vma_to_fileoffset_map *new = kzalloc(sizeof(struct vma_to_fileoffset_map), GFP_KERNEL);
+  struct vma_to_fileoffset_map *new = kzalloc(sizeof(*new), GFP_KERNEL);
   if (!new) {
     printk(KERN_ERR "SPU_PROF: %s, line %d: malloc failed\n", __func__, __LINE__);
     vma_map_free(map);
     return NULL;
   }
   new->next = map;
   new->vma = vma;
   new->size = size;
   new->offset = offset;
   new->guard_ptr = guard_ptr;
   new->guard_val = guard_val;
   return new;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,6 +1,6 @@
 static void parport_ax88796_init_state(struct pardevice *d, struct parport_state *s) {
   struct ax_drvdata *dd = pp_to_drv(d->port);
-  memset(s, 0, sizeof(struct parport_state));
+  memset(s, 0, sizeof(*s));
   dev_dbg(dd->dev, "init_state: %p: state=%p\n", d, s);
   s->u.ax88796.cpr = readb(dd->spp_cpr);
 }<sep>@@
type T,T1;
idexpression T *e;
expression f;
@@

f(...,(T1)e,...,sizeof(
- T
+ *e
 ),...)
--- initial
+++ final
@@ -1,67 +1,67 @@
 static int parport_ax88796_probe(struct platform_device *pdev) {
   struct device *_dev = &pdev->dev;
   struct ax_drvdata *dd;
   struct parport *pp = NULL;
   struct resource *res;
   unsigned long size;
   int spacing;
   int irq;
   int ret;
-  dd = kzalloc(sizeof(struct ax_drvdata), GFP_KERNEL);
+  dd = kzalloc(sizeof(*dd), GFP_KERNEL);
   if (!dd) return -ENOMEM;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (res == NULL) {
     dev_err(_dev, "no MEM specified\n");
     ret = -ENXIO;
     goto exit_mem;
   }
   size = resource_size(res);
   spacing = size / 3;
   dd->io = request_mem_region(res->start, size, pdev->name);
   if (dd->io == NULL) {
     dev_err(_dev, "cannot reserve memory\n");
     ret = -ENXIO;
     goto exit_mem;
   }
   dd->base = ioremap(res->start, size);
   if (dd->base == NULL) {
     dev_err(_dev, "cannot ioremap region\n");
     ret = -ENXIO;
     goto exit_res;
   }
   irq = platform_get_irq(pdev, 0);
   if (irq <= 0) irq = PARPORT_IRQ_NONE;
   pp = parport_register_port((unsigned long)dd->base, irq, PARPORT_DMA_NONE, &parport_ax88796_ops);
   if (pp == NULL) {
     dev_err(_dev, "failed to register parallel port\n");
     ret = -ENOMEM;
     goto exit_unmap;
   }
   pp->private_data = dd;
   dd->parport = pp;
   dd->dev = _dev;
   dd->spp_data = dd->base;
   dd->spp_spr = dd->base + (spacing * 1);
   dd->spp_cpr = dd->base + (spacing * 2);
   /* initialise the port controls */
   writeb(AX_CPR_STRB, dd->spp_cpr);
   if (irq >= 0) {
     /* request irq */
     ret = request_irq(irq, parport_irq_handler, IRQF_TRIGGER_FALLING, pdev->name, pp);
     if (ret < 0) goto exit_port;
     dd->irq_enabled = 1;
   }
   platform_set_drvdata(pdev, pp);
   dev_info(_dev, "attached parallel port driver\n");
   parport_announce_port(pp);
   return 0;
 exit_port:
   parport_remove_port(pp);
 exit_unmap:
   iounmap(dd->base);
 exit_res:
   release_mem_region(dd->io->start, size);
 exit_mem:
   kfree(dd);
   return ret;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,42 +1,42 @@
 static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id) {
   struct clcd_board *board = dev_get_platdata(&dev->dev);
   struct clcd_vendor_data *vendor = id->data;
   struct clcd_fb *fb;
   int ret;
   if (!board) board = clcdfb_of_get_board(dev);
   if (!board) return -EINVAL;
   if (vendor->init_board) {
     ret = vendor->init_board(dev, board);
     if (ret) return ret;
   }
   ret = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
   if (ret) goto out;
   ret = amba_request_regions(dev, NULL);
   if (ret) {
     printk(KERN_ERR "CLCD: unable to reserve regs region\n");
     goto out;
   }
-  fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL);
+  fb = kzalloc(sizeof(*fb), GFP_KERNEL);
   if (!fb) {
     ret = -ENOMEM;
     goto free_region;
   }
   fb->dev = dev;
   fb->vendor = vendor;
   fb->board = board;
   dev_info(&fb->dev->dev, "PL%03x designer %02x rev%u at 0x%08llx\n", amba_part(dev), amba_manf(dev), amba_rev(dev), (unsigned long long)dev->res.start);
   ret = fb->board->setup(fb);
   if (ret) goto free_fb;
   ret = clcdfb_register(fb);
   if (ret == 0) {
     amba_set_drvdata(dev, fb);
     goto out;
   }
   fb->board->remove(fb);
 free_fb:
   kfree(fb);
 free_region:
   amba_release_regions(dev);
 out:
   return ret;
 }<sep>@@
type T;
idexpression T *e;
identifier f;
@@

e = f(...,sizeof(
- T
+ *e
 ),...)



@@
expression e1,e2;
type T;
@@

e1 = kzalloc (
- sizeof(T)
+ sizeof(*e1)
  ,e2)
--- initial
+++ final
@@ -1,38 +1,38 @@
 static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx, u64 *mmap_time) {
   struct perf_evlist *evlist = kvm->evlist;
   union perf_event *event;
   struct perf_mmap *md;
   u64 end, start;
   u64 timestamp;
   s64 n = 0;
   int err;
   *mmap_time = ULLONG_MAX;
   md = &evlist->mmap[idx];
   err = perf_mmap__read_init(md, false, &start, &end);
   if (err < 0) return (err == -EAGAIN) ? 0 : -1;
   while ((event = perf_mmap__read_event(md, false, &start, end)) != NULL) {
     err = perf_evlist__parse_sample_timestamp(evlist, event, &timestamp);
     if (err) {
-      perf_mmap__consume(md, false);
+      perf_mmap__consume(md);
       pr_err("Failed to parse sample\n");
       return -1;
     }
     err = perf_session__queue_event(kvm->session, event, timestamp, 0);
     /*
      * FIXME: Here we can't consume the event, as perf_session__queue_event will
      *        point to it, and it'll get possibly overwritten by the kernel.
      */
-    perf_mmap__consume(md, false);
+    perf_mmap__consume(md);
     if (err) {
       pr_err("Failed to enqueue sample: %d\n", err);
       return -1;
     }
     /* save time stamp of our first sample for this mmap */
     if (n == 0) *mmap_time = timestamp;
     /* limit events per mmap handled all at once */
     n++;
     if (n == PERF_KVM__MAX_EVENTS_PER_MMAP) break;
   }
   perf_mmap__read_done(md);
   return n;
 }<sep>@@
expression md,e;
@@
-               perf_mmap__consume(md, e);
+               perf_mmap__consume(md);