imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,47 +1,47 @@
 static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy, unsigned int freq_next, unsigned int relation) {
   int sensitivity;
   long d_actual, d_reference;
   struct msr actual, reference;
   struct cpu_data_t *data = &per_cpu(cpu_data, policy->cpu);
   struct policy_dbs_info *policy_dbs = policy->governor_data;
   struct dbs_data *od_data = policy_dbs->dbs_data;
   struct od_dbs_tuners *od_tuners = od_data->tuners;
   if (!policy->freq_table) return freq_next;
   rdmsr_on_cpu(policy->cpu, MSR_AMD64_FREQ_SENSITIVITY_ACTUAL, &actual.l, &actual.h);
   rdmsr_on_cpu(policy->cpu, MSR_AMD64_FREQ_SENSITIVITY_REFERENCE, &reference.l, &reference.h);
   actual.h &= 0x00ffffff;
   reference.h &= 0x00ffffff;
   /* counter wrapped around, so stay on current frequency */
   if (actual.q < data->actual || reference.q < data->reference) {
     freq_next = policy->cur;
     goto out;
   }
   d_actual = actual.q - data->actual;
   d_reference = reference.q - data->reference;
   /* divide by 0, so stay on current frequency as well */
   if (d_reference == 0) {
     freq_next = policy->cur;
     goto out;
   }
   sensitivity = POWERSAVE_BIAS_MAX - (POWERSAVE_BIAS_MAX * (d_reference - d_actual) / d_reference);
   clamp(sensitivity, 0, POWERSAVE_BIAS_MAX);
   /* this workload is not CPU bound, so choose a lower freq */
   if (sensitivity < od_tuners->powersave_bias) {
     if (data->freq_prev == policy->cur) freq_next = policy->cur;
     if (freq_next > policy->cur)
       freq_next = policy->cur;
     else if (freq_next < policy->cur)
       freq_next = policy->min;
     else {
       unsigned int index;
-      index = cpufreq_frequency_table_target(policy, policy->cur - 1, CPUFREQ_RELATION_H);
+      index = cpufreq_table_find_index_h(policy, policy->cur - 1);
       freq_next = policy->freq_table[index].frequency;
     }
     data->freq_prev = freq_next;
   } else
     data->freq_prev = 0;
 out:
   data->actual = actual.q;
   data->reference = reference.q;
   return freq_next;
 }<sep>@@
expression policy, old_freq;
@@

-	cpufreq_frequency_table_target(policy, old_freq,
-						    CPUFREQ_RELATION_H)
+	cpufreq_table_find_index_h(policy, old_freq)
--- initial
+++ final
@@ -1,38 +1,38 @@
 static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy, unsigned int freq_next, unsigned int relation) {
   unsigned int freq_req, freq_reduc, freq_avg;
   unsigned int freq_hi, freq_lo;
   unsigned int index;
   unsigned int delay_hi_us;
   struct policy_dbs_info *policy_dbs = policy->governor_data;
   struct od_policy_dbs_info *dbs_info = to_dbs_info(policy_dbs);
   struct dbs_data *dbs_data = policy_dbs->dbs_data;
   struct od_dbs_tuners *od_tuners = dbs_data->tuners;
   struct cpufreq_frequency_table *freq_table = policy->freq_table;
   if (!freq_table) {
     dbs_info->freq_lo = 0;
     dbs_info->freq_lo_delay_us = 0;
     return freq_next;
   }
   index = cpufreq_frequency_table_target(policy, freq_next, relation);
   freq_req = freq_table[index].frequency;
   freq_reduc = freq_req * od_tuners->powersave_bias / 1000;
   freq_avg = freq_req - freq_reduc;
   /* Find freq bounds for freq_avg in freq_table */
-  index = cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_H);
+  index = cpufreq_table_find_index_h(policy, freq_avg);
   freq_lo = freq_table[index].frequency;
