From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8aFH-0004y7-LW for qemu-devel@nongnu.org; Fri, 16 Mar 2012 12:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8aFF-0002K5-80 for qemu-devel@nongnu.org; Fri, 16 Mar 2012 12:43:15 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:57210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8aFE-0002Jw-Qq for qemu-devel@nongnu.org; Fri, 16 Mar 2012 12:43:12 -0400 Message-ID: <4F636D9C.9080600@msgid.tls.msk.ru> Date: Fri, 16 Mar 2012 20:43:08 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1331845217-21705-1-git-send-email-mjt@msgid.tls.msk.ru> <1331845217-21705-10-git-send-email-mjt@msgid.tls.msk.ru> <4F6368A3.5060304@codemonkey.ws> In-Reply-To: <4F6368A3.5060304@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in iov_send() and iov_recv() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org On 16.03.2012 20:21, Anthony Liguori wrote: > On 03/15/2012 04:00 PM, Michael Tokarev wrote: [] >> +ssize_t iov_send_recv(int sockfd, struct iovec *iov, >> + size_t offset, size_t bytes, bool do_send); >> +#define iov_recv(sockfd, iov, offset, bytes) \ >> + iov_send_recv(sockfd, iov, offset, bytes, false) >> +#define iov_send(sockfd, iov, offset, bytes) \ >> + iov_send_recv(sockfd, iov, offset, bytes, true) > > Please use a static inline instead of a macro. Macros make compiler errors/warnings confusing. Macros are good when used properly, and this is one of examples of good usage: no confusion in this case. An example of really confusing macro which were accepted recently is qemu_recv, which not only makes errors/warning confusing, but also makes type checking impossible. I can change these into inline functions, but that just takes much more lines of "code" and more difficult to see what it does. Thanks, /mjt