imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,53 +1,47 @@
 static int lis3l02dq_probe(struct spi_device *spi) {
   int ret;
   struct lis3l02dq_state *st;
   struct iio_dev *indio_dev;
-  indio_dev = iio_device_alloc(sizeof *st);
-  if (indio_dev == NULL) {
-    ret = -ENOMEM;
-    goto error_ret;
-  }
+  indio_dev = devm_iio_device_alloc(dev, sizeof *st);
+  if (indio_dev == NULL) return -ENOMEM;
   st = iio_priv(indio_dev);
   /* this is only used for removal purposes */
   spi_set_drvdata(spi, indio_dev);
   st->us = spi;
   st->gpio = of_get_gpio(spi->dev.of_node, 0);
   mutex_init(&st->buf_lock);
   indio_dev->name = spi->dev.driver->name;
   indio_dev->dev.parent = &spi->dev;
   indio_dev->info = &lis3l02dq_info;
   indio_dev->channels = lis3l02dq_channels;
   indio_dev->num_channels = ARRAY_SIZE(lis3l02dq_channels);
   indio_dev->modes = INDIO_DIRECT_MODE;
   ret = lis3l02dq_configure_buffer(indio_dev);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   ret = iio_buffer_register(indio_dev, lis3l02dq_channels, ARRAY_SIZE(lis3l02dq_channels));
   if (ret) {
     printk(KERN_ERR "failed to initialize the buffer\n");
     goto error_unreg_buffer_funcs;
   }
   if (spi->irq) {
     ret = request_threaded_irq(st->us->irq, &lis3l02dq_th, &lis3l02dq_event_handler, IRQF_TRIGGER_RISING, "lis3l02dq", indio_dev);
     if (ret) goto error_uninitialize_buffer;
     ret = lis3l02dq_probe_trigger(indio_dev);
     if (ret) goto error_free_interrupt;
   }
   /* Get the device into a sane initial state */
   ret = lis3l02dq_initial_setup(indio_dev);
   if (ret) goto error_remove_trigger;
   ret = iio_device_register(indio_dev);
   if (ret) goto error_remove_trigger;
   return 0;
 error_remove_trigger:
   if (spi->irq) lis3l02dq_remove_trigger(indio_dev);
 error_free_interrupt:
   if (spi->irq) free_irq(st->us->irq, indio_dev);
 error_uninitialize_buffer:
   iio_buffer_unregister(indio_dev);
 error_unreg_buffer_funcs:
   lis3l02dq_unconfigure_buffer(indio_dev);
-error_free_dev:
-  iio_device_free(indio_dev);
-error_ret:
   return ret;
 }<sep>@@
expression e,e1,e2,ret;
identifier l1,l2,x,f;
type T;
@@
f(T x) {
	... when != l2
(
-       e = iio_device_alloc(e1);
+       e = devm_iio_device_alloc(dev, e1);
        if (e == NULL)
(
-	{
-               ret = e2;
-               goto l2;
+               return e2;
-       }
|
	{
		...
-               ret = e2;
		...
-               goto l2;
+               return e2;
       }
)
<...
-	goto l1;
+	return ret;
...>
&
e = iio_device_alloc(e1);
... when exists
-l1:
-       iio_device_free(e);
-l2:
        return ret;
)
}
--- initial
+++ final
@@ -1,36 +1,30 @@
 static int adis16203_probe(struct spi_device *spi) {
   int ret;
   struct iio_dev *indio_dev;
   struct adis *st;
   /* setup the industrialio driver allocated elements */
-  indio_dev = iio_device_alloc(sizeof(*st));
-  if (indio_dev == NULL) {
-    ret = -ENOMEM;
-    goto error_ret;
-  }
+  indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
+  if (indio_dev == NULL) return -ENOMEM;
   st = iio_priv(indio_dev);
   /* this is only used for removal purposes */
   spi_set_drvdata(spi, indio_dev);
   indio_dev->name = spi->dev.driver->name;
   indio_dev->dev.parent = &spi->dev;
   indio_dev->channels = adis16203_channels;
   indio_dev->num_channels = ARRAY_SIZE(adis16203_channels);
   indio_dev->info = &adis16203_info;
   indio_dev->modes = INDIO_DIRECT_MODE;
   ret = adis_init(st, indio_dev, spi, &adis16203_data);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   ret = adis_setup_buffer_and_trigger(st, indio_dev, NULL);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   /* Get the device into a sane initial state */
   ret = adis_initial_startup(st);
   if (ret) goto error_cleanup_buffer_trigger;
   ret = iio_device_register(indio_dev);
   if (ret) goto error_cleanup_buffer_trigger;
   return 0;
 error_cleanup_buffer_trigger:
   adis_cleanup_buffer_and_trigger(st, indio_dev);
-error_free_dev:
-  iio_device_free(indio_dev);
-error_ret:
   return ret;
 }<sep>@@