-  index = cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_L);
+  index = cpufreq_table_find_index_l(policy, freq_avg);
   freq_hi = freq_table[index].frequency;
   /* Find out how long we have to be in hi and lo freqs */
   if (freq_hi == freq_lo) {
     dbs_info->freq_lo = 0;
     dbs_info->freq_lo_delay_us = 0;
     return freq_lo;
   }
   delay_hi_us = (freq_avg - freq_lo) * dbs_data->sampling_rate;
   delay_hi_us += (freq_hi - freq_lo) / 2;
   delay_hi_us /= freq_hi - freq_lo;
   dbs_info->freq_hi_delay_us = delay_hi_us;
   dbs_info->freq_lo = freq_lo;
   dbs_info->freq_lo_delay_us = dbs_data->sampling_rate - delay_hi_us;
   return freq_hi;
 }<sep>@@
expression policy, old_freq;
@@

-	cpufreq_frequency_table_target(policy, old_freq,
-						    CPUFREQ_RELATION_H)
+	cpufreq_table_find_index_h(policy, old_freq)

@@
expression policy, old_freq;
@@

-	cpufreq_frequency_table_target(policy, old_freq,
-						    CPUFREQ_RELATION_L)
+	cpufreq_table_find_index_l(policy, old_freq)
--- initial
+++ final
@@ -1,20 +1,20 @@
 void powernv_cpufreq_work_fn(struct work_struct *work) {
   struct chip *chip = container_of(work, struct chip, throttle);
   unsigned int cpu;
   cpumask_t mask;
   get_online_cpus();
   cpumask_and(&mask, &chip->mask, cpu_online_mask);
   smp_call_function_any(&mask, powernv_cpufreq_throttle_check, NULL, 0);
   if (!chip->restore) goto out;
   chip->restore = false;
   for_each_cpu(cpu, &mask) {
     int index;
     struct cpufreq_policy policy;
     cpufreq_get_policy(&policy, cpu);
-    index = cpufreq_frequency_table_target(&policy, policy.cur, CPUFREQ_RELATION_C);
+    index = cpufreq_table_find_index_c(&policy, policy.cur);
     powernv_cpufreq_target_index(&policy, index);
     cpumask_andnot(&mask, &mask, policy.cpus);
   }
 out:
   put_online_cpus();
 }<sep>@@
expression policy, old_freq;
@@

-	cpufreq_frequency_table_target(policy, old_freq,
-						    CPUFREQ_RELATION_C)
+	cpufreq_table_find_index_c(policy, old_freq)
--- initial
+++ final
@@ -1,22 +1,22 @@
 static int charger_extcon_notifier(struct notifier_block *self, unsigned long event, void *ptr) {
   struct charger_cable *cable = container_of(self, struct charger_cable, nb);
   /*
    * The newly state of charger cable.
    * If cable is attached, cable->attached is true.
    */
   cable->attached = event;
   /*
    * Setup monitoring to check battery state
    * when charger cable is attached.
    */
   if (cable->attached && is_polling_required(cable->cm)) {
-    if (work_pending(&setup_polling)) cancel_work_sync(&setup_polling);
+    cancel_work_sync(&setup_polling);
     schedule_work(&setup_polling);
   }
   /*
    * Setup work for controlling charger(regulator)
    * according to charger cable.
    */
   schedule_work(&cable->wq);
   return NOTIFY_DONE;
 }<sep>@@
expression e;
@@
- if (work_pending(e))
  cancel_work_sync(e);
--- initial
+++ final
@@ -1,28 +1,28 @@
 static int charger_manager_remove(struct platform_device *pdev) {
   struct charger_manager *cm = platform_get_drvdata(pdev);
   struct charger_desc *desc = cm->desc;
   int i = 0;
   int j = 0;
   /* Remove from the list */
   mutex_lock(&cm_list_mtx);
   list_del(&cm->entry);
   mutex_unlock(&cm_list_mtx);
-  if (work_pending(&setup_polling)) cancel_work_sync(&setup_polling);
-  if (delayed_work_pending(&cm_monitor_work)) cancel_delayed_work_sync(&cm_monitor_work);
+  cancel_work_sync(&setup_polling);
+  cancel_delayed_work_sync(&cm_monitor_work);
   for (i = 0; i < desc->num_charger_regulators; i++) {
     struct charger_regulator *charger = &desc->charger_regulators[i];
     for (j = 0; j < charger->num_cables; j++) {
       struct charger_cable *cable = &charger->cables[j];
       extcon_unregister_interest(&cable->extcon_dev);
     }
   }
   for (i = 0; i < desc->num_charger_regulators; i++)
     regulator_put(desc->charger_regulators[i].consumer);
   power_supply_unregister(&cm->charger_psy);
   try_charger_enable(cm, false);
   kfree(cm->charger_psy.properties);
   kfree(cm->charger_stat);
   kfree(cm->desc);
   kfree(cm);
   return 0;
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work_sync(e);

@@
expression e;
@@
- if (work_pending(e))
  cancel_work_sync(e);
--- initial
+++ final
@@ -1,27 +1,27 @@
 static int cm_suspend_prepare(struct device *dev) {
   struct charger_manager *cm = dev_get_drvdata(dev);
   if (!cm_suspended) {
     if (rtc_dev) {
       struct rtc_time tmp;
       unsigned long now;
       rtc_read_alarm(rtc_dev, &rtc_wkalarm_save);
       rtc_read_time(rtc_dev, &tmp);
       if (rtc_wkalarm_save.enabled) {
         rtc_tm_to_time(&rtc_wkalarm_save.time, &rtc_wkalarm_save_time);
         rtc_tm_to_time(&tmp, &now);
         if (now > rtc_wkalarm_save_time) rtc_wkalarm_save_time = 0;
       } else {
         rtc_wkalarm_save_time = 0;
       }
     }
     cm_suspended = true;
   }
-  if (delayed_work_pending(&cm->fullbatt_vchk_work)) cancel_delayed_work(&cm->fullbatt_vchk_work);
+  cancel_delayed_work(&cm->fullbatt_vchk_work);
   cm->status_save_ext_pwr_inserted = is_ext_pwr_online(cm);
   cm->status_save_batt = is_batt_present(cm);
   if (!cm_rtc_set) {
     cm_suspend_duration_ms = 0;
     cm_rtc_set = cm_setup_timer();
   }
   return 0;
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work(e);
--- initial
+++ final
@@ -1,23 +1,23 @@
 static int ab8500_charger_resume(struct platform_device *pdev) {
   int ret;
   struct ab8500_charger *di = platform_get_drvdata(pdev);
   /*
    * For ABB revision 1.0 and 1.1 there is a bug in the watchdog
    * logic. That means we have to continously kick the charger
    * watchdog even when no charger is connected. This is only
    * valid once the AC charger has been enabled. This is
    * a bug that is not handled by the algorithm and the
    * watchdog have to be kicked by the charger driver
    * when the AC charger is disabled
    */
   if (di->ac_conn && is_ab8500_1p1_or_earlier(di->parent)) {
     ret = abx500_set_register_interruptible(di->dev, AB8500_CHARGER, AB8500_CHARG_WD_CTRL, CHARG_WD_KICK);
     if (ret) dev_err(di->dev, "Failed to kick WD!\n");
     /* If not already pending start a new timer */
-    if (!delayed_work_pending(&di->kick_wd_work)) { queue_delayed_work(di->charger_wq, &di->kick_wd_work, round_jiffies(WD_KICK_INTERVAL)); }
+    queue_delayed_work(di->charger_wq, &di->kick_wd_work, round_jiffies(WD_KICK_INTERVAL));
   }
   /* If we still have a HW failure, schedule a new check */
   if (di->flags.mainextchnotok || di->flags.vbus_ovv) { queue_delayed_work(di->charger_wq, &di->check_hw_failure_work, 0); }
   if (di->flags.vbus_drop_end) queue_delayed_work(di->charger_wq, &di->vbus_drop_end_work, 0);
   return 0;
 }<sep>@@
expression e1,e2,e3;
@@
- if (!delayed_work_pending(e2))
- {
   ... queue_delayed_work(e1,e2,e3); ...
- }
--- initial
+++ final
@@ -1,17 +1,17 @@
 static int ab8500_charger_suspend(struct platform_device *pdev, pm_message_t state) {
   struct ab8500_charger *di = platform_get_drvdata(pdev);
   /* Cancel any pending HW failure check */
-  if (delayed_work_pending(&di->check_hw_failure_work)) cancel_delayed_work(&di->check_hw_failure_work);
-  if (delayed_work_pending(&di->vbus_drop_end_work)) cancel_delayed_work(&di->vbus_drop_end_work);
+  cancel_delayed_work(&di->check_hw_failure_work);
+  cancel_delayed_work(&di->vbus_drop_end_work);
   flush_delayed_work(&di->attach_work);
   flush_delayed_work(&di->usb_charger_attached_work);
   flush_delayed_work(&di->ac_charger_attached_work);
   flush_delayed_work(&di->check_usbchgnotok_work);
   flush_delayed_work(&di->check_vbat_work);
   flush_delayed_work(&di->kick_wd_work);
   flush_work(&di->usb_link_status_work);
   flush_work(&di->ac_work);
   flush_work(&di->detect_usb_type_work);
   if (atomic_read(&di->current_stepping_sessions)) return -EAGAIN;
   return 0;
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work(e);
--- initial
+++ final
@@ -1,3 +1 @@
-static void peak_pciec_start_led_work(struct peak_pciec_card *card) {
-  if (!delayed_work_pending(&card->led_work)) schedule_delayed_work(&card->led_work, HZ);
-}
+static void peak_pciec_start_led_work(struct peak_pciec_card *card) { schedule_delayed_work(&card->led_work, HZ); }<sep>@@
expression e1,e2;
@@
- if (!delayed_work_pending(e1))
  schedule_delayed_work(e1,e2);
--- initial
+++ final
@@ -1,26 +1,26 @@
 int wl1251_ps_elp_wakeup(struct wl1251 *wl) {
   unsigned long timeout, start;
   u32 elp_reg;
-  if (delayed_work_pending(&wl->elp_work)) cancel_delayed_work(&wl->elp_work);
+  cancel_delayed_work(&wl->elp_work);
   if (!wl->elp) return 0;
   wl1251_debug(DEBUG_PSM, "waking up chip from elp");
   start = jiffies;
   timeout = jiffies + msecs_to_jiffies(WL1251_WAKEUP_TIMEOUT);
   wl1251_write_elp(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, ELPCTRL_WAKE_UP);
   elp_reg = wl1251_read_elp(wl, HW_ACCESS_ELP_CTRL_REG_ADDR);
   /*
    * FIXME: we should wait for irq from chip but, as a temporary
    * solution to simplify locking, let's poll instead
    */
   while (!(elp_reg & ELPCTRL_WLAN_READY)) {
     if (time_after(jiffies, timeout)) {
       wl1251_error("elp wakeup timeout");
       return -ETIMEDOUT;
     }
     msleep(1);
     elp_reg = wl1251_read_elp(wl, HW_ACCESS_ELP_CTRL_REG_ADDR);
   }
   wl1251_debug(DEBUG_PSM, "wakeup time: %u ms", jiffies_to_msecs(jiffies - start));
   wl->elp = false;
   return 0;
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work(e);
--- initial
+++ final
@@ -1,25 +1,25 @@
 static int pga_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) {
   struct snd_soc_codec *codec = w->codec;
   struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec);
   struct wm8350_output *out;
   switch (w->shift) {
   case 0:
   case 1: out = &wm8350_data->out1; break;
   case 2:
   case 3: out = &wm8350_data->out2; break;
   default: BUG(); return -1;
   }
   switch (event) {
   case SND_SOC_DAPM_POST_PMU:
     out->ramp = WM8350_RAMP_UP;
     out->active = 1;
-    if (!delayed_work_pending(&codec->dapm.delayed_work)) schedule_delayed_work(&codec->dapm.delayed_work, msecs_to_jiffies(1));
+    schedule_delayed_work(&codec->dapm.delayed_work, msecs_to_jiffies(1));
     break;
   case SND_SOC_DAPM_PRE_PMD:
     out->ramp = WM8350_RAMP_DOWN;
     out->active = 0;
-    if (!delayed_work_pending(&codec->dapm.delayed_work)) schedule_delayed_work(&codec->dapm.delayed_work, msecs_to_jiffies(1));
+    schedule_delayed_work(&codec->dapm.delayed_work, msecs_to_jiffies(1));
     break;
   }
   return 0;
 }<sep>@@
expression e1,e2;
@@
- if (!delayed_work_pending(e1))
  schedule_delayed_work(e1,e2);
--- initial
+++ final
@@ -1,17 +1,17 @@
 int mce_notify_irq(void) {
   /* Not more than two messages every minute */
   static DEFINE_RATELIMIT_STATE(ratelimit, 60 * HZ, 2);
   if (test_and_clear_bit(0, &mce_need_notify)) {
     /* wake processes polling /dev/mcelog */
     wake_up_interruptible(&mce_chrdev_wait);
     /*
      * There is no risk of missing notifications because
      * work_pending is always cleared before the function is
      * executed.
      */
-    if (mce_helper[0] && !work_pending(&mce_trigger_work)) schedule_work(&mce_trigger_work);
+    if (mce_helper[0]) schedule_work(&mce_trigger_work);
     if (__ratelimit(&ratelimit)) pr_info(HW_ERR "Machine check events logged\n");
     return 1;
   }
   return 0;
 }<sep>@@
expression e,e1;
@@
- if (e && !work_pending(e1))
+ if (e)
  { ... schedule_work(e1); ... }
--- initial
+++ final
@@ -1,6 +1,6 @@
 static void mce_schedule_work(void) {
   if (!mce_ring_empty()) {
     struct work_struct *work = &__get_cpu_var(mce_work);
-    if (!work_pending(work)) schedule_work(work);
+    schedule_work(work);
   }
 }<sep>@@
expression e;
@@
- if (!work_pending(e))
  schedule_work(e);
--- initial
+++ final
@@ -1,9 +1,9 @@
 static void at91_vbus_timer(unsigned long data) {
   struct at91_udc *udc = (struct at91_udc *)data;
   /*
    * If we are polling vbus it is likely that the gpio is on an
    * bus such as i2c or spi which may sleep, so schedule some work
    * to read the vbus gpio
    */
-  if (!work_pending(&udc->vbus_timer_work)) schedule_work(&udc->vbus_timer_work);
+  schedule_work(&udc->vbus_timer_work);
 }<sep>@@
expression e;
@@
- if (!work_pending(e))
  schedule_work(e);
--- initial
+++ final
@@ -1,13 +1,13 @@
 static int __devexit exynos_dp_remove(struct platform_device *pdev) {
   struct exynos_dp_platdata *pdata = pdev->dev.platform_data;
   struct exynos_dp_device *dp = platform_get_drvdata(pdev);
   disable_irq(dp->irq);
-  if (work_pending(&dp->hotplug_work)) flush_work(&dp->hotplug_work);
+  flush_work(&dp->hotplug_work);
   if (pdev->dev.of_node) {
     if (dp->phy_addr) exynos_dp_phy_exit(dp);
   } else {
     if (pdata->phy_exit) pdata->phy_exit();
   }
   clk_disable_unprepare(dp->clock);
   return 0;
 }<sep>@@
expression e;
@@
- if (work_pending(e))
  flush_work(e);
--- initial
+++ final
@@ -1,12 +1,12 @@
 static int exynos_dp_suspend(struct device *dev) {
   struct exynos_dp_platdata *pdata = dev->platform_data;
   struct exynos_dp_device *dp = dev_get_drvdata(dev);
-  if (work_pending(&dp->hotplug_work)) flush_work(&dp->hotplug_work);
+  flush_work(&dp->hotplug_work);
   if (dev->of_node) {
     if (dp->phy_addr) exynos_dp_phy_exit(dp);
   } else {
     if (pdata->phy_exit) pdata->phy_exit();
   }
   clk_disable_unprepare(dp->clock);
   return 0;
 }<sep>@@
expression e;
@@
- if (work_pending(e))
  flush_work(e);
--- initial
+++ final
@@ -1,3 +1 @@
-void genpd_queue_power_off_work(struct generic_pm_domain *genpd) {
-  if (!work_pending(&genpd->power_off_work)) queue_work(pm_wq, &genpd->power_off_work);
-}
+void genpd_queue_power_off_work(struct generic_pm_domain *genpd) { queue_work(pm_wq, &genpd->power_off_work); }<sep>@@
expression e1,e2;
@@
- if (!work_pending(e2))
  queue_work(e1,e2);
--- initial
+++ final
@@ -1,3 +1,3 @@
 void queue_up_suspend_work(void) {
-  if (!work_pending(&suspend_work) && autosleep_state > PM_SUSPEND_ON) queue_work(autosleep_wq, &suspend_work);
+  if (autosleep_state > PM_SUSPEND_ON) queue_work(autosleep_wq, &suspend_work);
 }<sep>@@
expression e,e1,e2;
@@
- if (!work_pending(e2) && e)
+ if (e)
  { ... queue_work(e1,e2); ... }
--- initial
+++ final
@@ -1,12 +1,12 @@
 void pm_qos_remove_request(struct pm_qos_request *req) {
   if (!req) /*guard against callers passing in null */
     return;
   /* silent return to keep pcm code cleaner */
   if (!pm_qos_request_active(req)) {
     WARN(1, KERN_ERR "pm_qos_remove_request() called for unknown object\n");
     return;
   }
-  if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work);
+  cancel_delayed_work_sync(&req->work);
   pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
   memset(req, 0, sizeof(*req));
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work_sync(e);
--- initial
+++ final
@@ -1,10 +1,10 @@
 void pm_qos_update_request(struct pm_qos_request *req, s32 new_value) {
   if (!req) /*guard against callers passing in null */
     return;
   if (!pm_qos_request_active(req)) {
     WARN(1, KERN_ERR "pm_qos_update_request() called for unknown object\n");
     return;
   }
-  if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work);
+  cancel_delayed_work_sync(&req->work);
   if (new_value != req->node.prio) pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value);
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work_sync(e);
--- initial
+++ final
@@ -1,7 +1,7 @@
 void pm_qos_update_request_timeout(struct pm_qos_request *req, s32 new_value, unsigned long timeout_us) {
   if (!req) return;
   if (WARN(!pm_qos_request_active(req), "%s called for unknown object.", __func__)) return;
-  if (delayed_work_pending(&req->work)) cancel_delayed_work_sync(&req->work);
+  cancel_delayed_work_sync(&req->work);
   if (new_value != req->node.prio) pm_qos_update_target(pm_qos_array[req->pm_qos_class]->constraints, &req->node, PM_QOS_UPDATE_REQ, new_value);
   schedule_delayed_work(&req->work, usecs_to_jiffies(timeout_us));
 }<sep>@@
expression e;
@@
- if (delayed_work_pending(e))
  cancel_delayed_work_sync(e);
--- initial
+++ final
@@ -1,11 +1,11 @@
 static irqreturn_t ad7606_interrupt(int irq, void *dev_id) {
   struct iio_dev *indio_dev = dev_id;
   struct ad7606_state *st = iio_priv(indio_dev);
   if (iio_buffer_enabled(indio_dev)) {
-    if (!work_pending(&st->poll_work)) schedule_work(&st->poll_work);
+    schedule_work(&st->poll_work);
   } else {
     st->done = true;
     wake_up_interruptible(&st->wq_data_avail);
   }
   return IRQ_HANDLED;
 }<sep>@@
expression e;
@@
- if (!work_pending(e))
  schedule_work(e);
--- initial
+++ final
@@ -1,5 +1,5 @@
 static void dcon_set_source(struct dcon_priv *dcon, int arg) {
   if (dcon->pending_src == arg) return;
   dcon->pending_src = arg;
-  if ((dcon->curr_src != arg) && !work_pending(&dcon->switch_source)) schedule_work(&dcon->switch_source);
+  if ((dcon->curr_src != arg)) schedule_work(&dcon->switch_source);
 }<sep>@@
expression e,e1;
@@
- if (e && !work_pending(e1))
+ if (e)
  { ... schedule_work(e1); ... }
--- initial
+++ final
@@ -1,23 +1,23 @@
 static int ipc_memory_callback(struct notifier_block *self, unsigned long action, void *arg) {
   static DECLARE_WORK(ipc_memory_wq, ipc_memory_notifier);
   switch (action) {
   case MEM_ONLINE:  /* memory successfully brought online */
   case MEM_OFFLINE: /* or offline: it's time to recompute msgmni */
     /*
      * This is done by invoking the ipcns notifier chain with the
      * IPC_MEMCHANGED event.
      * In order not to keep the lock on the hotplug memory chain
      * for too long, queue a work item that will, when waken up,
      * activate the ipcns notification chain.
      * No need to keep several ipc work items on the queue.
      */
-    if (!work_pending(&ipc_memory_wq)) schedule_work(&ipc_memory_wq);
+    schedule_work(&ipc_memory_wq);
     break;
   case MEM_GOING_ONLINE:
   case MEM_GOING_OFFLINE:
   case MEM_CANCEL_ONLINE:
   case MEM_CANCEL_OFFLINE:
   default: break;
   }
   return NOTIFY_OK;
 }<sep>@@
expression e;
@@
- if (!work_pending(e))
  schedule_work(e);
--- initial
+++ final
@@ -1,6 +1,6 @@
 static void cyttsp4_watchdog_timer(unsigned long handle) {
   struct cyttsp4 *cd = (struct cyttsp4 *)handle;
   dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__);
-  if (!work_pending(&cd->watchdog_work)) schedule_work(&cd->watchdog_work);
+  schedule_work(&cd->watchdog_work);
   return;
 }<sep>@@
