mm-kernel-device: Fix cmp to exclude subtypes
If multiple kernel device types inherit from MMKernerDevice, and those are compared against each other, the current logic returns TRUE if the G_OBJECT_TYPE of one of them is smaller than the other. This function is checking for equality, so returning FALSE is enough.
This commit is contained in:
committed by
Aleksander Morgado
parent
30f0824ea1
commit
d7288861a5
@@ -204,7 +204,7 @@ mm_kernel_device_cmp (MMKernelDevice *a,
|
||||
g_return_val_if_fail (MM_IS_KERNEL_DEVICE (b), FALSE);
|
||||
|
||||
if (G_OBJECT_TYPE (a) != G_OBJECT_TYPE (b))
|
||||
return G_OBJECT_TYPE (a) < G_OBJECT_TYPE (b);
|
||||
return FALSE;
|
||||
|
||||
return (MM_KERNEL_DEVICE_GET_CLASS (a)->cmp ?
|
||||
MM_KERNEL_DEVICE_GET_CLASS (a)->cmp (a, b) :
|
||||
|
||||
Reference in New Issue
Block a user