expression e,e1,e2,ret;
identifier l1,l2,x,f;
type T;
@@
f(T x) {
	... when != l2
(
-       e = iio_device_alloc(e1);
+       e = devm_iio_device_alloc(dev, e1);
        if (e == NULL)
(
-	{
-               ret = e2;
-               goto l2;
+               return e2;
-       }
|
	{
		...
-               ret = e2;
		...
-               goto l2;
+               return e2;
       }
)
<...
-	goto l1;
+	return ret;
...>
&
e = iio_device_alloc(e1);
... when exists
-l1:
-       iio_device_free(e);
-l2:
        return ret;
)
}
--- initial
+++ final
@@ -1,36 +1,30 @@
 static int adis16209_probe(struct spi_device *spi) {
   int ret;
   struct adis *st;
   struct iio_dev *indio_dev;
   /* setup the industrialio driver allocated elements */
-  indio_dev = iio_device_alloc(sizeof(*st));
-  if (indio_dev == NULL) {
-    ret = -ENOMEM;
-    goto error_ret;
-  }
+  indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
+  if (indio_dev == NULL) return -ENOMEM;
   st = iio_priv(indio_dev);
   /* this is only used for removal purposes */
   spi_set_drvdata(spi, indio_dev);
   indio_dev->name = spi->dev.driver->name;
   indio_dev->dev.parent = &spi->dev;
   indio_dev->info = &adis16209_info;
   indio_dev->channels = adis16209_channels;
   indio_dev->num_channels = ARRAY_SIZE(adis16209_channels);
   indio_dev->modes = INDIO_DIRECT_MODE;
   ret = adis_init(st, indio_dev, spi, &adis16209_data);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   ret = adis_setup_buffer_and_trigger(st, indio_dev, NULL);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   /* Get the device into a sane initial state */
   ret = adis_initial_startup(st);
   if (ret) goto error_cleanup_buffer_trigger;
   ret = iio_device_register(indio_dev);
   if (ret) goto error_cleanup_buffer_trigger;
   return 0;
 error_cleanup_buffer_trigger:
   adis_cleanup_buffer_and_trigger(st, indio_dev);
-error_free_dev:
-  iio_device_free(indio_dev);
-error_ret:
   return ret;
 }<sep>@@
expression e,e1,e2,ret;
identifier l1,l2,x,f;
type T;
@@
f(T x) {
	... when != l2
(
-       e = iio_device_alloc(e1);
+       e = devm_iio_device_alloc(dev, e1);
        if (e == NULL)
(
-	{
-               ret = e2;
-               goto l2;
+               return e2;
-       }
|
	{
		...
-               ret = e2;
		...
-               goto l2;
+               return e2;
       }
)
<...
-	goto l1;
+	return ret;
...>
&
e = iio_device_alloc(e1);
... when exists
-l1:
-       iio_device_free(e);
-l2:
        return ret;
)
}
--- initial
+++ final
@@ -1,36 +1,30 @@
 static int adis16204_probe(struct spi_device *spi) {
   int ret;
   struct adis *st;
   struct iio_dev *indio_dev;
   /* setup the industrialio driver allocated elements */
-  indio_dev = iio_device_alloc(sizeof(*st));
-  if (indio_dev == NULL) {
-    ret = -ENOMEM;
-    goto error_ret;
-  }
+  indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
+  if (indio_dev == NULL) return -ENOMEM;
   st = iio_priv(indio_dev);
   /* this is only used for removal purposes */
   spi_set_drvdata(spi, indio_dev);
   indio_dev->name = spi->dev.driver->name;
   indio_dev->dev.parent = &spi->dev;
   indio_dev->info = &adis16204_info;
   indio_dev->channels = adis16204_channels;
   indio_dev->num_channels = ARRAY_SIZE(adis16204_channels);
   indio_dev->modes = INDIO_DIRECT_MODE;
   ret = adis_init(st, indio_dev, spi, &adis16204_data);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   ret = adis_setup_buffer_and_trigger(st, indio_dev, NULL);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   /* Get the device into a sane initial state */
   ret = adis_initial_startup(st);
   if (ret) goto error_cleanup_buffer_trigger;
   ret = iio_device_register(indio_dev);
   if (ret) goto error_cleanup_buffer_trigger;
   return 0;
 error_cleanup_buffer_trigger:
   adis_cleanup_buffer_and_trigger(st, indio_dev);
-error_free_dev:
-  iio_device_free(indio_dev);
-error_ret:
   return ret;
 }<sep>@@