expression e;
@@
- if (!work_pending(e))
  schedule_work(e);
--- initial
+++ final
@@ -1,32 +1,31 @@
 static int lm90_init_client(struct i2c_client *client, struct lm90_data *data) {
   int config, convrate;
   convrate = lm90_read_reg(client, LM90_REG_R_CONVRATE);
   if (convrate < 0) return convrate;
   data->convrate_orig = convrate;
   /*
    * Start the conversions.
    */
   lm90_set_convrate(client, data, 500); /* 500ms; 2Hz conversion rate */
   config = lm90_read_reg(client, LM90_REG_R_CONFIG1);
   if (config < 0) return config;
   data->config_orig = config;
   /* Check Temperature Range Select */
   if (data->kind == adt7461 || data->kind == tmp451) {
     if (config & 0x04) data->flags |= LM90_FLAG_ADT7461_EXT;
   }
   /*
    * Put MAX6680/MAX8881 into extended resolution (bit 0x10,
    * 0.125 degree resolution) and range (0x08, extend range
    * to -64 degree) mode for the remote temperature sensor.
    */
   if (data->kind == max6680) config |= 0x18;
   /*
    * Select external channel 0 for max6695/96
    */
   if (data->kind == max6696) config &= ~0x08;
   config &= 0xBF;                  /* run */
   if (config != data->config_orig) /* Only write if changed */
     i2c_smbus_write_byte_data(client, LM90_REG_W_CONFIG1, config);
-  devm_add_action(&client->dev, lm90_restore_conf, data);
-  return 0;
+  return devm_add_action_or_reset(&client->dev, lm90_restore_conf, data);
 }<sep>@@
expression e1,e2,e3;
@@
-       devm_add_action(e1,e2,e3);
-       return 0;
+       return devm_add_action_or_reset(e1,e2,e3);