imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,43 +1,43 @@
 void kvm_async_pf_task_wait(u32 token, int interrupt_kernel) {
   u32 key = hash_32(token, KVM_TASK_SLEEP_HASHBITS);
   struct kvm_task_sleep_head *b = &async_pf_sleepers[key];
   struct kvm_task_sleep_node n, *e;
   DECLARE_SWAITQUEUE(wait);
   rcu_irq_enter();
   raw_spin_lock(&b->lock);
   e = _find_apf_task(b, token);
   if (e) {
     /* dummy entry exist -> wake up was delivered ahead of PF */
     hlist_del(&e->link);
     kfree(e);
     raw_spin_unlock(&b->lock);
     rcu_irq_exit();
     return;
   }
   n.token = token;
   n.cpu = smp_processor_id();
   n.halted = is_idle_task(current) || (IS_ENABLED(CONFIG_PREEMPT_COUNT) ? preempt_count() > 1 || rcu_preempt_depth() : interrupt_kernel);
   init_swait_queue_head(&n.wq);
   hlist_add_head(&n.link, &b->list);
   raw_spin_unlock(&b->lock);
   for (;;) {
-    if (!n.halted) prepare_to_swait(&n.wq, &wait, TASK_UNINTERRUPTIBLE);
+    if (!n.halted) prepare_to_swait_exclusive(&n.wq, &wait, TASK_UNINTERRUPTIBLE);
     if (hlist_unhashed(&n.link)) break;
     rcu_irq_exit();
     if (!n.halted) {
       local_irq_enable();
       schedule();
       local_irq_disable();
     } else {
       /*
        * We cannot reschedule. So halt.
        */
       native_safe_halt();
       local_irq_disable();
     }
     rcu_irq_enter();
   }
   if (!n.halted) finish_swait(&n.wq, &wait);
   rcu_irq_exit();
   return;
 }<sep>@@
expression e1,e2,e3;
@@
-                       prepare_to_swait
+                       prepare_to_swait_exclusive
				(e1,e2,e3)
--- initial
+++ final
@@ -1,50 +1,50 @@
 void kvm_vcpu_block(struct kvm_vcpu *vcpu) {
   ktime_t start, cur;
   DECLARE_SWAITQUEUE(wait);
   bool waited = false;
   u64 block_ns;
   start = cur = ktime_get();
   if (vcpu->halt_poll_ns) {
     ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);
     ++vcpu->stat.halt_attempted_poll;
     do {
       /*
        * This sets KVM_REQ_UNHALT if an interrupt
        * arrives.
        */
       if (kvm_vcpu_check_block(vcpu) < 0) {
         ++vcpu->stat.halt_successful_poll;
         if (!vcpu_valid_wakeup(vcpu)) ++vcpu->stat.halt_poll_invalid;
         goto out;
       }
       cur = ktime_get();
     } while (single_task_running() && ktime_before(cur, stop));
   }
   kvm_arch_vcpu_blocking(vcpu);
   for (;;) {
-    prepare_to_swait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
+    prepare_to_swait_exclusive(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
     if (kvm_vcpu_check_block(vcpu) < 0) break;
     waited = true;
     schedule();
   }
   finish_swait(&vcpu->wq, &wait);
   cur = ktime_get();
   kvm_arch_vcpu_unblocking(vcpu);
 out:
   block_ns = ktime_to_ns(cur) - ktime_to_ns(start);
   if (!vcpu_valid_wakeup(vcpu))
     shrink_halt_poll_ns(vcpu);
   else if (halt_poll_ns) {
     if (block_ns <= vcpu->halt_poll_ns)
       ;
     /* we had a long block, shrink polling */
     else if (vcpu->halt_poll_ns && block_ns > halt_poll_ns)
       shrink_halt_poll_ns(vcpu);
     /* we had a short halt and our poll time is too small */
     else if (vcpu->halt_poll_ns < halt_poll_ns && block_ns < halt_poll_ns)
       grow_halt_poll_ns(vcpu);
   } else
     vcpu->halt_poll_ns = 0;
   trace_kvm_vcpu_wakeup(block_ns, waited, vcpu_valid_wakeup(vcpu));
   kvm_arch_vcpu_block_finish(vcpu);
 }<sep>@@
