]> git.proxmox.com Git - mirror_qemu.git/commit
change iov_* function prototypes to be more appropriate
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 11 Mar 2012 14:05:12 +0000 (18:05 +0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 7 Jun 2012 16:43:38 +0000 (20:43 +0400)
commitdcf6f5e15ecee4f593eeacbe0591c1addc004d92
treecac8cb34bdbab1b91ab48847b38433d476393d88
parent45270ad8a86a80cca4c59dfa73d9a9ee0688d781
change iov_* function prototypes to be more appropriate

Reorder arguments to be more natural, readable and
consistent with other iov_* functions, and change
argument names, from:
 iov_from_buf(iov, iov_cnt, buf, iov_off, size)
to
 iov_from_buf(iov, iov_cnt, offset, buf, bytes)

The result becomes natural English:

 copy data to this `iov' vector with `iov_cnt'
 elements starting at byte offset `offset'
 from memory buffer `buf', processing `bytes'
 bytes max.

(Try to read the original prototype this way).

Also change iov_clear() to more general iov_memset()
(it uses memset() internally anyway).

While at it, add comments to the header file
describing what the routines actually does.

The patch only renames argumens in the header, but
keeps old names in the implementation.  The next
patch will touch actual code to match.

Now, it might look wrong to pay so much attention
to so small things.  But we've so many badly designed
interfaces already so the whole thing becomes rather
confusing or error prone.  One example of this is
previous commit and small discussion which emerged
from it, with an outcome that the utility functions
like these aren't well-understdandable, leading to
strange usage cases.  That's why I paid quite some
attention to this set of functions and a few
others in subsequent patches.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/rtl8139.c
hw/usb/core.c
hw/virtio-balloon.c
hw/virtio-net.c
hw/virtio-serial-bus.c
iov.c
iov.h
net.c