imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,16 +1,15 @@
 static int set_tcb_field(struct adapter *adap, struct filter_entry *f, unsigned int ftid, u16 word, u64 mask, u64 val, int no_reply) {
   struct cpl_set_tcb_field *req;
   struct sk_buff *skb;
   skb = alloc_skb(sizeof(struct cpl_set_tcb_field), GFP_ATOMIC);
   if (!skb) return -ENOMEM;
-  req = (struct cpl_set_tcb_field *)__skb_put(skb, sizeof(*req));
-  memset(req, 0, sizeof(*req));
+  req = (struct cpl_set_tcb_field *)__skb_put_zero(skb, sizeof(*req));
   INIT_TP_WR_CPL(req, CPL_SET_TCB_FIELD, ftid);
   req->reply_ctrl = htons(REPLY_CHAN_V(0) | QUEUENO_V(adap->sge.fw_evtq.abs_id) | NO_REPLY_V(no_reply));
   req->word_cookie = htons(TCB_WORD_V(word) | TCB_COOKIE_V(ftid));
   req->mask = cpu_to_be64(mask);
   req->val = cpu_to_be64(val);
   set_wr_txq(skb, CPL_PRIORITY_CONTROL, f->fs.val.iport & 0x3);
   t4_ofld_send(adap, skb);
   return 0;
 }<sep>@@
expression skb,len,req;
type T;
@@

	req = (T)
-	__skb_put
+	__skb_put_zero
	  (skb, len);
	...
-	memset(req, 0, len);
--- initial
+++ final
@@ -1,29 +1,28 @@
 int cxgb4_get_srq_entry(struct net_device *dev, int srq_idx, struct srq_entry *entryp) {
   struct cpl_srq_table_req *req;
   struct adapter *adap;
   struct sk_buff *skb;
   struct srq_data *s;
   int rc = -ENODEV;
   adap = netdev2adap(dev);
   s = adap->srq;
   if (!(adap->flags & FULL_INIT_DONE) || !s) goto out;
   skb = alloc_skb(sizeof(*req), GFP_KERNEL);
   if (!skb) return -ENOMEM;
-  req = (struct cpl_srq_table_req *)__skb_put(skb, sizeof(*req));
-  memset(req, 0, sizeof(*req));
+  req = (struct cpl_srq_table_req *)__skb_put_zero(skb, sizeof(*req));
   INIT_TP_WR(req, 0);
   OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SRQ_TABLE_REQ, TID_TID_V(srq_idx) | TID_QID_V(adap->sge.fw_evtq.abs_id)));
   req->idx = srq_idx;
   mutex_lock(&s->lock);
   s->entryp = entryp;
   t4_mgmt_tx(adap, skb);
   rc = wait_for_completion_timeout(&s->comp, SRQ_WAIT_TO);
   if (rc)
     rc = 0;
   else /* !rc means we timed out */
     rc = -ETIMEDOUT;
   WARN_ON_ONCE(entryp->idx != srq_idx);
   mutex_unlock(&s->lock);
 out:
   return rc;
 }<sep>@@
expression skb,len,req;
type T;
@@

	req = (T)
-	__skb_put
+	__skb_put_zero
	  (skb, len);
	...
-	memset(req, 0, len);
--- initial
+++ final
@@ -1,22 +1,21 @@
 static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe, gfp_t gfp) {
   struct fw_ri_wr *wqe;
   struct sk_buff *skb;
   struct terminate_message *term;
   pr_debug("qhp %p qid 0x%x tid %u\n", qhp, qhp->wq.sq.qid, qhp->ep->hwtid);
   skb = skb_dequeue(&qhp->ep->com.ep_skb_list);
   if (WARN_ON(!skb)) return;
   set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
-  wqe = __skb_put(skb, sizeof(*wqe));
-  memset(wqe, 0, sizeof *wqe);
+  wqe = __skb_put_zero(skb, sizeof(*wqe));
   wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR));
   wqe->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(qhp->ep->hwtid) | FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*wqe), 16)));
   wqe->u.terminate.type = FW_RI_TYPE_TERMINATE;
   wqe->u.terminate.immdlen = cpu_to_be32(sizeof *term);
   term = (struct terminate_message *)wqe->u.terminate.termmsg;
   if (qhp->attr.layer_etype == (LAYER_MPA | DDP_LLP)) {
     term->layer_etype = qhp->attr.layer_etype;
     term->ecode = qhp->attr.ecode;
   } else
     build_term_codes(err_cqe, &term->layer_etype, &term->ecode);
   c4iw_ofld_send(&qhp->rhp->rdev, skb);
 }<sep>@@
