imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,39 +1,38 @@
 void __dma_free_coherent(size_t size, void *vaddr) {
   struct ppc_vm_region *c;
   unsigned long flags, addr;
 
   size = PAGE_ALIGN(size);
   spin_lock_irqsave(&consistent_lock, flags);
   c = ppc_vm_region_find(&consistent_head, (unsigned long)vaddr);
   if (!c) goto no_area;
   if ((c->vm_end - c->vm_start) != size) {
     printk(KERN_ERR "%s: freeing wrong coherent size (%ld != %d)\n", __func__, c->vm_end - c->vm_start, size);
     dump_stack();
     size = c->vm_end - c->vm_start;
   }
   addr = c->vm_start;
   do {
     pte_t *ptep;
     unsigned long pfn;
     ptep = pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(addr), addr), addr), addr);
     if (!pte_none(*ptep) && pte_present(*ptep)) {
       pfn = pte_pfn(*ptep);
       pte_clear(&init_mm, addr, ptep);
       if (pfn_valid(pfn)) {
         struct page *page = pfn_to_page(pfn);
-        ClearPageReserved(page);
-        __free_page(page);
+        __free_reserved_page(page);
       }
     }
     addr += PAGE_SIZE;
   } while (size -= PAGE_SIZE);
   flush_tlb_kernel_range(c->vm_start, c->vm_end);
   list_del(&c->vm_list);
   spin_unlock_irqrestore(&consistent_lock, flags);
   kfree(c);
   return;
 no_area:
   spin_unlock_irqrestore(&consistent_lock, flags);
   printk(KERN_ERR "%s: trying to free invalid coherent area: %p\n", __func__, vaddr);
   dump_stack();
 }<sep>@@
expression page;
@@

-				ClearPageReserved(page);
-				__free_page(page);
+				__free_reserved_page(page);
--- initial
+++ final
@@ -1,42 +1,41 @@
 void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) {
   struct metag_vm_region *c;
   unsigned long flags, addr;
   pte_t *ptep;
   size = PAGE_ALIGN(size);
   spin_lock_irqsave(&consistent_lock, flags);
   c = metag_vm_region_find(&consistent_head, (unsigned long)vaddr);
   if (!c) goto no_area;
   c->vm_active = 0;
   if ((c->vm_end - c->vm_start) != size) {
     pr_err("%s: freeing wrong coherent size (%ld != %d)\n", __func__, c->vm_end - c->vm_start, size);
     dump_stack();
     size = c->vm_end - c->vm_start;
   }
   ptep = consistent_pte + CONSISTENT_OFFSET(c->vm_start);
   addr = c->vm_start;
   do {
     pte_t pte = ptep_get_and_clear(&init_mm, addr, ptep);
     unsigned long pfn;
     ptep++;
     addr += PAGE_SIZE;
     if (!pte_none(pte) && pte_present(pte)) {
       pfn = pte_pfn(pte);
       if (pfn_valid(pfn)) {
         struct page *page = pfn_to_page(pfn);
-        ClearPageReserved(page);
-        __free_page(page);
+        __free_reserved_page(page);
         continue;
       }
     }
     pr_crit("%s: bad page in kernel page table\n", __func__);
   } while (size -= PAGE_SIZE);
   flush_tlb_kernel_range(c->vm_start, c->vm_end);
   list_del(&c->vm_list);
   spin_unlock_irqrestore(&consistent_lock, flags);
   kfree(c);
   return;
 no_area:
   spin_unlock_irqrestore(&consistent_lock, flags);
   pr_err("%s: trying to free invalid coherent area: %p\n", __func__, vaddr);
   dump_stack();
 }<sep>@@
expression page;
@@