expression e,e1,e2,ret;
identifier l1,l2,x,f;
type T;
@@
f(T x) {
	... when != l2
(
-       e = iio_device_alloc(e1);
+       e = devm_iio_device_alloc(dev, e1);
        if (e == NULL)
(
-	{
-               ret = e2;
-               goto l2;
+               return e2;
-       }
|
	{
		...
-               ret = e2;
		...
-               goto l2;
+               return e2;
       }
)
<...
-	goto l1;
+	return ret;
...>
&
e = iio_device_alloc(e1);
... when exists
-l1:
-       iio_device_free(e);
-l2:
        return ret;
)
}
--- initial
+++ final
@@ -1,36 +1,30 @@
 static int adis16240_probe(struct spi_device *spi) {
   int ret;
   struct adis *st;
   struct iio_dev *indio_dev;
   /* setup the industrialio driver allocated elements */
-  indio_dev = iio_device_alloc(sizeof(*st));
-  if (indio_dev == NULL) {
-    ret = -ENOMEM;
-    goto error_ret;
-  }
+  indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
+  if (indio_dev == NULL) return -ENOMEM;
   st = iio_priv(indio_dev);
   /* this is only used for removal purposes */
   spi_set_drvdata(spi, indio_dev);
   indio_dev->name = spi->dev.driver->name;
   indio_dev->dev.parent = &spi->dev;
   indio_dev->info = &adis16240_info;
   indio_dev->channels = adis16240_channels;
   indio_dev->num_channels = ARRAY_SIZE(adis16240_channels);
   indio_dev->modes = INDIO_DIRECT_MODE;
   ret = adis_init(st, indio_dev, spi, &adis16240_data);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   ret = adis_setup_buffer_and_trigger(st, indio_dev, NULL);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   /* Get the device into a sane initial state */
   ret = adis_initial_startup(st);
   if (ret) goto error_cleanup_buffer_trigger;
   ret = iio_device_register(indio_dev);
   if (ret) goto error_cleanup_buffer_trigger;
   return 0;
 error_cleanup_buffer_trigger:
   adis_cleanup_buffer_and_trigger(st, indio_dev);
-error_free_dev:
-  iio_device_free(indio_dev);
-error_ret:
   return ret;
 }<sep>@@