expression skb,req;
type T;
@@

	req = (T)
-	__skb_put
+	__skb_put_zero
	  (skb, sizeof(*req));
	...
-	memset(req, 0, sizeof *req);
--- initial
+++ final
@@ -1,18 +1,17 @@
 static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp, struct c4iw_ep *ep) {
   struct fw_ri_wr *wqe;
   int ret;
   struct sk_buff *skb;
   pr_debug("qhp %p qid 0x%x tid %u\n", qhp, qhp->wq.sq.qid, ep->hwtid);
   skb = skb_dequeue(&ep->com.ep_skb_list);
   if (WARN_ON(!skb)) return -ENOMEM;
   set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx);
-  wqe = __skb_put(skb, sizeof(*wqe));
-  memset(wqe, 0, sizeof *wqe);
+  wqe = __skb_put_zero(skb, sizeof(*wqe));
   wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR) | FW_WR_COMPL_F);
   wqe->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(ep->hwtid) | FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*wqe), 16)));
   wqe->cookie = (uintptr_t)ep->com.wr_waitp;
   wqe->u.fini.type = FW_RI_TYPE_FINI;
   ret = c4iw_ref_send_wait(&rhp->rdev, skb, ep->com.wr_waitp, qhp->ep->hwtid, qhp->wq.sq.qid, __func__);
   pr_debug("ret %d\n", ret);
   return ret;
 }<sep>@@
expression skb,req;
type T;
@@

	req = (T)
-	__skb_put
+	__skb_put_zero
	  (skb, sizeof(*req));
	...
