Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ef60f674 authored by Robert Love's avatar Robert Love
Browse files

libfcoe: Save some memory and optimize name lookups



Instead of creating a structure with an enum and a pointer
to a string, simply allocate an array of strings and use
the enum values for the indicies.

This means that we do not need to iterate through the list
of entries when looking up a string name by its enum key.

This will also help with a latter patch that will add
more fcoe_sysfs attributes that will also use the
fcoe_enum_name_search macro. One attribute will also do
a reverse lookup which requires less code when the
enum-to-string mappings are organized as this patch makes
them to be.

Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
parent 354d1123
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment