summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-08-28 12:35:43 +0200
committerThomas Haller <thaller@redhat.com>2020-09-08 12:42:10 +0200
commit2e7fc7afd275a4e54eaf40d6ff7d0e0f6cbbaf96 (patch)
tree90e31372c2fc04140b7869b4d570d849d815443d
parent19795f4dce744fb748b5ef42a9c21343fd459d29 (diff)
downloadNetworkManager-2e7fc7afd275a4e54eaf40d6ff7d0e0f6cbbaf96.tar.gz
device: fix casting pointer to enum for sriov_reset_on_deactivate_cb()
Avoids a compiler warning: ../src/devices/nm-device.c:16079:26: error: cast to smaller integer type 'NMDeviceStateReason' from 'gpointer' (aka 'void *') [-Werror,-Wvoid-pointer-to-enum-cast] deactivate_ready (self, (NMDeviceStateReason) reason); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 121c58f0c48d ('core: set number of SR-IOV VFs asynchronously') (cherry picked from commit 918ebd600acba97ea64af7d1039339983fa44af4) (cherry picked from commit 32641b9fca45f29372d76f06fcb9330e14820b15) (cherry picked from commit c24888be5113f459a2d0af6e49998b52b2b7196c) (cherry picked from commit 3d27459460433f17d5402ca9d15db49f5e321b7b)
-rw-r--r--src/devices/nm-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 9556d1bc8a..baa036b4d8 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -15164,7 +15164,7 @@ sriov_deactivate_cb (GError *error, gpointer user_data)
if (nm_utils_error_is_cancelled (error, TRUE))
return;
- deactivate_ready (self, (NMDeviceStateReason) reason);
+ deactivate_ready (self, GPOINTER_TO_INT (reason));
}
static void
@@ -15466,7 +15466,7 @@ _set_state_full (NMDevice *self,
0,
NM_TERNARY_TRUE,
sriov_deactivate_cb,
- nm_utils_user_data_pack (self, (gpointer) reason));
+ nm_utils_user_data_pack (self, GINT_TO_POINTER (reason)));
}
}