-	memset(req, 0, sizeof *req);
--- initial
+++ final
@@ -1,51 +1,50 @@
 static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp) {
   struct fw_ri_wr *wqe;
   int ret;
   struct sk_buff *skb;
   pr_debug("qhp %p qid 0x%x tid %u ird %u ord %u\n", qhp, qhp->wq.sq.qid, qhp->ep->hwtid, qhp->ep->ird, qhp->ep->ord);
   skb = alloc_skb(sizeof *wqe, GFP_KERNEL);
   if (!skb) {
     ret = -ENOMEM;
     goto out;
   }
   ret = alloc_ird(rhp, qhp->attr.max_ird);
   if (ret) {
     qhp->attr.max_ird = 0;
     kfree_skb(skb);
     goto out;
   }
   set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
-  wqe = __skb_put(skb, sizeof(*wqe));
-  memset(wqe, 0, sizeof *wqe);
+  wqe = __skb_put_zero(skb, sizeof(*wqe));
   wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR) | FW_WR_COMPL_F);
   wqe->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(qhp->ep->hwtid) | FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*wqe), 16)));
   wqe->cookie = (uintptr_t)qhp->ep->com.wr_waitp;
   wqe->u.init.type = FW_RI_TYPE_INIT;
   wqe->u.init.mpareqbit_p2ptype = FW_RI_WR_MPAREQBIT_V(qhp->attr.mpa_attr.initiator) | FW_RI_WR_P2PTYPE_V(qhp->attr.mpa_attr.p2p_type);
   wqe->u.init.mpa_attrs = FW_RI_MPA_IETF_ENABLE;
   if (qhp->attr.mpa_attr.recv_marker_enabled) wqe->u.init.mpa_attrs |= FW_RI_MPA_RX_MARKER_ENABLE;
   if (qhp->attr.mpa_attr.xmit_marker_enabled) wqe->u.init.mpa_attrs |= FW_RI_MPA_TX_MARKER_ENABLE;
   if (qhp->attr.mpa_attr.crc_enabled) wqe->u.init.mpa_attrs |= FW_RI_MPA_CRC_ENABLE;
   wqe->u.init.qp_caps = FW_RI_QP_RDMA_READ_ENABLE | FW_RI_QP_RDMA_WRITE_ENABLE | FW_RI_QP_BIND_ENABLE;
   if (!qhp->ibqp.uobject) wqe->u.init.qp_caps |= FW_RI_QP_FAST_REGISTER_ENABLE | FW_RI_QP_STAG0_ENABLE;
   wqe->u.init.nrqe = cpu_to_be16(t4_rqes_posted(&qhp->wq));
   wqe->u.init.pdid = cpu_to_be32(qhp->attr.pd);
   wqe->u.init.qpid = cpu_to_be32(qhp->wq.sq.qid);
   wqe->u.init.sq_eqid = cpu_to_be32(qhp->wq.sq.qid);
   wqe->u.init.rq_eqid = cpu_to_be32(qhp->wq.rq.qid);
   wqe->u.init.scqid = cpu_to_be32(qhp->attr.scq);
   wqe->u.init.rcqid = cpu_to_be32(qhp->attr.rcq);
   wqe->u.init.ord_max = cpu_to_be32(qhp->attr.max_ord);
   wqe->u.init.ird_max = cpu_to_be32(qhp->attr.max_ird);
   wqe->u.init.iss = cpu_to_be32(qhp->ep->snd_seq);
   wqe->u.init.irs = cpu_to_be32(qhp->ep->rcv_seq);
   wqe->u.init.hwrqsize = cpu_to_be32(qhp->wq.rq.rqt_size);
   wqe->u.init.hwrqaddr = cpu_to_be32(qhp->wq.rq.rqt_hwaddr - rhp->rdev.lldi.vr->rq.start);
   if (qhp->attr.mpa_attr.initiator) build_rtr_msg(qhp->attr.mpa_attr.p2p_type, &wqe->u.init);
   ret = c4iw_ref_send_wait(&rhp->rdev, skb, qhp->ep->com.wr_waitp, qhp->ep->hwtid, qhp->wq.sq.qid, __func__);
   if (!ret) goto out;
   free_ird(rhp, qhp->attr.max_ird);
 out:
   pr_debug("ret %d\n", ret);
   return ret;
 }<sep>@@
expression skb,req;
type T;
@@

	req = (T)
-	__skb_put
+	__skb_put_zero
	  (skb, sizeof(*req));
	...
-	memset(req, 0, sizeof *req);
--- initial
+++ final
@@ -1,29 +1,28 @@
 struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av, int paylen, struct rxe_pkt_info *pkt) {
   unsigned int hdr_len;
   struct sk_buff *skb;
   struct net_device *ndev;
   const int port_num = 1;
   ndev = rxe_netdev_from_av(rxe, port_num, av);
   if (av->network_type == RDMA_NETWORK_IPV4)
     hdr_len = ETH_HLEN + sizeof(struct udphdr) + sizeof(struct iphdr);
   else
     hdr_len = ETH_HLEN + sizeof(struct udphdr) + sizeof(struct ipv6hdr);
   skb = alloc_skb(paylen + hdr_len + LL_RESERVED_SPACE(ndev), GFP_ATOMIC);
   if (unlikely(!skb)) {
     dev_put(ndev);
     return NULL;
   }
   skb_reserve(skb, hdr_len + LL_RESERVED_SPACE(rxe->ndev));
   skb->dev = ndev;
   if (av->network_type == RDMA_NETWORK_IPV4)
     skb->protocol = htons(ETH_P_IP);
   else
     skb->protocol = htons(ETH_P_IPV6);
   pkt->rxe = rxe;
   pkt->port_num = port_num;
-  pkt->hdr = skb_put(skb, paylen);
+  pkt->hdr = skb_put_zero(skb, paylen);
   pkt->mask |= RXE_GRH_MASK;
-  memset(pkt->hdr, 0, paylen);
   dev_put(ndev);
   return skb;
 }<sep>@@
expression skb,len,req;
type T;
@@

	req = (T)
-	skb_put
+	skb_put_zero
	  (skb, len);
	...
-	memset(req, 0, len);
--- initial
+++ final
@@ -1,13 +1,13 @@
 static int mt2701_afe_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) {
-  struct mtk_base_afe *afe = dev_get_drvdata(dai->dev);
+  struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
   struct mt2701_afe_private *afe_priv = afe->platform_priv;
   int i2s_num = mt2701_dai_num_to_i2s(afe, dai->id);
   if (i2s_num < 0) return i2s_num;
   /* mclk */
   if (dir == SND_SOC_CLOCK_IN) {
     dev_warn(dai->dev, "%s() warning: mt2701 doesn't support mclk input\n", __func__);
     return -EINVAL;
   }
   afe_priv->i2s_path[i2s_num].mclk_rate = freq;
   return 0;
 }<sep>@@
identifier f,dai,afe;
expression substream;
@@

f(...,struct snd_soc_dai *dai,...) {
  ...
- struct mtk_base_afe *afe = dev_get_drvdata(dai->dev);
+ struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
  ...
}
--- initial
+++ final
@@ -1,13 +1,13 @@
 int mtk_afe_dai_resume(struct snd_soc_dai *dai) {
-  struct mtk_base_afe *afe = dev_get_drvdata(dai->dev);
+  struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
   struct device *dev = afe->dev;
   struct regmap *regmap = afe->regmap;
   int i = 0;
   if (pm_runtime_status_suspended(dev) || !afe->suspended) return 0;
   afe->runtime_resume(dev);
   if (!afe->reg_back_up) dev_dbg(dev, "%s no reg_backup\n", __func__);
   for (i = 0; i < afe->reg_back_up_list_num; i++)
     mtk_regmap_write(regmap, afe->reg_back_up_list[i], afe->reg_back_up[i]);
   afe->suspended = false;
   return 0;
 }<sep>@@
identifier f,dai,afe;
expression substream;
@@

f(...,struct snd_soc_dai *dai,...) {
  ...
- struct mtk_base_afe *afe = dev_get_drvdata(dai->dev);
+ struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
  ...
}
--- initial
+++ final
@@ -1,13 +1,13 @@
 int mtk_afe_dai_suspend(struct snd_soc_dai *dai) {
-  struct mtk_base_afe *afe = dev_get_drvdata(dai->dev);
+  struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
   struct device *dev = afe->dev;
   struct regmap *regmap = afe->regmap;
   int i;
   if (pm_runtime_status_suspended(dev) || afe->suspended) return 0;
   if (!afe->reg_back_up) afe->reg_back_up = devm_kcalloc(dev, afe->reg_back_up_list_num, sizeof(unsigned int), GFP_KERNEL);
   for (i = 0; i < afe->reg_back_up_list_num; i++)
     regmap_read(regmap, afe->reg_back_up_list[i], &afe->reg_back_up[i]);
   afe->suspended = true;
   afe->runtime_suspend(dev);
   return 0;
 }<sep>@@
identifier f,dai,afe;
expression substream;
@@

