virtio: Silence a -Wunused warning
Remove virtio_swap_endian(). htole*() are nops on little-endian platforms. No functional change intended. MFC after: 1 week Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D37298
This commit is contained in:
parent
3492caf512
commit
db494ceb65
@ -42,20 +42,10 @@
|
|||||||
* and the Host's (device's) endianness when needed.
|
* and the Host's (device's) endianness when needed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline bool
|
|
||||||
virtio_swap_endian(bool modern)
|
|
||||||
{
|
|
||||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
|
||||||
return (false);
|
|
||||||
#else
|
|
||||||
return (modern);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint16_t
|
static inline uint16_t
|
||||||
virtio_htog16(bool modern, uint16_t val)
|
virtio_htog16(bool modern, uint16_t val)
|
||||||
{
|
{
|
||||||
if (virtio_swap_endian(modern))
|
if (modern)
|
||||||
return (le16toh(val));
|
return (le16toh(val));
|
||||||
else
|
else
|
||||||
return (val);
|
return (val);
|
||||||
@ -64,7 +54,7 @@ virtio_htog16(bool modern, uint16_t val)
|
|||||||
static inline uint16_t
|
static inline uint16_t
|
||||||
virtio_gtoh16(bool modern, uint16_t val)
|
virtio_gtoh16(bool modern, uint16_t val)
|
||||||
{
|
{
|
||||||
if (virtio_swap_endian(modern))
|
if (modern)
|
||||||
return (htole16(val));
|
return (htole16(val));
|
||||||
else
|
else
|
||||||
return (val);
|
return (val);
|
||||||
@ -73,7 +63,7 @@ virtio_gtoh16(bool modern, uint16_t val)
|
|||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
virtio_htog32(bool modern, uint32_t val)
|
virtio_htog32(bool modern, uint32_t val)
|
||||||
{
|
{
|
||||||
if (virtio_swap_endian(modern))
|
if (modern)
|
||||||
return (le32toh(val));
|
return (le32toh(val));
|
||||||
else
|
else
|
||||||
return (val);
|
return (val);
|
||||||
@ -82,7 +72,7 @@ virtio_htog32(bool modern, uint32_t val)
|
|||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
virtio_gtoh32(bool modern, uint32_t val)
|
virtio_gtoh32(bool modern, uint32_t val)
|
||||||
{
|
{
|
||||||
if (virtio_swap_endian(modern))
|
if (modern)
|
||||||
return (htole32(val));
|
return (htole32(val));
|
||||||
else
|
else
|
||||||
return (val);
|
return (val);
|
||||||
@ -91,7 +81,7 @@ virtio_gtoh32(bool modern, uint32_t val)
|
|||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
virtio_htog64(bool modern, uint64_t val)
|
virtio_htog64(bool modern, uint64_t val)
|
||||||
{
|
{
|
||||||
if (virtio_swap_endian(modern))
|
if (modern)
|
||||||
return (le64toh(val));
|
return (le64toh(val));
|
||||||
else
|
else
|
||||||
return (val);
|
return (val);
|
||||||
@ -100,7 +90,7 @@ virtio_htog64(bool modern, uint64_t val)
|
|||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
virtio_gtoh64(bool modern, uint64_t val)
|
virtio_gtoh64(bool modern, uint64_t val)
|
||||||
{
|
{
|
||||||
if (virtio_swap_endian(modern))
|
if (modern)
|
||||||
return (htole64(val));
|
return (htole64(val));
|
||||||
else
|
else
|
||||||
return (val);
|
return (val);
|
||||||
|
Loading…
Reference in New Issue
Block a user