-				ClearPageReserved(page);
-				__free_page(page);
+				__free_reserved_page(page);
--- initial
+++ final
@@ -1,23 +1,21 @@
 static inline void free_unused_pages(unsigned int virtual_start, unsigned int virtual_end) {
   int mb_freed = 0;
   /*
    * Align addresses
    */
   virtual_start = PAGE_ALIGN(virtual_start);
   virtual_end = PAGE_ALIGN(virtual_end);
   while (virtual_start < virtual_end) {
     struct page *page;
     /*
      * Clear page reserved bit,
      * set count to 1, and free
      * the page.
      */
     page = virt_to_page(virtual_start);
-    ClearPageReserved(page);
-    init_page_count(page);
-    free_page(virtual_start);
+    __free_reserved_page(page);
     virtual_start += PAGE_SIZE;
     mb_freed += PAGE_SIZE / 1024;
   }
   printk("acornfb: freed %dK memory\n", mb_freed);
 }<sep>@@
expression page,e;
@@

				page = virt_to_page(e);
-				ClearPageReserved(page);
-				init_page_count(page);
-				free_page(e);
+				__free_reserved_page(page);
--- initial
+++ final
@@ -1,9 +1,9 @@
 static int at91_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) {
   dev_dbg(dev, "%s(): cmd=%08x\n", __func__, enabled);
   if (enabled) {
     at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
-    at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM);
+    at91_rtc_write_ier(AT91_RTC_ALARM);
   } else
-    at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM);
+    at91_rtc_write_idr(AT91_RTC_ALARM);
   return 0;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IER, e);
+	at91_rtc_write_ier(e);

@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IDR, e);
+	at91_rtc_write_idr(e);
--- initial
+++ final
@@ -1,17 +1,17 @@
 static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id) {
   struct platform_device *pdev = dev_id;
   struct rtc_device *rtc = platform_get_drvdata(pdev);
   unsigned int rtsr;
   unsigned long events = 0;
-  rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read(AT91_RTC_IMR);
+  rtsr = at91_rtc_read(AT91_RTC_SR) & at91_rtc_read_imr();
   if (rtsr) { /* this interrupt is shared!  Is it ours? */
     if (rtsr & AT91_RTC_ALARM) events |= (RTC_AF | RTC_IRQF);
     if (rtsr & AT91_RTC_SECEV) events |= (RTC_UF | RTC_IRQF);
     if (rtsr & AT91_RTC_ACKUPD) complete(&at91_rtc_updated);
     at91_rtc_write(AT91_RTC_SCCR, rtsr); /* clear status reg */
     rtc_update_irq(rtc, 1, events);
     dev_dbg(&pdev->dev, "%s(): num=%ld, events=0x%02lx\n", __func__, events >> 8, events & 0x000000FF);
     return IRQ_HANDLED;
   }
   return IRQ_NONE; /* not handled */
 }<sep>@@
@@

- at91_rtc_read(AT91_RTC_IMR)
+ at91_rtc_read_imr()
--- initial
+++ final
@@ -1,48 +1,48 @@
 static int __init at91_rtc_probe(struct platform_device *pdev) {
   struct rtc_device *rtc;
   struct resource *regs;
   int ret = 0;
   at91_rtc_config = at91_rtc_get_config(pdev);
   if (!at91_rtc_config) return -ENODEV;
   regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (!regs) {
     dev_err(&pdev->dev, "no mmio resource defined\n");
     return -ENXIO;
   }
   irq = platform_get_irq(pdev, 0);
   if (irq < 0) {
     dev_err(&pdev->dev, "no irq resource defined\n");
     return -ENXIO;
   }
   at91_rtc_regs = ioremap(regs->start, resource_size(regs));
   if (!at91_rtc_regs) {
     dev_err(&pdev->dev, "failed to map registers, aborting.\n");
     return -ENOMEM;
   }
   at91_rtc_write(AT91_RTC_CR, 0);
   at91_rtc_write(AT91_RTC_MR, 0); /* 24 hour mode */
   /* Disable all interrupts */
-  at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV);
+  at91_rtc_write_idr(AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV);
   ret = request_irq(irq, at91_rtc_interrupt, IRQF_SHARED, "at91_rtc", pdev);
   if (ret) {
     dev_err(&pdev->dev, "IRQ %d already in use.\n", irq);
     goto err_unmap;
   }
   /* cpu init code should really have flagged this device as
    * being wake-capable; if it didn't, do that here.
    */
   if (!device_can_wakeup(&pdev->dev)) device_init_wakeup(&pdev->dev, 1);
   rtc = rtc_device_register(pdev->name, &pdev->dev, &at91_rtc_ops, THIS_MODULE);
   if (IS_ERR(rtc)) {
     ret = PTR_ERR(rtc);
     goto err_free_irq;
   }
   platform_set_drvdata(pdev, rtc);
   dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n");
   return 0;
 err_free_irq:
   free_irq(irq, pdev);
 err_unmap:
   iounmap(at91_rtc_regs);
   return ret;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IDR, e);
+	at91_rtc_write_idr(e);
--- initial
+++ final
@@ -1,6 +1,6 @@
 static int at91_rtc_proc(struct device *dev, struct seq_file *seq) {
-  unsigned long imr = at91_rtc_read(AT91_RTC_IMR);
+  unsigned long imr = at91_rtc_read_imr();
   seq_printf(seq, "update_IRQ\t: %s\n", (imr & AT91_RTC_ACKUPD) ? "yes" : "no");
   seq_printf(seq, "periodic_IRQ\t: %s\n", (imr & AT91_RTC_SECEV) ? "yes" : "no");
   return 0;
 }<sep>@@
@@

- at91_rtc_read(AT91_RTC_IMR)
+ at91_rtc_read_imr()
--- initial
+++ final
@@ -1,9 +1,9 @@
 static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) {
   struct rtc_time *tm = &alrm->time;
   at91_rtc_decodetime(AT91_RTC_TIMALR, AT91_RTC_CALALR, tm);
   tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
   tm->tm_year = at91_alarm_year - 1900;
-  alrm->enabled = (at91_rtc_read(AT91_RTC_IMR) & AT91_RTC_ALARM) ? 1 : 0;
+  alrm->enabled = (at91_rtc_read_imr() & AT91_RTC_ALARM) ? 1 : 0;
   dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
   return 0;
 }<sep>@@
@@

- at91_rtc_read(AT91_RTC_IMR)
+ at91_rtc_read_imr()
--- initial
+++ final
@@ -1,10 +1,10 @@
 static int __exit at91_rtc_remove(struct platform_device *pdev) {
   struct rtc_device *rtc = platform_get_drvdata(pdev);
   /* Disable all interrupts */
-  at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV);
+  at91_rtc_write_idr(AT91_RTC_ACKUPD | AT91_RTC_ALARM | AT91_RTC_SECEV | AT91_RTC_TIMEV | AT91_RTC_CALEV);
   free_irq(irq, pdev);
   rtc_device_unregister(rtc);
   iounmap(at91_rtc_regs);
   platform_set_drvdata(pdev, NULL);
   return 0;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IDR, e);
+	at91_rtc_write_idr(e);
--- initial
+++ final
@@ -1,9 +1,9 @@
 static int at91_rtc_resume(struct device *dev) {
   if (at91_rtc_imr) {
     if (device_may_wakeup(dev))
       disable_irq_wake(irq);
     else
-      at91_rtc_write(AT91_RTC_IER, at91_rtc_imr);
+      at91_rtc_write_ier(at91_rtc_imr);
   }
   return 0;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IER, e);
+	at91_rtc_write_ier(e);
--- initial
+++ final
@@ -1,18 +1,18 @@
 static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) {
   struct rtc_time tm;
   at91_rtc_decodetime(AT91_RTC_TIMR, AT91_RTC_CALR, &tm);
   at91_alarm_year = tm.tm_year;
   tm.tm_hour = alrm->time.tm_hour;
   tm.tm_min = alrm->time.tm_min;
   tm.tm_sec = alrm->time.tm_sec;
-  at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ALARM);
+  at91_rtc_write_idr(AT91_RTC_ALARM);
   at91_rtc_write(AT91_RTC_TIMALR, bin2bcd(tm.tm_sec) << 0 | bin2bcd(tm.tm_min) << 8 | bin2bcd(tm.tm_hour) << 16 | AT91_RTC_HOUREN | AT91_RTC_MINEN | AT91_RTC_SECEN);
   at91_rtc_write(AT91_RTC_CALALR, bin2bcd(tm.tm_mon + 1) << 16 /* tm_mon starts at zero */
                                       | bin2bcd(tm.tm_mday) << 24 | AT91_RTC_DATEEN | AT91_RTC_MTHEN);
   if (alrm->enabled) {
     at91_rtc_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
-    at91_rtc_write(AT91_RTC_IER, AT91_RTC_ALARM);
+    at91_rtc_write_ier(AT91_RTC_ALARM);
   }
   dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, at91_alarm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
   return 0;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IER, e);