expression e1,e2,e3;
@@
-                       prepare_to_swait
+                       prepare_to_swait_exclusive
				(e1,e2,e3)
--- initial
+++ final
@@ -1,10 +1,10 @@
 bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu) {
   struct swait_queue_head *wqp;
   wqp = kvm_arch_vcpu_wq(vcpu);
   if (swq_has_sleeper(wqp)) {
-    swake_up(wqp);
+    swake_up_one(wqp);
     ++vcpu->stat.halt_wakeup;
     return true;
   }
   return false;
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static void apic_timer_expired(struct kvm_lapic *apic) {
   struct kvm_vcpu *vcpu = apic->vcpu;
   struct swait_queue_head *q = &vcpu->wq;
   struct kvm_timer *ktimer = &apic->lapic_timer;
   if (atomic_read(&apic->lapic_timer.pending)) return;
   atomic_inc(&apic->lapic_timer.pending);
   kvm_set_pending_timer(vcpu);
   /*
    * For x86, the atomic_inc() is serialized, thus
    * using swait_active() is safe.
    */
-  if (swait_active(q)) swake_up(q);
+  if (swait_active(q)) swake_up_one(q);
   if (apic_lvtt_tscdeadline(apic)) ktimer->expired_tscdeadline = ktimer->tscdeadline;
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,6 +1,6 @@
 static void kvm_mips_comparecount_func(unsigned long data) {
   struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
   kvm_mips_callbacks->queue_timer_int(vcpu);
   vcpu->arch.wait = 0;
-  if (swq_has_sleeper(&vcpu->wq)) swake_up(&vcpu->wq);
+  if (swq_has_sleeper(&vcpu->wq)) swake_up_one(&vcpu->wq);
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,20 +1,20 @@
 int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_mips_interrupt *irq) {
   int intr = (int)irq->irq;
   struct kvm_vcpu *dvcpu = NULL;
   if (intr == 3 || intr == -3 || intr == 4 || intr == -4) kvm_debug("%s: CPU: %d, INTR: %d\n", __func__, irq->cpu, (int)intr);
   if (irq->cpu == -1)
     dvcpu = vcpu;
   else
     dvcpu = vcpu->kvm->vcpus[irq->cpu];
   if (intr == 2 || intr == 3 || intr == 4) {
     kvm_mips_callbacks->queue_io_int(dvcpu, irq);
   } else if (intr == -2 || intr == -3 || intr == -4) {
     kvm_mips_callbacks->dequeue_io_int(dvcpu, irq);
   } else {
     kvm_err("%s: invalid interrupt ioctl (%d:%d)\n", __func__, irq->cpu, irq->irq);
     return -EINVAL;
   }
   dvcpu->arch.wait = 0;
-  if (swq_has_sleeper(&dvcpu->wq)) swake_up(&dvcpu->wq);
+  if (swq_has_sleeper(&dvcpu->wq)) swake_up_one(&dvcpu->wq);
   return 0;
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,43 +1,43 @@
 static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) {
   struct kvm *kvm = source_vcpu->kvm;
   struct kvm_vcpu *vcpu = NULL;
   struct swait_queue_head *wq;
   unsigned long cpu_id;
   unsigned long context_id;
   phys_addr_t target_pc;
   cpu_id = smccc_get_arg1(source_vcpu) & MPIDR_HWID_BITMASK;
   if (vcpu_mode_is_32bit(source_vcpu)) cpu_id &= ~((u32)0);
   vcpu = kvm_mpidr_to_vcpu(kvm, cpu_id);
   /*
    * Make sure the caller requested a valid CPU and that the CPU is
    * turned off.
    */
   if (!vcpu) return PSCI_RET_INVALID_PARAMS;
   if (!vcpu->arch.power_off) {
     if (kvm_psci_version(source_vcpu, kvm) != KVM_ARM_PSCI_0_1)
       return PSCI_RET_ALREADY_ON;
     else
       return PSCI_RET_INVALID_PARAMS;
   }
   target_pc = smccc_get_arg2(source_vcpu);
   context_id = smccc_get_arg3(source_vcpu);
   kvm_reset_vcpu(vcpu);
   /* Gracefully handle Thumb2 entry point */
   if (vcpu_mode_is_32bit(vcpu) && (target_pc & 1)) {
     target_pc &= ~((phys_addr_t)1);
     vcpu_set_thumb(vcpu);
   }
   /* Propagate caller endianness */
   if (kvm_vcpu_is_be(source_vcpu)) kvm_vcpu_set_be(vcpu);
   *vcpu_pc(vcpu) = target_pc;
   /*
    * NOTE: We always update r0 (or x0) because for PSCI v0.1
    * the general puspose registers are undefined upon CPU_ON.
    */
   smccc_set_retval(vcpu, context_id, 0, 0, 0);
   vcpu->arch.power_off = false;
   smp_mb(); /* Make sure the above is visible */
   wq = kvm_arch_vcpu_wq(vcpu);
-  swake_up(wq);
+  swake_up_one(wq);
   return PSCI_RET_SUCCESS;
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,5 +1,5 @@
 void __srcu_read_unlock(struct srcu_struct *sp, int idx) {
   int newval = sp->srcu_lock_nesting[idx] - 1;
   WRITE_ONCE(sp->srcu_lock_nesting[idx], newval);
-  if (!newval && READ_ONCE(sp->srcu_gp_waiting)) swake_up(&sp->srcu_wq);
+  if (!newval && READ_ONCE(sp->srcu_gp_waiting)) swake_up_one(&sp->srcu_wq);
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,36 +1,36 @@
 void srcu_drive_gp(struct work_struct *wp) {
   int idx;
   struct rcu_head *lh;
   struct rcu_head *rhp;
   struct srcu_struct *sp;
   sp = container_of(wp, struct srcu_struct, srcu_work);
   if (sp->srcu_gp_running || !READ_ONCE(sp->srcu_cb_head)) return; /* Already running or nothing to do. */
   /* Remove recently arrived callbacks and wait for readers. */
   WRITE_ONCE(sp->srcu_gp_running, true);
   local_irq_disable();
   lh = sp->srcu_cb_head;
   sp->srcu_cb_head = NULL;
   sp->srcu_cb_tail = &sp->srcu_cb_head;
   local_irq_enable();
   idx = sp->srcu_idx;
   WRITE_ONCE(sp->srcu_idx, !sp->srcu_idx);
   WRITE_ONCE(sp->srcu_gp_waiting, true); /* srcu_read_unlock() wakes! */
-  swait_event(sp->srcu_wq, !READ_ONCE(sp->srcu_lock_nesting[idx]));
+  swait_event_exclusive(sp->srcu_wq, !READ_ONCE(sp->srcu_lock_nesting[idx]));
   WRITE_ONCE(sp->srcu_gp_waiting, false); /* srcu_read_unlock() cheap. */
   /* Invoke the callbacks we removed above. */
   while (lh) {
     rhp = lh;
     lh = lh->next;
     local_bh_disable();
     rhp->func(rhp);
     local_bh_enable();
   }
   /*
    * Enable rescheduling, and if there are more callbacks,
    * reschedule ourselves.  This can race with a call_srcu()
    * at interrupt level, but the ->srcu_gp_running checks will
    * straighten that out.
    */
   WRITE_ONCE(sp->srcu_gp_running, false);
   if (READ_ONCE(sp->srcu_cb_head)) schedule_work(&sp->srcu_work);
 }<sep>@@
expression e1,e2;
@@
-	swait_event
+	swait_event_exclusive
			(e1,e2)
--- initial
+++ final
@@ -1,20 +1,20 @@
 static void s2idle_enter(void) {
   trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true);
   raw_spin_lock_irq(&s2idle_lock);
   if (pm_wakeup_pending()) goto out;
   s2idle_state = S2IDLE_STATE_ENTER;
   raw_spin_unlock_irq(&s2idle_lock);
   get_online_cpus();
   cpuidle_resume();
   /* Push all the CPUs into the idle loop. */
   wake_up_all_idle_cpus();
   /* Make the current CPU wait so it can enter the idle loop too. */
-  swait_event(s2idle_wait_head, s2idle_state == S2IDLE_STATE_WAKE);
+  swait_event_exclusive(s2idle_wait_head, s2idle_state == S2IDLE_STATE_WAKE);
   cpuidle_pause();
   put_online_cpus();
   raw_spin_lock_irq(&s2idle_lock);
 out:
   s2idle_state = S2IDLE_STATE_NONE;
   raw_spin_unlock_irq(&s2idle_lock);
   trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false);
 }<sep>@@
expression e1,e2;
@@
-	swait_event
+	swait_event_exclusive
			(e1,e2)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void s2idle_wake(void) {
   unsigned long flags;
   raw_spin_lock_irqsave(&s2idle_lock, flags);
   if (s2idle_state > S2IDLE_STATE_NONE) {
     s2idle_state = S2IDLE_STATE_WAKE;
-    swake_up(&s2idle_wait_head);
+    swake_up_one(&s2idle_wait_head);
   }
   raw_spin_unlock_irqrestore(&s2idle_lock, flags);
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,4 +1,4 @@
 static void rcu_gp_kthread_wake(struct rcu_state *rsp) {
   if (current == rsp->gp_kthread || !READ_ONCE(rsp->gp_flags) || !rsp->gp_kthread) return;
-  swake_up(&rsp->gp_wq);
+  swake_up_one(&rsp->gp_wq);
 }<sep>@@
expression e;
@@
-               swake_up
+               swake_up_one
			(e)
--- initial
+++ final
@@ -1,68 +1,68 @@
 static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, struct sk_buff *prev, struct net_device *ldev) {
   struct sk_buff *fp, *head = fq->q.fragments;
   int sum_truesize;
   inet_frag_kill(&fq->q);
   /* Make the one we just received the head. */
   if (prev) {
     head = prev->next;
     fp = skb_clone(head, GFP_ATOMIC);
     if (!fp) goto out_oom;
     fp->next = head->next;
     if (!fp->next) fq->q.fragments_tail = fp;
     prev->next = fp;
     skb_morph(head, fq->q.fragments);
     head->next = fq->q.fragments->next;
     consume_skb(fq->q.fragments);
     fq->q.fragments = head;
   }
   /* Head of list must not be cloned. */
   if (skb_unclone(head, GFP_ATOMIC)) goto out_oom;
   /* If the first fragment is fragmented itself, we split
    * it to two chunks: the first with data and paged part
    * and the second, holding only fragments.
    */
   if (skb_has_frag_list(head)) {
     struct sk_buff *clone;
     int i, plen = 0;
     clone = alloc_skb(0, GFP_ATOMIC);
     if (!clone) goto out_oom;
     clone->next = head->next;
     head->next = clone;
     skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
     skb_frag_list_init(head);
     for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
       plen += skb_frag_size(&skb_shinfo(head)->frags[i]);
     clone->len = head->data_len - plen;
     clone->data_len = clone->len;
     head->data_len -= clone->len;
     head->len -= clone->len;
     add_frag_mem_limit(fq->q.net, clone->truesize);
   }
   WARN_ON(head == NULL);
   sum_truesize = head->truesize;
   for (fp = head->next; fp;) {
     bool headstolen;
     int delta;
     struct sk_buff *next = fp->next;
     sum_truesize += fp->truesize;
     if (skb_try_coalesce(head, fp, &headstolen, &delta)) {
       kfree_skb_partial(fp, headstolen);
     } else {
       if (!skb_shinfo(head)->frag_list) skb_shinfo(head)->frag_list = fp;
       head->data_len += fp->len;
       head->len += fp->len;
       head->truesize += fp->truesize;
     }
     fp = next;
   }
   sub_frag_mem_limit(fq->q.net, sum_truesize);
-  head->next = NULL;
+  skb_mark_not_on_list(head);
   head->dev = ldev;
   head->tstamp = fq->q.stamp;
   fq->q.fragments = NULL;
   fq->q.fragments_tail = NULL;
   return 1;
 out_oom:
   net_dbg_ratelimited("lowpan_frag_reasm: no memory for reassembly\n");
   return -1;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static int tipc_l2_rcv_msg(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) {
   struct tipc_bearer *b;
   rcu_read_lock();
   b = rcu_dereference_rtnl(dev->tipc_ptr) ?: rcu_dereference_rtnl(orig_dev->tipc_ptr);
   if (likely(b && test_bit(0, &b->up) && (skb->pkt_type <= PACKET_MULTICAST))) {
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
     tipc_rcv(dev_net(b->pt.dev), skb, b);
     rcu_read_unlock();
     return NET_RX_SUCCESS;
   }
   rcu_read_unlock();
   kfree_skb(skb);
   return NET_RX_DROP;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,12 +1,12 @@
 static void __napi_gro_flush_chain(struct napi_struct *napi, u32 index, bool flush_old) {
   struct list_head *head = &napi->gro_hash[index].list;
   struct sk_buff *skb, *p;
   list_for_each_entry_safe_reverse(skb, p, head, list) {
     if (flush_old && NAPI_GRO_CB(skb)->age == jiffies) return;
     list_del(&skb->list);
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
     napi_gro_complete(skb);
     napi->gro_hash[index].count--;
   }
   if (!napi->gro_hash[index].count) __clear_bit(index, &napi->gro_bitmask);
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,82 +1,82 @@
 static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) {
   u32 hash = skb_get_hash_raw(skb) & (GRO_HASH_BUCKETS - 1);
   struct list_head *head = &offload_base;
   struct packet_offload *ptype;
   __be16 type = skb->protocol;
   struct list_head *gro_head;
   struct sk_buff *pp = NULL;
   enum gro_result ret;
   int same_flow;
   int grow;
   if (netif_elide_gro(skb->dev)) goto normal;
   gro_head = gro_list_prepare(napi, skb);
   rcu_read_lock();
   list_for_each_entry_rcu(ptype, head, list) {
     if (ptype->type != type || !ptype->callbacks.gro_receive) continue;
     skb_set_network_header(skb, skb_gro_offset(skb));
     skb_reset_mac_len(skb);
     NAPI_GRO_CB(skb)->same_flow = 0;
     NAPI_GRO_CB(skb)->flush = skb_is_gso(skb) || skb_has_frag_list(skb);
     NAPI_GRO_CB(skb)->free = 0;
     NAPI_GRO_CB(skb)->encap_mark = 0;
     NAPI_GRO_CB(skb)->recursion_counter = 0;
     NAPI_GRO_CB(skb)->is_fou = 0;
     NAPI_GRO_CB(skb)->is_atomic = 1;
     NAPI_GRO_CB(skb)->gro_remcsum_start = 0;
     /* Setup for GRO checksum validation */
     switch (skb->ip_summed) {
     case CHECKSUM_COMPLETE:
       NAPI_GRO_CB(skb)->csum = skb->csum;
       NAPI_GRO_CB(skb)->csum_valid = 1;
       NAPI_GRO_CB(skb)->csum_cnt = 0;
       break;
     case CHECKSUM_UNNECESSARY:
       NAPI_GRO_CB(skb)->csum_cnt = skb->csum_level + 1;
       NAPI_GRO_CB(skb)->csum_valid = 0;
       break;
     default: NAPI_GRO_CB(skb)->csum_cnt = 0; NAPI_GRO_CB(skb)->csum_valid = 0;
     }
     pp = ptype->callbacks.gro_receive(gro_head, skb);
     break;
   }
   rcu_read_unlock();
   if (&ptype->list == head) goto normal;
   if (IS_ERR(pp) && PTR_ERR(pp) == -EINPROGRESS) {
     ret = GRO_CONSUMED;
     goto ok;
   }
   same_flow = NAPI_GRO_CB(skb)->same_flow;
   ret = NAPI_GRO_CB(skb)->free ? GRO_MERGED_FREE : GRO_MERGED;
   if (pp) {
     list_del(&pp->list);
-    pp->next = NULL;
+    skb_mark_not_on_list(pp);
     napi_gro_complete(pp);
     napi->gro_hash[hash].count--;
   }
   if (same_flow) goto ok;
   if (NAPI_GRO_CB(skb)->flush) goto normal;
   if (unlikely(napi->gro_hash[hash].count >= MAX_GRO_SKBS)) {
     gro_flush_oldest(gro_head);
   } else {
     napi->gro_hash[hash].count++;
   }
   NAPI_GRO_CB(skb)->count = 1;
   NAPI_GRO_CB(skb)->age = jiffies;
   NAPI_GRO_CB(skb)->last = skb;
   skb_shinfo(skb)->gso_size = skb_gro_len(skb);
   list_add(&skb->list, gro_head);
   ret = GRO_HELD;
 pull:
   grow = skb_gro_offset(skb) - skb_headlen(skb);
   if (grow > 0) gro_pull_from_frag0(skb, grow);
 ok:
   if (napi->gro_hash[hash].count) {
     if (!test_bit(hash, &napi->gro_bitmask)) __set_bit(hash, &napi->gro_bitmask);
   } else if (test_bit(hash, &napi->gro_bitmask)) {
     __clear_bit(hash, &napi->gro_bitmask);
   }
   return ret;
 normal:
   ret = GRO_NORMAL;
   goto pull;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,21 +1,21 @@
 struct sk_buff *dev_hard_start_xmit(struct sk_buff *first, struct net_device *dev, struct netdev_queue *txq, int *ret) {
   struct sk_buff *skb = first;
   int rc = NETDEV_TX_OK;
   while (skb) {
     struct sk_buff *next = skb->next;
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
     rc = xmit_one(skb, dev, txq, next != NULL);
     if (unlikely(!dev_xmit_complete(rc))) {
       skb->next = next;
       goto out;
     }
     skb = next;
     if (netif_xmit_stopped(txq) && skb) {
       rc = NETDEV_TX_BUSY;
       break;
     }
   }
 out:
   *ret = rc;
   return skb;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,20 +1,20 @@
 struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev, bool *again) {
   struct sk_buff *next, *head = NULL, *tail;
   for (; skb != NULL; skb = next) {
     next = skb->next;
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
     /* in case skb wont be segmented, point to itself */
     skb->prev = skb;
     skb = validate_xmit_skb(skb, dev, again);
     if (!skb) continue;
     if (!head)
       head = skb;
     else
       tail->next = skb;
     /* If skb was segmented, skb->prev points to
      * the last segment. If not, it still contains skb.
      */
     tail = skb->prev;
   }
   return head;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,34 +1,34 @@
 static void rxrpc_rotate_tx_window(struct rxrpc_call *call, rxrpc_seq_t to, struct rxrpc_ack_summary *summary) {
   struct sk_buff *skb, *list = NULL;
   int ix;
   u8 annotation;
   if (call->acks_lowest_nak == call->tx_hard_ack) {
     call->acks_lowest_nak = to;
   } else if (before_eq(call->acks_lowest_nak, to)) {
     summary->new_low_nack = true;
     call->acks_lowest_nak = to;
   }
   spin_lock(&call->lock);
   while (before(call->tx_hard_ack, to)) {
     call->tx_hard_ack++;
     ix = call->tx_hard_ack & RXRPC_RXTX_BUFF_MASK;
     skb = call->rxtx_buffer[ix];
     annotation = call->rxtx_annotations[ix];
     rxrpc_see_skb(skb, rxrpc_skb_tx_rotated);
     call->rxtx_buffer[ix] = NULL;
     call->rxtx_annotations[ix] = 0;
     skb->next = list;
     list = skb;
     if (annotation & RXRPC_TX_ANNO_LAST) set_bit(RXRPC_CALL_TX_LAST, &call->flags);
     if ((annotation & RXRPC_TX_ANNO_MASK) != RXRPC_TX_ANNO_ACK) summary->nr_rot_new_acks++;
   }
   spin_unlock(&call->lock);
   trace_rxrpc_transmit(call, (test_bit(RXRPC_CALL_TX_LAST, &call->flags) ? rxrpc_transmit_rotate_last : rxrpc_transmit_rotate));
   wake_up(&call->waitq);
   while (list) {
     skb = list;
     list = skb->next;
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
     rxrpc_free_skb(skb, rxrpc_skb_tx_freed);
   }
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,11 +1,11 @@
 static void ip_sublist_rcv_finish(struct list_head *head) {
   struct sk_buff *skb, *next;
   list_for_each_entry_safe(skb, next, head, list) {
     list_del(&skb->list);
     /* Handle ip{6}_forward case, as sch_direct_xmit have
      * another kind of SKB-list usage (see validate_xmit_skb_list)
      */
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
     dst_input(skb);
   }
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,38 +1,38 @@
 static int ip_finish_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb, unsigned int mtu) {
   netdev_features_t features;
   struct sk_buff *segs;
   int ret = 0;
   /* common case: seglen is <= mtu
    */
   if (skb_gso_validate_network_len(skb, mtu)) return ip_finish_output2(net, sk, skb);
   /* Slowpath -  GSO segment length exceeds the egress MTU.
    *
    * This can happen in several cases:
    *  - Forwarding of a TCP GRO skb, when DF flag is not set.
    *  - Forwarding of an skb that arrived on a virtualization interface
    *    (virtio-net/vhost/tap) with TSO/GSO size set by other network
    *    stack.
    *  - Local GSO skb transmitted on an NETIF_F_TSO tunnel stacked over an
    *    interface with a smaller MTU.
    *  - Arriving GRO skb (or GSO skb in a virtualized environment) that is
    *    bridged to a NETIF_F_TSO tunnel stacked over an interface with an
    *    insufficent MTU.
    */
   features = netif_skb_features(skb);
   BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
   segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
   if (IS_ERR_OR_NULL(segs)) {
     kfree_skb(skb);
     return -ENOMEM;
   }
   consume_skb(skb);
   do {
     struct sk_buff *nskb = segs->next;
     int err;
-    segs->next = NULL;
+    skb_mark_not_on_list(segs);
     err = ip_fragment(net, sk, segs, mtu, ip_finish_output2);
     if (err && ret == 0) ret = err;
     segs = nskb;
   } while (segs);
   return ret;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,20 +1,20 @@
 static int __nfqnl_enqueue_packet_gso(struct net *net, struct nfqnl_instance *queue, struct sk_buff *skb, struct nf_queue_entry *entry) {
   int ret = -ENOMEM;
   struct nf_queue_entry *entry_seg;
   nf_bridge_adjust_segmented_data(skb);
   if (skb->next == NULL) { /* last packet, no need to copy entry */
     struct sk_buff *gso_skb = entry->skb;
     entry->skb = skb;
     ret = __nfqnl_enqueue_packet(net, queue, entry);
     if (ret) entry->skb = gso_skb;
     return ret;
   }
-  skb->next = NULL;
+  skb_mark_not_on_list(skb);
   entry_seg = nf_queue_entry_dup(entry);
   if (entry_seg) {
     entry_seg->skb = skb;
     ret = __nfqnl_enqueue_packet(net, queue, entry_seg);
     if (ret) free_entry(entry_seg);
   }
   return ret;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)
--- initial
+++ final
@@ -1,8 +1,8 @@
 static struct sk_buff *dequeue_head(struct cake_flow *flow) {
   struct sk_buff *skb = flow->head;
   if (skb) {
     flow->head = skb->next;
-    skb->next = NULL;
+    skb_mark_not_on_list(skb);
   }
   return skb;
 }<sep>@@
struct sk_buff *skb;
@@
- skb->next = NULL
+ skb_mark_not_on_list(skb)