f(...,struct snd_soc_dai *dai,...) {
  ...
- struct mtk_base_afe *afe = dev_get_drvdata(dai->dev);
+ struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
  ...
}
--- initial
+++ final
@@ -1,37 +1,35 @@
 static int dsa_slave_add_cls_matchall(struct net_device *dev, struct tc_cls_matchall_offload *cls, bool ingress) {
   struct dsa_port *dp = dsa_slave_to_port(dev);
   struct dsa_slave_priv *p = netdev_priv(dev);
   struct dsa_mall_tc_entry *mall_tc_entry;
   __be16 protocol = cls->common.protocol;
   struct dsa_switch *ds = dp->ds;
   struct net_device *to_dev;
   const struct tc_action *a;
   struct dsa_port *to_dp;
   int err = -EOPNOTSUPP;
-  LIST_HEAD(actions);
   if (!ds->ops->port_mirror_add) return err;
   if (!tcf_exts_has_one_action(cls->exts)) return err;
-  tcf_exts_to_list(cls->exts, &actions);
-  a = list_first_entry(&actions, struct tc_action, list);
+  a = tcf_exts_first_action(cls->exts);
   if (is_tcf_mirred_egress_mirror(a) && protocol == htons(ETH_P_ALL)) {
     struct dsa_mall_mirror_tc_entry *mirror;
     to_dev = tcf_mirred_dev(a);
     if (!to_dev) return -EINVAL;
     if (!dsa_slave_dev_check(to_dev)) return -EOPNOTSUPP;
     mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
     if (!mall_tc_entry) return -ENOMEM;
     mall_tc_entry->cookie = cls->cookie;
     mall_tc_entry->type = DSA_PORT_MALL_MIRROR;
     mirror = &mall_tc_entry->mirror;
     to_dp = dsa_slave_to_port(to_dev);
     mirror->to_local_port = to_dp->index;
     mirror->ingress = ingress;
     err = ds->ops->port_mirror_add(ds, dp->index, mirror, ingress);
     if (err) {
       kfree(mall_tc_entry);
       return err;
     }
     list_add_tail(&mall_tc_entry->list, &p->mall_tc_list);
   }
   return 0;
 }<sep>@@
identifier actions;
expression a,exts;
@@

-	LIST_HEAD(actions);
	...
-       tcf_exts_to_list(exts, &actions);
-       a = list_first_entry(&actions, struct tc_action, list);
+       a = tcf_exts_first_action(exts);
--- initial
+++ final
@@ -1,33 +1,31 @@
 static int mlxsw_sp_port_add_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port, struct tc_cls_matchall_offload *f, bool ingress) {
   struct mlxsw_sp_port_mall_tc_entry *mall_tc_entry;
   __be16 protocol = f->common.protocol;
   const struct tc_action *a;
-  LIST_HEAD(actions);
   int err;
   if (!tcf_exts_has_one_action(f->exts)) {
     netdev_err(mlxsw_sp_port->dev, "only singular actions are supported\n");
     return -EOPNOTSUPP;
   }
   mall_tc_entry = kzalloc(sizeof(*mall_tc_entry), GFP_KERNEL);
   if (!mall_tc_entry) return -ENOMEM;
   mall_tc_entry->cookie = f->cookie;
-  tcf_exts_to_list(f->exts, &actions);
-  a = list_first_entry(&actions, struct tc_action, list);
+  a = tcf_exts_first_action(f->exts);
   if (is_tcf_mirred_egress_mirror(a) && protocol == htons(ETH_P_ALL)) {
     struct mlxsw_sp_port_mall_mirror_tc_entry *mirror;
     mall_tc_entry->type = MLXSW_SP_PORT_MALL_MIRROR;
     mirror = &mall_tc_entry->mirror;
     err = mlxsw_sp_port_add_cls_matchall_mirror(mlxsw_sp_port, mirror, a, ingress);
   } else if (is_tcf_sample(a) && protocol == htons(ETH_P_ALL)) {
     mall_tc_entry->type = MLXSW_SP_PORT_MALL_SAMPLE;
     err = mlxsw_sp_port_add_cls_matchall_sample(mlxsw_sp_port, f, a, ingress);
   } else {
     err = -EOPNOTSUPP;
   }
   if (err) goto err_add_action;
   list_add_tail(&mall_tc_entry->list, &mlxsw_sp_port->mall_tc_list);
   return 0;
 err_add_action:
   kfree(mall_tc_entry);
   return err;
 }<sep>@@
identifier actions;
expression a,exts;
@@

-	LIST_HEAD(actions);
	...
-       tcf_exts_to_list(exts, &actions);
-       a = list_first_entry(&actions, struct tc_action, list);
+       a = tcf_exts_first_action(exts);
--- initial
+++ final
@@ -1,4 +1,4 @@
 static void ulite_console_putchar(struct uart_port *port, int ch) {
   ulite_console_wait_tx(port);
-  iowrite32be(ch, port->membase + ULITE_TX);
+  uart_out32(ch, ULITE_TX, port);
 }<sep>@@