expression e,e1,e2,ret;
identifier l1,l2,x,f;
type T;
@@
f(T x) {
	... when != l2
(
-       e = iio_device_alloc(e1);
+       e = devm_iio_device_alloc(dev, e1);
        if (e == NULL)
(
-	{
-               ret = e2;
-               goto l2;
+               return e2;
-       }
|
	{
		...
-               ret = e2;
		...
-               goto l2;
+               return e2;
       }
)
<...
-	goto l1;
+	return ret;
...>
&
e = iio_device_alloc(e1);
... when exists
-l1:
-       iio_device_free(e);
-l2:
        return ret;
)
}
--- initial
+++ final
@@ -1,36 +1,30 @@
 static int adis16201_probe(struct spi_device *spi) {
   int ret;
   struct adis *st;
   struct iio_dev *indio_dev;
   /* setup the industrialio driver allocated elements */
-  indio_dev = iio_device_alloc(sizeof(*st));
-  if (indio_dev == NULL) {
-    ret = -ENOMEM;
-    goto error_ret;
-  }
+  indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
+  if (indio_dev == NULL) return -ENOMEM;
   st = iio_priv(indio_dev);
   /* this is only used for removal purposes */
   spi_set_drvdata(spi, indio_dev);
   indio_dev->name = spi->dev.driver->name;
   indio_dev->dev.parent = &spi->dev;
   indio_dev->info = &adis16201_info;
   indio_dev->channels = adis16201_channels;
   indio_dev->num_channels = ARRAY_SIZE(adis16201_channels);
   indio_dev->modes = INDIO_DIRECT_MODE;
   ret = adis_init(st, indio_dev, spi, &adis16201_data);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   ret = adis_setup_buffer_and_trigger(st, indio_dev, NULL);
-  if (ret) goto error_free_dev;
+  if (ret) return ret;
   /* Get the device into a sane initial state */
   ret = adis_initial_startup(st);
   if (ret) goto error_cleanup_buffer_trigger;
   ret = iio_device_register(indio_dev);
   if (ret < 0) goto error_cleanup_buffer_trigger;
   return 0;
 error_cleanup_buffer_trigger:
   adis_cleanup_buffer_and_trigger(st, indio_dev);
-error_free_dev:
-  iio_device_free(indio_dev);
-error_ret:
   return ret;
 }<sep>@@
expression e,e1,e2,ret;
identifier l1,l2,x,f;
type T;
@@
f(T x) {
	... when != l2
(
-       e = iio_device_alloc(e1);
+       e = devm_iio_device_alloc(dev, e1);
        if (e == NULL)
(
-	{
-               ret = e2;
-               goto l2;
+               return e2;
-       }
|
	{
		...
-               ret = e2;
		...
-               goto l2;
+               return e2;
       }
)
<...
-	goto l1;
+	return ret;
...>
&
e = iio_device_alloc(e1);
... when exists
-l1:
-       iio_device_free(e);
-l2:
        return ret;
)
}
--- initial
+++ final
@@ -1,47 +1,45 @@
 int au0828_dvb_register(struct au0828_dev *dev) {
   struct au0828_dvb *dvb = &dev->dvb;
   int ret;
   dprintk(1, "%s()\n", __func__);
   /* init frontend */
   switch (dev->boardnr) {
   case AU0828_BOARD_HAUPPAUGE_HVR850:
   case AU0828_BOARD_HAUPPAUGE_HVR950Q:
     dvb->frontend = dvb_attach(au8522_attach, &hauppauge_hvr950q_config, &dev->i2c_adap);
     if (dvb->frontend != NULL) switch (dev->board.tuner_type) {
       default:
       case TUNER_XC5000: dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &hauppauge_xc5000a_config); break;
       case TUNER_XC5000C: dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &hauppauge_xc5000c_config); break;
       }
     break;
   case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL:
     dvb->frontend = dvb_attach(au8522_attach, &hauppauge_hvr950q_config, &dev->i2c_adap);
     if (dvb->frontend != NULL) dvb_attach(mxl5007t_attach, dvb->frontend, &dev->i2c_adap, 0x60, &mxl5007t_hvr950q_config);
     break;
   case AU0828_BOARD_HAUPPAUGE_WOODBURY:
     dvb->frontend = dvb_attach(au8522_attach, &hauppauge_woodbury_config, &dev->i2c_adap);
     if (dvb->frontend != NULL) dvb_attach(tda18271_attach, dvb->frontend, 0x60, &dev->i2c_adap, &hauppauge_woodbury_tunerconfig);
     break;
   case AU0828_BOARD_DVICO_FUSIONHDTV7:
     dvb->frontend = dvb_attach(au8522_attach, &fusionhdtv7usb_config, &dev->i2c_adap);
     if (dvb->frontend != NULL) { dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &hauppauge_xc5000a_config); }
     break;
   default: pr_warn("The frontend of your DVB/ATSC card isn't supported yet\n"); break;
   }
   if (NULL == dvb->frontend) {
     pr_err("%s() Frontend initialization failed\n", __func__);
     return -1;
   }
   /* define general-purpose callback pointer */
   dvb->frontend->callback = au0828_tuner_callback;
   /* register everything */
   ret = dvb_register(dev);
   if (ret < 0) {
     if (dvb->frontend->ops.release) dvb->frontend->ops.release(dvb->frontend);
     dvb->frontend = NULL;
     return ret;
   }
