[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150114.164528.230093054757243054.davem@davemloft.net>
Date: Wed, 14 Jan 2015 16:45:28 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: nicolas.dichtel@...nd.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] socket: use iov_length()
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Date: Wed, 14 Jan 2015 11:07:50 +0100
> @@ -883,10 +883,8 @@ static ssize_t do_sock_read(struct msghdr *msg, struct kiocb *iocb,
> {
> struct socket *sock = file->private_data;
> size_t size = 0;
> - int i;
>
> - for (i = 0; i < nr_segs; i++)
> - size += iov[i].iov_len;
> + size = iov_length(iov, nr_segs);
In both of these cases you can now remove the initialization of size to '0'.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists