diff options
author | Thomas Haller <thaller@redhat.com> | 2017-02-02 12:34:30 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-10 14:40:23 +0100 |
commit | cac07387238cbefdc3ccda768a2d2c2da4a9868c (patch) | |
tree | 2767a9daadfc7a73a041ca737681ac9bc2c2a824 /src/devices/nm-device.c | |
parent | 5151a6071f023dc8dc2c4e64cfe84a1f8af740e8 (diff) | |
download | NetworkManager-cac07387238cbefdc3ccda768a2d2c2da4a9868c.tar.gz |
device: change hw_addr_type field to bitfield type
We don't want to waste a full "int" size to store the @hw_addr_type
in NMDevicePrivate. Previously, that was hacked around by using guint8.
Now, instead use a bitfield which has the right type.
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r-- | src/devices/nm-device.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4006e2c5d2..887d9c55a4 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -222,7 +222,8 @@ typedef struct _NMDevicePrivate { const guint8 hw_addr_len; /* read-only */ guint8 hw_addr_len_; }; - guint8 /*HwAddrType*/ hw_addr_type; + + HwAddrType hw_addr_type:5; bool real:1; @@ -12575,7 +12576,9 @@ nm_device_hw_addr_is_explict (NMDevice *self) g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); priv = NM_DEVICE_GET_PRIVATE (self); - return !NM_IN_SET (priv->hw_addr_type, HW_ADDR_TYPE_PERMANENT, HW_ADDR_TYPE_UNSET); + return !NM_IN_SET ((HwAddrType) priv->hw_addr_type, + HW_ADDR_TYPE_PERMANENT, + HW_ADDR_TYPE_UNSET); } static gboolean |