-  dev->bulk_timeout.function = au0828_bulk_timeout;
-  dev->bulk_timeout.data = (unsigned long)dev;
-  init_timer(&dev->bulk_timeout);
+  setup_timer(&dev->bulk_timeout, au0828_bulk_timeout, (unsigned long)dev);
   return 0;
 }<sep>@@
expression t,d,f,e1,e2,e3;
@@

-               t.function = f;
... when != f = e3
-               t.data = d;
... when != d = e1
    when != f = e2
-               init_timer(&t);
+               setup_timer(&t,f,d);
--- initial
+++ final
@@ -1,8 +1,7 @@
 static inline void clocksource_start_watchdog(void) {
   if (watchdog_running || !watchdog || list_empty(&watchdog_list)) return;
-  init_timer(&watchdog_timer);
-  watchdog_timer.function = clocksource_watchdog;
+  setup_timer(&watchdog_timer, clocksource_watchdog, 0UL);
   watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL;
   add_timer_on(&watchdog_timer, cpumask_first(cpu_online_mask));
   watchdog_running = 1;
 }<sep>@@
expression t,d,f,e3;
@@

-               init_timer(&t);
+               setup_timer(&t,f,0UL);
... when != f = e3
-               t.function = f;
--- initial
+++ final
@@ -1,9 +1,7 @@
 void fsm_settimer(fsm_instance *fi, fsm_timer *this) {
   this->fi = fi;
-  this->tl.function = (void *)fsm_expire_timer;
-  this->tl.data = (long)this;
 #if FSM_TIMER_DEBUG
   printk(KERN_DEBUG "fsm(%s): Create timer %p\n", fi->name, this);
 #endif
-  init_timer(&this->tl);
+  setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this);
 }<sep>@@
expression t,d,f,e1,e2,e3;
@@

-               t.function = f;
... when != f = e3
-               t.data = d;
... when != d = e1
    when != f = e2
-               init_timer(&t);
+               setup_timer(&t,f,d);
--- initial
+++ final
@@ -1,61 +1,60 @@
 static int __init isdn_init(void) {
   int i;
   char tmprev[50];
   dev = vzalloc(sizeof(isdn_dev));
   if (!dev) {
     printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
     return -EIO;
   }
-  init_timer(&dev->timer);
-  dev->timer.function = isdn_timer_funct;
+  setup_timer(&dev->timer, isdn_timer_funct, 0UL);
   spin_lock_init(&dev->lock);
   spin_lock_init(&dev->timerlock);
 #ifdef MODULE
   dev->owner = THIS_MODULE;
 #endif
   mutex_init(&dev->mtx);
   init_waitqueue_head(&dev->info_waitq);
   for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
     dev->drvmap[i] = -1;
     dev->chanmap[i] = -1;
     dev->m_idx[i] = -1;
     strcpy(dev->num[i], "???");
   }
   if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) {
     printk(KERN_WARNING "isdn: Could not register control devices\n");
     vfree(dev);
     return -EIO;
   }
   if ((isdn_tty_modem_init()) < 0) {
     printk(KERN_WARNING "isdn: Could not register tty devices\n");
     vfree(dev);
     unregister_chrdev(ISDN_MAJOR, "isdn");
     return -EIO;
   }
 #ifdef CONFIG_ISDN_PPP
   if (isdn_ppp_init() < 0) {
     printk(KERN_WARNING "isdn: Could not create PPP-device-structs\n");
     isdn_tty_exit();
     unregister_chrdev(ISDN_MAJOR, "isdn");
     vfree(dev);
     return -EIO;
   }
 #endif /* CONFIG_ISDN_PPP */
   strcpy(tmprev, isdn_revision);
   printk(KERN_NOTICE "ISDN subsystem Rev: %s/", isdn_getrev(tmprev));
   strcpy(tmprev, isdn_net_revision);
   printk("%s/", isdn_getrev(tmprev));
   strcpy(tmprev, isdn_ppp_revision);
   printk("%s/", isdn_getrev(tmprev));
   strcpy(tmprev, isdn_audio_revision);
   printk("%s/", isdn_getrev(tmprev));
   strcpy(tmprev, isdn_v110_revision);
   printk("%s", isdn_getrev(tmprev));
 #ifdef MODULE
   printk(" loaded\n");
 #else
   printk("\n");
 #endif
   isdn_info_update();
   return 0;
 }<sep>@@
