[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130930124216.GJ6192@mwanda>
Date: Mon, 30 Sep 2013 15:42:16 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Dominik Paulus <dominik.paulus@....de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Anthony Foiani <anthony.foiani@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...cs.fau.de,
linux-kernel@...r.kernel.org, tobias.polzer@....de,
Ilija Hadzic <ihadzic@...earch.bell-labs.com>
Subject: Re: [PATCHv3 13/16] staging: usbip: Wrap kernel_sendmsg()/recvmsg()
On Sat, Sep 28, 2013 at 07:42:50PM +0200, Dominik Paulus wrote:
> @@ -352,34 +352,29 @@ int usbip_recv(struct socket *sock, void *buf, int size)
>
> usbip_dbg_xmit("enter\n");
>
> - if (!sock || !buf || !size) {
> - pr_err("invalid arg, sock %p buff %p size %d\n", sock, buf,
> + if (!ud || !buf || !size) {
> + pr_err("invalid arg, ud %p buff %p size %d\n", ud, buf,
> size);
"size" can fit on the first line now.
pr_err("invalid arg, ud %p buff %p size %d\n", ud, buf, size);
> return -EINVAL;
> }
>
> - do {
> - sock->sk->sk_allocation = GFP_NOIO;
> - iov.iov_base = buf;
> - iov.iov_len = size;
> - msg.msg_name = NULL;
> - msg.msg_namelen = 0;
> - msg.msg_control = NULL;
> - msg.msg_controllen = 0;
> - msg.msg_namelen = 0;
> - msg.msg_flags = MSG_NOSIGNAL;
> -
> - result = kernel_recvmsg(sock, &msg, &iov, 1, size, MSG_WAITALL);
> - if (result <= 0) {
> - pr_debug("receive sock %p buf %p size %u ret %d total %d\n",
> - sock, buf, size, result, total);
> - goto err;
> - }
> -
> - size -= result;
> - buf += result;
> - total += result;
> - } while (size > 0);
> + ud->tcp_socket->sk->sk_allocation = GFP_NOIO;
> + iov.iov_base = buf;
> + iov.iov_len = size;
> + msg.msg_name = NULL;
> + msg.msg_namelen = 0;
> + msg.msg_control = NULL;
> + msg.msg_controllen = 0;
> + msg.msg_namelen = 0;
> + msg.msg_flags = MSG_NOSIGNAL;
> +
> + result = usbip_recvmsg(ud, &msg, &iov, 1, size, MSG_WAITALL);
> +
Don't put a blank line here.
> + if (result < 0) {
> + pr_debug("receive sock %p buf %p size %u ret %d total %d\n",
> + ud->tcp_socket, buf, size, result, total);
> + return result;
> + }
>
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists