]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: drop subsystem from log_device_*()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 1 Nov 2018 07:12:46 +0000 (16:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Nov 2018 06:45:22 +0000 (15:45 +0900)
The sd_device object always has syspath and sysname, but subsytem may not.
Also, it may take some costs to get subsystem.
So, let's drop subsystem from logs.

src/libsystemd/sd-device/device-util.h

index e25350edc5930b5522a398516f3b80f16518c1a7..94f6174bff961a95a83acaec0bab27a36c9bb581 100644 (file)
 
 #define log_device_full(device, level, error, ...)                      \
         ({                                                              \
-                const char *_sysname = NULL, *_subsystem = NULL;        \
+                const char *_sysname = NULL;                            \
                 sd_device *_d = (device);                               \
                 int _level = (level), _error = (error);                 \
                                                                         \
-                if (_d && _unlikely_(log_get_max_level() >= _level)) {  \
+                if (_d && _unlikely_(log_get_max_level() >= _level))    \
                         (void) sd_device_get_sysname(_d, &_sysname);    \
-                        (void) sd_device_get_subsystem(_d, &_subsystem); \
-                }                                                       \
                 log_object_internal(_level, _error, __FILE__, __LINE__, __func__, \
                                     _sysname ? "DEVICE=" : NULL, _sysname, \
-                                    _subsystem ? "SUBSYSTEM=" : NULL, _subsystem, ##__VA_ARGS__); \
+                                    NULL, NULL, ##__VA_ARGS__);         \
         })
 
 #define log_device_debug(device, ...)   log_device_full(device, LOG_DEBUG, 0, ##__VA_ARGS__)