expression t,d,f,e3;
@@

-               init_timer(&t);
+               setup_timer(&t,f,0UL);
... when != f = e3
-               t.function = f;
--- initial
+++ final
@@ -1,19 +1,18 @@
 static int __init n2100_request_gpios(void) {
   int ret;
   if (!machine_is_n2100()) return 0;
   ret = gpio_request(N2100_HARDWARE_RESET, "reset");
   if (ret) pr_err("could not request reset GPIO\n");
   ret = gpio_request(N2100_POWER_BUTTON, "power");
   if (ret)
     pr_err("could not request power GPIO\n");
   else {
     ret = gpio_direction_input(N2100_POWER_BUTTON);
     if (ret) pr_err("could not set power GPIO as input\n");
   }
   /* Set up power button poll timer */
-  init_timer(&power_button_poll_timer);
-  power_button_poll_timer.function = power_button_poll;
+  setup_timer(&power_button_poll_timer, power_button_poll, 0UL);
   power_button_poll_timer.expires = jiffies + (HZ / 10);
   add_timer(&power_button_poll_timer);
   return 0;
 }<sep>@@
expression t,d,f,e3;
@@

-               init_timer(&t);
+               setup_timer(&t,f,0UL);
... when != f = e3
-               t.function = f;
--- initial
+++ final
@@ -1,11 +1,10 @@
 static int __init init_nmi_wdt(void) {
   nmi_wdt_set_timeout(timeout);
   nmi_wdt_start();
   nmi_active = true;
-  init_timer(&ntimer);
-  ntimer.function = nmi_wdt_timer;
+  setup_timer(&ntimer, nmi_wdt_timer, 0UL);
   ntimer.expires = jiffies + NMI_CHECK_TIMEOUT;
   add_timer(&ntimer);
   pr_info("nmi_wdt: initialized: timeout=%d sec\n", timeout);
   return 0;
 }<sep>@@
expression t,d,f,e3;
@@

-               init_timer(&t);
+               setup_timer(&t,f,0UL);
... when != f = e3
-               t.function = f;
--- initial
+++ final
@@ -1,6 +1,5 @@
 static void init_battery_timer(void) {
-  init_timer(&battery_timer);
-  battery_timer.function = check_all_batteries;
+  setup_timer(&battery_timer, check_all_batteries, 0UL);
   battery_timer.expires = jiffies + (HZ * 60);
   add_timer(&battery_timer);
 }<sep>@@
expression t,d,f,e3;
@@

-               init_timer(&t);
+               setup_timer(&t,f,0UL);
... when != f = e3
-               t.function = f;
--- initial
+++ final
@@ -1,6 +1 @@
-static void fq_free(void *addr) {
-  if (addr && is_vmalloc_addr(addr))
-    vfree(addr);
-  else
-    kfree(addr);
-}
+static void fq_free(void *addr) { kvfree(addr); }<sep>@@
expression e;
@@

-       if (e != NULL && is_vmalloc_addr(e))
-               vfree(e);
-       else
-               kfree(e);
+       kvfree(e);
--- initial
+++ final
@@ -1,29 +1,26 @@
 static int mlx4_buddy_init(struct mlx4_buddy *buddy, int max_order) {
   int i, s;
   buddy->max_order = max_order;
   spin_lock_init(&buddy->lock);
   buddy->bits = kcalloc(buddy->max_order + 1, sizeof(long *), GFP_KERNEL);
   buddy->num_free = kcalloc((buddy->max_order + 1), sizeof *buddy->num_free, GFP_KERNEL);
   if (!buddy->bits || !buddy->num_free) goto err_out;
   for (i = 0; i <= buddy->max_order; ++i) {
     s = BITS_TO_LONGS(1 << (buddy->max_order - i));
     buddy->bits[i] = kcalloc(s, sizeof(long), GFP_KERNEL | __GFP_NOWARN);
     if (!buddy->bits[i]) {
       buddy->bits[i] = vzalloc(s * sizeof(long));
       if (!buddy->bits[i]) goto err_out_free;
     }
   }
   set_bit(0, buddy->bits[buddy->max_order]);
   buddy->num_free[buddy->max_order] = 1;
   return 0;
 err_out_free:
   for (i = 0; i <= buddy->max_order; ++i)
-    if (buddy->bits[i] && is_vmalloc_addr(buddy->bits[i]))
-      vfree(buddy->bits[i]);
-    else
-      kfree(buddy->bits[i]);
+    kvfree(buddy->bits[i]);
 err_out:
   kfree(buddy->bits);
   kfree(buddy->num_free);
   return -ENOMEM;
 }<sep>@@
