summaryrefslogtreecommitdiff
path: root/src/devices/adsl
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-11-06 18:22:11 +0100
committerThomas Haller <thaller@redhat.com>2020-11-09 17:53:16 +0100
commitcc35dc3bdf5f76cac5ed37127ca89eef18bb9998 (patch)
tree8d0aa7b8cd627d125956d5b98c094d96795ce005 /src/devices/adsl
parent7d5ec103df5209ca7fbf74309df53af87dd42e5e (diff)
downloadNetworkManager-cc35dc3bdf5f76cac5ed37127ca89eef18bb9998.tar.gz
device: improve "nm-device-logging.h" to support a self pointer of NMDevice type
"nm-device-logging.h" defines logging macros for a NMDevice instance. It also expects a "self" variable in the call environment, and that variable had to be in the type of NMDevice or the NMDevice subclass. Extend the macro foo, so that @self can be either a NMDevice* pointer or a NMDevice$SUBTYPE. Of course, that would have always been possible, if we would simply cast to "(NMDevice *)" where we need it. The trick is that the macro only works if @self is one of the two expected types, and not some arbitrary unrelated type.
Diffstat (limited to 'src/devices/adsl')
-rw-r--r--src/devices/adsl/nm-device-adsl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c
index 3261562399..556dfd829b 100644
--- a/src/devices/adsl/nm-device-adsl.c
+++ b/src/devices/adsl/nm-device-adsl.c
@@ -23,8 +23,8 @@
#include "nm-setting-adsl.h"
#include "nm-utils.h"
+#define _NMLOG_DEVICE_TYPE NMDeviceAdsl
#include "devices/nm-device-logging.h"
-_LOG_DECLARE_SELF(NMDeviceAdsl);
/*****************************************************************************/