expression e1,e2,port;
@@

-       iowrite32be(e1, port->membase + e2);
+       uart_out32(e1, e2, port);
--- initial
+++ final
@@ -1,18 +1,18 @@
 static void ulite_console_write(struct console *co, const char *s, unsigned int count) {
   struct uart_port *port = &ulite_ports[co->index];
   unsigned long flags;
   unsigned int ier;
   int locked = 1;
   if (oops_in_progress) {
     locked = spin_trylock_irqsave(&port->lock, flags);
   } else
     spin_lock_irqsave(&port->lock, flags);
   /* save and disable interrupt */
-  ier = ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
-  iowrite32be(0, port->membase + ULITE_CONTROL);
+  ier = uart_in32(ULITE_STATUS, port) & ULITE_STATUS_IE;
+  uart_out32(0, ULITE_CONTROL, port);
   uart_console_write(port, s, count, ulite_console_putchar);
   ulite_console_wait_tx(port);
   /* restore interrupt state */
-  if (ier) iowrite32be(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
+  if (ier) uart_out32(ULITE_CONTROL_IE, ULITE_CONTROL, port);
   if (locked) spin_unlock_irqrestore(&port->lock, flags);
 }<sep>@@
expression port,e;
@@


- ioread32be(port->membase + e)
+ uart_in32(e, port)

@@
expression e1,e2,port;
@@

-       iowrite32be(e1, port->membase + e2);
+       uart_out32(e1, e2, port);
--- initial
+++ final
@@ -1,6 +1,6 @@
 static void ulite_put_poll_char(struct uart_port *port, unsigned char ch) {
-  while (ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL)
+  while (uart_in32(ULITE_STATUS, port) & ULITE_STATUS_TXFULL)
     cpu_relax();
   /* write char to device */
-  iowrite32be(ch, port->membase + ULITE_TX);
+  uart_out32(ch, ULITE_TX, port);
 }<sep>@@
expression port,e;
@@


- ioread32be(port->membase + e)
+ uart_in32(e, port)

@@
expression e1,e2,port;
@@

-       iowrite32be(e1, port->membase + e2);
+       uart_out32(e1, e2, port);
--- initial
+++ final
@@ -1,5 +1,5 @@
 static void ulite_shutdown(struct uart_port *port) {
-  iowrite32be(0, port->membase + ULITE_CONTROL);
-  ioread32be(port->membase + ULITE_CONTROL); /* dummy */
+  uart_out32(0, ULITE_CONTROL, port);
+  uart_in32(ULITE_CONTROL, port); /* dummy */
   free_irq(port->irq, port);
 }<sep>@@
expression port,e;
@@


- ioread32be(port->membase + e)
+ uart_in32(e, port)

@@
expression e1,e2,port;
@@

-       iowrite32be(e1, port->membase + e2);
+       uart_out32(e1, e2, port);
--- initial
+++ final
@@ -1,8 +1,8 @@
 static int ulite_startup(struct uart_port *port) {
   int ret;
   ret = request_irq(port->irq, ulite_isr, IRQF_SHARED, "uartlite", port);
   if (ret) return ret;
-  iowrite32be(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX, port->membase + ULITE_CONTROL);
-  iowrite32be(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);
+  uart_out32(ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX, ULITE_CONTROL, port);
+  uart_out32(ULITE_CONTROL_IE, ULITE_CONTROL, port);
   return 0;
 }<sep>@@
expression e1,e2,port;
@@

-       iowrite32be(e1, port->membase + e2);
+       uart_out32(e1, e2, port);
--- initial
+++ final
@@ -1,17 +1,17 @@
 static int ulite_transmit(struct uart_port *port, int stat) {
   struct circ_buf *xmit = &port->state->xmit;
   if (stat & ULITE_STATUS_TXFULL) return 0;
   if (port->x_char) {
-    iowrite32be(port->x_char, port->membase + ULITE_TX);
+    uart_out32(port->x_char, ULITE_TX, port);
     port->x_char = 0;
     port->icount.tx++;
     return 1;
   }
   if (uart_circ_empty(xmit) || uart_tx_stopped(port)) return 0;
-  iowrite32be(xmit->buf[xmit->tail], port->membase + ULITE_TX);
+  uart_out32(xmit->buf[xmit->tail], ULITE_TX, port);
   xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
   port->icount.tx++;
   /* wake up */
   if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port);
   return 1;
 }<sep>@@
expression e1,e2,port;
@@

-       iowrite32be(e1, port->membase + e2);
+       uart_out32(e1, e2, port);
--- initial
+++ final
@@ -1,33 +1,32 @@
 static int c_can_read_msg_object(struct net_device *dev, int iface, u32 ctrl) {
   struct net_device_stats *stats = &dev->stats;
   struct c_can_priv *priv = netdev_priv(dev);
   struct can_frame *frame;
   struct sk_buff *skb;
   u32 arb, data;
   skb = alloc_can_skb(dev, &frame);
   if (!skb) {
     stats->rx_dropped++;
     return -ENOMEM;
   }
   frame->can_dlc = get_can_dlc(ctrl & 0x0F);
-  arb = priv->read_reg(priv, C_CAN_IFACE(ARB1_REG, iface));
-  arb |= priv->read_reg(priv, C_CAN_IFACE(ARB2_REG, iface)) << 16;
+  arb = priv->read_reg32(priv, C_CAN_IFACE(ARB1_REG, iface));
   if (arb & IF_ARB_MSGXTD)
     frame->can_id = (arb & CAN_EFF_MASK) | CAN_EFF_FLAG;
   else
     frame->can_id = (arb >> 18) & CAN_SFF_MASK;
   if (arb & IF_ARB_TRANSMIT) {
     frame->can_id |= CAN_RTR_FLAG;
   } else {
     int i, dreg = C_CAN_IFACE(DATA1_REG, iface);
     for (i = 0; i < frame->can_dlc; i += 2, dreg++) {
       data = priv->read_reg(priv, dreg);
       frame->data[i] = data;
       frame->data[i + 1] = data >> 8;
     }
   }
   stats->rx_packets++;
   stats->rx_bytes += frame->can_dlc;
   netif_receive_skb(skb);
   return 0;
 }<sep>@@
expression e,e1,e2,m1,m2;
@@

-	e = e1->read_reg(e1, C_CAN_IFACE(m1, e2));
-	e |= e1->read_reg(e1, C_CAN_IFACE(m2, e2)) << 16;
+	e = e1->read_reg32(e1, C_CAN_IFACE(m1, e2));
--- initial
+++ final
@@ -1,11 +1,9 @@
 static void c_can_setup_receive_object(struct net_device *dev, int iface, u32 obj, u32 mask, u32 id, u32 mcont) {
   struct c_can_priv *priv = netdev_priv(dev);
   mask |= BIT(29);
-  priv->write_reg(priv, C_CAN_IFACE(MASK1_REG, iface), mask);
-  priv->write_reg(priv, C_CAN_IFACE(MASK2_REG, iface), mask >> 16);
+  priv->write_reg32(priv, C_CAN_IFACE(MASK1_REG, iface), mask);
   id |= IF_ARB_MSGVAL;
-  priv->write_reg(priv, C_CAN_IFACE(ARB1_REG, iface), id);
-  priv->write_reg(priv, C_CAN_IFACE(ARB2_REG, iface), id >> 16);
+  priv->write_reg32(priv, C_CAN_IFACE(ARB1_REG, iface), id);
   priv->write_reg(priv, C_CAN_IFACE(MSGCTRL_REG, iface), mcont);
   c_can_object_put(dev, iface, obj, IF_COMM_RCV_SETUP);
 }<sep>@@
expression e1,e2,e3,m1,m2;
@@