expression e;
@@

-       if (e != NULL && is_vmalloc_addr(e))
-               vfree(e);
-       else
-               kfree(e);
+       kvfree(e);
--- initial
+++ final
@@ -1,15 +1,12 @@
 void nvdimm_drvdata_release(struct kref *kref) {
   struct nvdimm_drvdata *ndd = container_of(kref, typeof(*ndd), kref);
   struct device *dev = ndd->dev;
   struct resource *res, *_r;
   dev_dbg(dev, "%s\n", __func__);
   nvdimm_bus_lock(dev);
   for_each_dpa_resource_safe(ndd, res, _r) nvdimm_free_dpa(ndd, res);
   nvdimm_bus_unlock(dev);
-  if (ndd->data && is_vmalloc_addr(ndd->data))
-    vfree(ndd->data);
-  else
-    kfree(ndd->data);
+  kvfree(ndd->data);
   kfree(ndd);
   put_device(dev);
 }<sep>@@
expression e;
@@

-       if (e != NULL && is_vmalloc_addr(e))
-               vfree(e);
-       else
-               kfree(e);
+       kvfree(e);
--- initial
+++ final
@@ -1,7 +1,7 @@
 static int __init fid_init(void) {
   int rc;
   rc = libcfs_setup();
   if (rc) return rc;
-  seq_debugfs_dir = ldebugfs_register(LUSTRE_SEQ_NAME, debugfs_lustre_root, NULL, NULL);
-  return PTR_ERR_OR_ZERO(seq_debugfs_dir);
+  seq_debugfs_dir = debugfs_create_dir(LUSTRE_SEQ_NAME, debugfs_lustre_root);
+  return 0;
 }<sep>@@
expression e,e1,e2,e3;
@@

e =
- ldebugfs_register
+ debugfs_create_dir
     (e1,e2
-     ,NULL,e3
     )
;
-return PTR_ERR_OR_ZERO(e);
+return 0;
--- initial
+++ final
@@ -1,19 +1,13 @@
 static int seq_client_debugfs_init(struct lu_client_seq *seq) {
   int rc;
-  seq->lcs_debugfs_entry = ldebugfs_register(seq->lcs_name, seq_debugfs_dir, NULL, NULL);
-  if (IS_ERR_OR_NULL(seq->lcs_debugfs_entry)) {
-    CERROR("%s: LdebugFS failed in seq-init\n", seq->lcs_name);
-    rc = seq->lcs_debugfs_entry ? PTR_ERR(seq->lcs_debugfs_entry) : -ENOMEM;
-    seq->lcs_debugfs_entry = NULL;
-    return rc;
-  }
+  seq->lcs_debugfs_entry = debugfs_create_dir(seq->lcs_name, seq_debugfs_dir);
   rc = ldebugfs_add_vars(seq->lcs_debugfs_entry, seq_client_debugfs_list, seq);
   if (rc) {
     CERROR("%s: Can't init sequence manager debugfs, rc %d\n", seq->lcs_name, rc);
     goto out_cleanup;
   }
   return 0;
 out_cleanup:
   seq_client_debugfs_fini(seq);
   return rc;
 }<sep>@@
expression e,e1,e2,e3;
statement S;
@@

e =
- ldebugfs_register
+ debugfs_create_dir
     (e1,e2
-     ,NULL,e3
     )
;
-if (IS_ERR_OR_NULL(e)) S