Page MenuHomeFreeBSD

virtio: Silence a -Wunused warning
ClosedPublic

Authored by markj on Nov 6 2022, 10:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 19, 3:40 PM
Unknown Object (File)
Sat, Sep 7, 6:59 AM
Unknown Object (File)
Tue, Sep 3, 5:52 PM
Unknown Object (File)
Tue, Sep 3, 5:41 AM
Unknown Object (File)
Tue, Sep 3, 4:07 AM
Unknown Object (File)
Aug 21 2024, 3:21 PM
Unknown Object (File)
Aug 13 2024, 6:48 PM
Unknown Object (File)
Jul 28 2024, 1:13 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 48302
Build 45188: arc lint + arc unit

Event Timeline

markj requested review of this revision.Nov 6 2022, 10:49 PM
corvink added inline comments.
sys/dev/virtio/virtio_endian.h
44–45

This function looks like a small optimization. I don't think that this optimization makes sense because it makes the code harder to read for no value.
So IMHO, we should drop it. E.g. just use:

static inline uint16_t
virtio_htog16(bool modern, uint16_t val)
{
  if (modern)
    return (htole16(val));
  else
    return (val);
}
jhb added inline comments.
sys/dev/virtio/virtio_endian.h
44–45

I agree with Corvin's suggestion and think it is more readable.

markj marked 2 inline comments as done.

Remove virtio_swap_endian().

This revision is now accepted and ready to land.Nov 14 2022, 6:21 AM
This revision was automatically updated to reflect the committed changes.