+	at91_rtc_write_ier(e);

@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IDR, e);
+	at91_rtc_write_idr(e);
--- initial
+++ final
@@ -1,20 +1,20 @@
 static int at91_rtc_settime(struct device *dev, struct rtc_time *tm) {
   unsigned long cr;
   dev_dbg(dev, "%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__, 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
   /* Stop Time/Calendar from counting */
   cr = at91_rtc_read(AT91_RTC_CR);
   at91_rtc_write(AT91_RTC_CR, cr | AT91_RTC_UPDCAL | AT91_RTC_UPDTIM);
-  at91_rtc_write(AT91_RTC_IER, AT91_RTC_ACKUPD);
+  at91_rtc_write_ier(AT91_RTC_ACKUPD);
   wait_for_completion(&at91_rtc_updated); /* wait for ACKUPD interrupt */
-  at91_rtc_write(AT91_RTC_IDR, AT91_RTC_ACKUPD);
+  at91_rtc_write_idr(AT91_RTC_ACKUPD);
   at91_rtc_write(AT91_RTC_TIMR, bin2bcd(tm->tm_sec) << 0 | bin2bcd(tm->tm_min) << 8 | bin2bcd(tm->tm_hour) << 16);
   at91_rtc_write(AT91_RTC_CALR, bin2bcd((tm->tm_year + 1900) / 100)   /* century */
                                     | bin2bcd(tm->tm_year % 100) << 8 /* year */
                                     | bin2bcd(tm->tm_mon + 1) << 16   /* tm_mon starts at zero */
                                     | bin2bcd(tm->tm_wday + 1) << 21  /* day of the week [0-6], Sunday=0 */
                                     | bin2bcd(tm->tm_mday) << 24);
   /* Restart Time/Calendar */
   cr = at91_rtc_read(AT91_RTC_CR);
   at91_rtc_write(AT91_RTC_CR, cr & ~(AT91_RTC_UPDCAL | AT91_RTC_UPDTIM));
   return 0;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IER, e);
+	at91_rtc_write_ier(e);

@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IDR, e);
+	at91_rtc_write_idr(e);
--- initial
+++ final
@@ -1,13 +1,13 @@
 static int at91_rtc_suspend(struct device *dev) {
   /* this IRQ is shared with DBGU and other hardware which isn't
    * necessarily doing PM like we are...
    */
-  at91_rtc_imr = at91_rtc_read(AT91_RTC_IMR) & (AT91_RTC_ALARM | AT91_RTC_SECEV);
+  at91_rtc_imr = at91_rtc_read_imr() & (AT91_RTC_ALARM | AT91_RTC_SECEV);
   if (at91_rtc_imr) {
     if (device_may_wakeup(dev))
       enable_irq_wake(irq);
     else
-      at91_rtc_write(AT91_RTC_IDR, at91_rtc_imr);
+      at91_rtc_write_idr(at91_rtc_imr);
   }
   return 0;
 }<sep>@@
expression e;
@@

-	at91_rtc_write(AT91_RTC_IDR, e);
+	at91_rtc_write_idr(e);

@@
@@

- at91_rtc_read(AT91_RTC_IMR)
+ at91_rtc_read_imr()
--- initial
+++ final
@@ -1,16 +1,16 @@
 static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb) {
   int count;
   /*
    * If sg table allocation fails, requeue request later.
    */
   if (unlikely(sg_alloc_table_chained(&sdb->table, blk_rq_nr_phys_segments(req), sdb->table.sgl))) return BLKPREP_DEFER;
   /*
    * Next, walk the list, and fill in the addresses and sizes of
    * each segment.
    */
   count = blk_rq_map_sg(req->q, req, sdb->table.sgl);
   BUG_ON(count > sdb->table.nents);
   sdb->table.nents = count;
-  sdb->length = blk_rq_bytes(req);
+  sdb->length = blk_rq_payload_bytes(req);
   return BLKPREP_OK;
 }<sep>@@
expression e,rq;
@@

-	e = blk_rq_bytes(rq);
+	e = blk_rq_payload_bytes(rq);
--- initial
+++ final
@@ -1,20 +1,20 @@
 static int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req) {
   struct scsi_cmnd *cmd = req->special;
   /*
    * BLOCK_PC requests may transfer data, in which case they must
    * a bio attached to them.  Or they might contain a SCSI command
    * that does not transfer data, in which case they may optionally
    * submit a request without an attached bio.
    */
   if (req->bio) {
     int ret = scsi_init_io(cmd);
     if (unlikely(ret)) return ret;
   } else {
     BUG_ON(blk_rq_bytes(req));
     memset(&cmd->sdb, 0, sizeof(cmd->sdb));
   }
   cmd->cmd_len = req->cmd_len;
-  cmd->transfersize = blk_rq_bytes(req);
+  cmd->transfersize = blk_rq_payload_bytes(req);
   cmd->allowed = req->retries;
   return BLKPREP_OK;
 }<sep>@@
expression e,rq;
@@

-	e = blk_rq_bytes(rq);
+	e = blk_rq_payload_bytes(rq);
--- initial
+++ final
@@ -1,24 +1,24 @@
 static int nvme_rdma_map_data(struct nvme_rdma_queue *queue, struct request *rq, struct nvme_command *c) {
   struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
   struct nvme_rdma_device *dev = queue->device;
   struct ib_device *ibdev = dev->dev;
   int count, ret;
   req->num_sge = 1;
   refcount_set(&req->ref, 2); /* send and recv completions */
   c->common.flags |= NVME_CMD_SGL_METABUF;
-  if (!blk_rq_bytes(rq)) return nvme_rdma_set_sg_null(c);
+  if (!blk_rq_payload_bytes(rq)) return nvme_rdma_set_sg_null(c);
   req->sg_table.sgl = req->first_sgl;
   ret = sg_alloc_table_chained(&req->sg_table, blk_rq_nr_phys_segments(rq), req->sg_table.sgl);
   if (ret) return -ENOMEM;
   req->nents = blk_rq_map_sg(rq->q, rq, req->sg_table.sgl);
   count = ib_dma_map_sg(ibdev, req->sg_table.sgl, req->nents, rq_data_dir(rq) == WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
   if (unlikely(count <= 0)) {
     sg_free_table_chained(&req->sg_table, true);
     return -EIO;
   }
   if (count == 1) {
     if (rq_data_dir(rq) == WRITE && nvme_rdma_queue_idx(queue) && blk_rq_payload_bytes(rq) <= nvme_rdma_inline_data_size(queue)) return nvme_rdma_map_sg_inline(queue, req, c);
     if (dev->pd->flags & IB_PD_UNSAFE_GLOBAL_RKEY) return nvme_rdma_map_sg_single(queue, req, c);
   }
   return nvme_rdma_map_sg_fr(queue, req, c, count);
 }<sep>@@
expression rq;
statement S1,S2;
@@

-	if (!blk_rq_bytes(rq))
+	if (!blk_rq_payload_bytes(rq))
S1
--- initial
+++ final
@@ -1,13 +1,13 @@
 static void nvme_rdma_unmap_data(struct nvme_rdma_queue *queue, struct request *rq) {
   struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
   struct nvme_rdma_device *dev = queue->device;
   struct ib_device *ibdev = dev->dev;
-  if (!blk_rq_bytes(rq)) return;
+  if (!blk_rq_payload_bytes(rq)) return;
   if (req->mr) {
     ib_mr_pool_put(queue->qp, &queue->qp->rdma_mrs, req->mr);
     req->mr = NULL;
   }
   ib_dma_unmap_sg(ibdev, req->sg_table.sgl, req->nents, rq_data_dir(rq) == WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
   nvme_cleanup_cmd(rq);
   sg_free_table_chained(&req->sg_table, true);
 }<sep>@@
expression rq;
statement S1,S2;
@@

-	if (!blk_rq_bytes(rq))
+	if (!blk_rq_payload_bytes(rq))
S1
--- initial
+++ final
@@ -1,29 +1,29 @@
 static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx, const struct blk_mq_queue_data *bd) {
   struct nvme_ns *ns = hctx->queue->queuedata;
   struct nvme_loop_queue *queue = hctx->driver_data;
   struct request *req = bd->rq;
   struct nvme_loop_iod *iod = blk_mq_rq_to_pdu(req);
   blk_status_t ret;
   ret = nvme_loop_is_ready(queue, req);
   if (unlikely(ret)) return ret;
   ret = nvme_setup_cmd(ns, req, &iod->cmd);
   if (ret) return ret;
   iod->cmd.common.flags |= NVME_CMD_SGL_METABUF;
   iod->req.port = nvmet_loop_port;
   if (!nvmet_req_init(&iod->req, &queue->nvme_cq, &queue->nvme_sq, &nvme_loop_ops)) {
     nvme_cleanup_cmd(req);
     blk_mq_start_request(req);
     nvme_loop_queue_response(&iod->req);
     return BLK_STS_OK;
   }
-  if (blk_rq_bytes(req)) {
+  if (blk_rq_payload_bytes(req)) {
     iod->sg_table.sgl = iod->first_sgl;
     if (sg_alloc_table_chained(&iod->sg_table, blk_rq_nr_phys_segments(req), iod->sg_table.sgl)) return BLK_STS_RESOURCE;
     iod->req.sg = iod->sg_table.sgl;
     iod->req.sg_cnt = blk_rq_map_sg(req->q, req, iod->sg_table.sgl);
-    iod->req.transfer_len = blk_rq_bytes(req);
+    iod->req.transfer_len = blk_rq_payload_bytes(req);
   }
   blk_mq_start_request(req);
   schedule_work(&iod->work);
   return BLK_STS_OK;
 }<sep>@@
expression rq;
statement S1,S2;
@@

-	if (blk_rq_bytes(rq))
+	if (blk_rq_payload_bytes(rq))
S1

@@
expression e,rq;
@@

-	e = blk_rq_bytes(rq);
+	e = blk_rq_payload_bytes(rq);
--- initial
+++ final
@@ -1,48 +1,37 @@
 static int bnx2x_get_dump_data(struct net_device *dev, struct ethtool_dump *dump, void *buffer) {
   u32 *p = buffer;
   struct bnx2x *bp = netdev_priv(dev);
   struct dump_header dump_hdr = {0};
   /* Disable parity attentions as long as following dump may
    * cause false alarms by reading never written registers. We
    * will re-enable parity attentions right after the dump.
    */
   /* Disable parity on path 0 */
-  bnx2x_pretend_func(bp, 0);
   bnx2x_disable_blocks_parity(bp);
   /* Disable parity on path 1 */
-  bnx2x_pretend_func(bp, 1);
-  bnx2x_disable_blocks_parity(bp);
-  /* Return to current function */
-  bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
   dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1;
   dump_hdr.preset = bp->dump_preset_idx;
   dump_hdr.version = BNX2X_DUMP_VERSION;
   DP(BNX2X_MSG_ETHTOOL, "Get dump data of preset %d\n", dump_hdr.preset);
   /* dump_meta_data presents OR of CHIP and PATH. */
   if (CHIP_IS_E1(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E1;
   } else if (CHIP_IS_E1H(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E1H;
   } else if (CHIP_IS_E2(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E2 | (BP_PATH(bp) ? DUMP_PATH_1 : DUMP_PATH_0);
   } else if (CHIP_IS_E3A0(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E3A0 | (BP_PATH(bp) ? DUMP_PATH_1 : DUMP_PATH_0);
   } else if (CHIP_IS_E3B0(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E3B0 | (BP_PATH(bp) ? DUMP_PATH_1 : DUMP_PATH_0);
   }
   memcpy(p, &dump_hdr, sizeof(struct dump_header));
   p += dump_hdr.header_size + 1;
   /* Actually read the registers */
   __bnx2x_get_preset_regs(bp, p, dump_hdr.preset);
   /* Re-enable parity attentions on path 0 */
-  bnx2x_pretend_func(bp, 0);
   bnx2x_clear_blocks_parity(bp);
   bnx2x_enable_blocks_parity(bp);
   /* Re-enable parity attentions on path 1 */
-  bnx2x_pretend_func(bp, 1);
-  bnx2x_clear_blocks_parity(bp);
-  bnx2x_enable_blocks_parity(bp);
-  /* Return to current function */
-  bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
   return 0;
 }<sep>@@
expression bp;
@@

-	bnx2x_pretend_func(bp, 0);
 	bnx2x_clear_blocks_parity(bp);
 	bnx2x_enable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, 1);
-	bnx2x_clear_blocks_parity(bp);
-	bnx2x_enable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));

@@
expression bp;
@@

-	bnx2x_pretend_func(bp, 0);
 	bnx2x_disable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, 1);
-	bnx2x_disable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
--- initial
+++ final
@@ -1,49 +1,37 @@
 static void bnx2x_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p) {
   u32 *p = _p;
   struct bnx2x *bp = netdev_priv(dev);
   struct dump_header dump_hdr = {0};
   regs->version = 2;
   memset(p, 0, regs->len);
   if (!netif_running(bp->dev)) return;
   /* Disable parity attentions as long as following dump may
    * cause false alarms by reading never written registers. We
    * will re-enable parity attentions right after the dump.
    */
   /* Disable parity on path 0 */
-  bnx2x_pretend_func(bp, 0);
   bnx2x_disable_blocks_parity(bp);
   /* Disable parity on path 1 */
-  bnx2x_pretend_func(bp, 1);
-  bnx2x_disable_blocks_parity(bp);
-  /* Return to current function */
-  bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
   dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1;
   dump_hdr.preset = DUMP_ALL_PRESETS;
   dump_hdr.version = BNX2X_DUMP_VERSION;
   /* dump_meta_data presents OR of CHIP and PATH. */
   if (CHIP_IS_E1(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E1;
   } else if (CHIP_IS_E1H(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E1H;
   } else if (CHIP_IS_E2(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E2 | (BP_PATH(bp) ? DUMP_PATH_1 : DUMP_PATH_0);
   } else if (CHIP_IS_E3A0(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E3A0 | (BP_PATH(bp) ? DUMP_PATH_1 : DUMP_PATH_0);
   } else if (CHIP_IS_E3B0(bp)) {
     dump_hdr.dump_meta_data = DUMP_CHIP_E3B0 | (BP_PATH(bp) ? DUMP_PATH_1 : DUMP_PATH_0);
   }
   memcpy(p, &dump_hdr, sizeof(struct dump_header));
   p += dump_hdr.header_size + 1;
   /* Actually read the registers */
   __bnx2x_get_regs(bp, p);
   /* Re-enable parity attentions on path 0 */
-  bnx2x_pretend_func(bp, 0);
   bnx2x_clear_blocks_parity(bp);
   bnx2x_enable_blocks_parity(bp);
-  /* Re-enable parity attentions on path 1 */
-  bnx2x_pretend_func(bp, 1);
-  bnx2x_clear_blocks_parity(bp);
-  bnx2x_enable_blocks_parity(bp);
-  /* Return to current function */
-  bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
 }<sep>@@
expression bp;
@@

-	bnx2x_pretend_func(bp, 0);
 	bnx2x_clear_blocks_parity(bp);
 	bnx2x_enable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, 1);
-	bnx2x_clear_blocks_parity(bp);
-	bnx2x_enable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));

@@
expression bp;
@@

-	bnx2x_pretend_func(bp, 0);
 	bnx2x_disable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, 1);
-	bnx2x_disable_blocks_parity(bp);
-	bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));