-	e1->write_reg(e1, C_CAN_IFACE(m1, e2), e3);
-	e1->write_reg(e1, C_CAN_IFACE(m2, e2), e3 >> 16);
+	e1->write_reg32(e1, C_CAN_IFACE(m1, e2), e3);
--- initial
+++ final
@@ -1,29 +1,28 @@
 static void c_can_setup_tx_object(struct net_device *dev, int iface, struct can_frame *frame, int idx) {
   struct c_can_priv *priv = netdev_priv(dev);
   u16 ctrl = IF_MCONT_TX | frame->can_dlc;
   bool rtr = frame->can_id & CAN_RTR_FLAG;
   u32 arb = IF_ARB_MSGVAL;
   int i;
   if (frame->can_id & CAN_EFF_FLAG) {
     arb |= frame->can_id & CAN_EFF_MASK;
     arb |= IF_ARB_MSGXTD;
   } else {
     arb |= (frame->can_id & CAN_SFF_MASK) << 18;
   }
   if (!rtr) arb |= IF_ARB_TRANSMIT;
   /*
    * If we change the DIR bit, we need to invalidate the buffer
    * first, i.e. clear the MSGVAL flag in the arbiter.
    */
   if (rtr != (bool)test_bit(idx, &priv->tx_dir)) {
     u32 obj = idx + C_CAN_MSG_OBJ_TX_FIRST;
     c_can_inval_msg_object(dev, iface, obj);
     change_bit(idx, &priv->tx_dir);
   }
-  priv->write_reg(priv, C_CAN_IFACE(ARB1_REG, iface), arb);
-  priv->write_reg(priv, C_CAN_IFACE(ARB2_REG, iface), arb >> 16);
+  priv->write_reg32(priv, C_CAN_IFACE(ARB1_REG, iface), arb);
   priv->write_reg(priv, C_CAN_IFACE(MSGCTRL_REG, iface), ctrl);
   for (i = 0; i < frame->can_dlc; i += 2) {
     priv->write_reg(priv, C_CAN_IFACE(DATA1_REG, iface) + i / 2, frame->data[i] | (frame->data[i + 1] << 8));
   }
 }<sep>@@
expression e1,e2,e3,m1,m2;
@@

-	e1->write_reg(e1, C_CAN_IFACE(m1, e2), e3);
-	e1->write_reg(e1, C_CAN_IFACE(m2, e2), e3 >> 16);
+	e1->write_reg32(e1, C_CAN_IFACE(m1, e2), e3);
--- initial
+++ final
@@ -1,35 +1,33 @@
 void consistent_free(size_t size, void *vaddr) {
   struct page *page;
   if (in_interrupt()) BUG();
   size = PAGE_ALIGN(size);
 #ifndef CONFIG_MMU
   /* Clear SHADOW_MASK bit in address, and free as per usual */
 #ifdef CONFIG_XILINX_UNCACHED_SHADOW
   vaddr = (void *)((unsigned)vaddr & ~UNCACHED_SHADOW_MASK);
 #endif
   page = virt_to_page(vaddr);
   do {
-    ClearPageReserved(page);
-    __free_page(page);
+    __free_reserved_page(page);
     page++;
   } while (size -= PAGE_SIZE);
 #else
   do {
     pte_t *ptep;
     unsigned long pfn;
     ptep = pte_offset_kernel(pmd_offset(pgd_offset_k((unsigned int)vaddr), (unsigned int)vaddr), (unsigned int)vaddr);
     if (!pte_none(*ptep) && pte_present(*ptep)) {
       pfn = pte_pfn(*ptep);
       pte_clear(&init_mm, (unsigned int)vaddr, ptep);
       if (pfn_valid(pfn)) {
         page = pfn_to_page(pfn);
-        ClearPageReserved(page);
-        __free_page(page);
+        __free_reserved_page(page);
       }
     }
     vaddr += PAGE_SIZE;
   } while (size -= PAGE_SIZE);
   /* flush tlb */
   flush_tlb_all();
 #endif
 }<sep>@@
expression page;
@@

-				ClearPageReserved(page);
-				__free_page(page);
+				__free_reserved_page(page);