new helper: memcpy_from_msg()
[deliverable/linux.git] / net / can / bcm.c
index dcb75c0e66c1b69979a88c65efe43084046f8bc2..b9a1f715df18baf83234e919f1dd989b550842d3 100644 (file)
@@ -858,8 +858,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
 
                /* update can_frames content */
                for (i = 0; i < msg_head->nframes; i++) {
-                       err = memcpy_fromiovec((u8 *)&op->frames[i],
-                                              msg->msg_iov, CFSIZ);
+                       err = memcpy_from_msg((u8 *)&op->frames[i], msg, CFSIZ);
 
                        if (op->frames[i].can_dlc > 8)
                                err = -EINVAL;
@@ -894,8 +893,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
                        op->frames = &op->sframe;
 
                for (i = 0; i < msg_head->nframes; i++) {
-                       err = memcpy_fromiovec((u8 *)&op->frames[i],
-                                              msg->msg_iov, CFSIZ);
+                       err = memcpy_from_msg((u8 *)&op->frames[i], msg, CFSIZ);
 
                        if (op->frames[i].can_dlc > 8)
                                err = -EINVAL;
@@ -1024,9 +1022,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
 
                if (msg_head->nframes) {
                        /* update can_frames content */
-                       err = memcpy_fromiovec((u8 *)op->frames,
-                                              msg->msg_iov,
-                                              msg_head->nframes * CFSIZ);
+                       err = memcpy_from_msg((u8 *)op->frames, msg,
+                                             msg_head->nframes * CFSIZ);
                        if (err < 0)
                                return err;
 
@@ -1072,8 +1069,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
                }
 
                if (msg_head->nframes) {
-                       err = memcpy_fromiovec((u8 *)op->frames, msg->msg_iov,
-                                              msg_head->nframes * CFSIZ);
+                       err = memcpy_from_msg((u8 *)op->frames, msg,
+                                             msg_head->nframes * CFSIZ);
                        if (err < 0) {
                                if (op->frames != &op->sframe)
                                        kfree(op->frames);
@@ -1209,7 +1206,7 @@ static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk)
 
        can_skb_reserve(skb);
 
-       err = memcpy_fromiovec(skb_put(skb, CFSIZ), msg->msg_iov, CFSIZ);
+       err = memcpy_from_msg(skb_put(skb, CFSIZ), msg, CFSIZ);
        if (err < 0) {
                kfree_skb(skb);
                return err;
@@ -1285,7 +1282,7 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
 
        /* read message head information */
 
-       ret = memcpy_fromiovec((u8 *)&msg_head, msg->msg_iov, MHSIZ);
+       ret = memcpy_from_msg((u8 *)&msg_head, msg, MHSIZ);
        if (ret < 0)
                return ret;
 
This page took 0.024081 seconds and 5 git commands to generate.