public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Dominik Paulus <dominik.paulus@fau.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Anthony Foiani <anthony.foiani@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@i4.cs.fau.de,
	linux-kernel@vger.kernel.org, tobias.polzer@fau.de,
	Ilija Hadzic <ihadzic@research.bell-labs.com>
Subject: Re: [PATCHv3  13/16] staging: usbip: Wrap kernel_sendmsg()/recvmsg()
Date: Mon, 30 Sep 2013 15:42:16 +0300	[thread overview]
Message-ID: <20130930124216.GJ6192@mwanda> (raw)
In-Reply-To: <1380390173-3746-13-git-send-email-dominik.paulus@fau.de>

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

  reply	other threads:[~2013-09-30 12:43 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13  9:55 [PATCHv2 0/11] staging: usbip: Userland crypto and ACLs Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 01/11] staging: usbip: Fix IPv6 support in usbipd Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 02/11] staging: usbip: Add support for client authentication Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 03/11] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 04/11] staging: usbip: Add CIDR matching helper functions Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 05/11] staging: usbip: Add ACL support to usbip bind Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 06/11] staging: usbip: Add support for ACLs in usbipd Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 07/11] staging: usbip: Add proper error reporting Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 08/11] staging: usbip: Handle usbip being started as user Dominik Paulus
2013-09-13  9:55 ` [PATCHv2 09/11] staging: usbip: Improve debug output Dominik Paulus
2013-09-13  9:56 ` [PATCHv2 10/11] staging: usbip: Separate protocol/program version Dominik Paulus
2013-09-13  9:56 ` [PATCHv2 11/11] staging: usbip: Increment version to 1.2.0 Dominik Paulus
2013-09-25 23:36 ` [PATCHv2 0/11] staging: usbip: Userland crypto and ACLs Greg Kroah-Hartman
2013-09-28 17:41   ` Dominik Paulus
2013-09-28 17:42   ` [PATCHv3 01/16] staging: usbip: Add support for client authentication Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 02/16] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-09-30  8:29       ` Dan Carpenter
2013-09-28 17:42     ` [PATCHv3 03/16] staging: usbip: Add CIDR matching helper functions Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 04/16] staging: usbip: Add ACL support to usbip bind Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 05/16] staging: usbip: Add support for ACLs in usbipd Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 06/16] staging: usbip: Add proper error reporting Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 07/16] staging: usbip: Handle usbip being started as user Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 08/16] staging: usbip: Improve debug output Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 09/16] staging: usbip: Separate protocol/program version Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 10/16] staging: usbip: TLS for all userspace communication Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 11/16] staging: usbip: Exchange session keys in userspace Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 12/16] staging: usbip: Pass session keys to the kernel Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 13/16] staging: usbip: Wrap kernel_sendmsg()/recvmsg() Dominik Paulus
2013-09-30 12:42       ` Dan Carpenter [this message]
2013-09-28 17:42     ` [PATCHv3 14/16] staging: usbip: Add encryption support to kernel Dominik Paulus
2013-09-30 12:38       ` Dan Carpenter
2013-10-19 14:39         ` [PATCHv4 00/16] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 01/16] staging: usbip: Add support for client authentication Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 02/16] staging: usbip: Add kernel support for client ACLs Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 03/16] staging: usbip: Add CIDR matching helper functions Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 04/16] staging: usbip: Add ACL support to usbip bind Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 05/16] staging: usbip: Add support for ACLs in usbipd Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 06/16] staging: usbip: Add proper error reporting Dominik Paulus
2013-10-25 13:26             ` Dan Carpenter
2013-10-19 14:39           ` [PATCHv4 07/16] staging: usbip: Handle usbip being started as user Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 08/16] staging: usbip: Improve debug output Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 09/16] staging: usbip: Separate protocol/program version Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 10/16] staging: usbip: TLS for all userspace communication Dominik Paulus
2013-10-25 14:45             ` Dan Carpenter
2013-10-19 14:39           ` [PATCHv4 11/16] staging: usbip: Exchange session keys in userspace Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 12/16] staging: usbip: Pass session keys to the kernel Dominik Paulus
2013-10-25 15:02             ` Dan Carpenter
2013-10-19 14:39           ` [PATCHv4 13/16] staging: usbip: Wrap kernel_sendmsg()/recvmsg() Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 14/16] staging: usbip: Add encryption support to kernel Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 15/16] staging: usbip: Update documentation Dominik Paulus
2013-10-19 14:39           ` [PATCHv4 16/16] staging: usbip: Increment version number to 1.2.1 Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 15/16] staging: usbip: Update documentation Dominik Paulus
2013-09-28 17:42     ` [PATCHv3 16/16] staging: usbip: Increment version number to 1.2.1 Dominik Paulus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130930124216.GJ6192@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=anthony.foiani@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dominik.paulus@fau.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=ihadzic@research.bell-labs.com \
    --cc=linux-kernel@i4.cs.fau.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tobias.polzer@fau.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox