Page MenuHomeFreeBSD

efivar: Use memcmp instead of uuid_ functions to compare
Needs ReviewPublic

Authored by imp on Fri, Apr 25, 7:33 PM.

Details

Reviewers
tsoome
kevans
kib
Summary

In these cases, memcmp is a perfectly fine substitute for the uuid
functions. We don't need checking to make sure the uuids are good, we
know the pointers are non-ULL, etc. memcmp will reduce the number of
places we need to know these are actually UUIDs, or similar.

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Fri, Apr 25, 7:33 PM
imp created this revision.

What is the actual reason behind the change? Because IMO it is not quite good: the main assumption which is not explicitly written out in the summary is that struct uuid does not have any padding.
That said, if you do not need the service of uuid_compare(), we have the bare uuid_equal() which does just memcmp().