diff --git a/src/storagetm/storagetm.c b/src/storagetm/storagetm.c index b28924a8b4..e0ca51d16d 100644 --- a/src/storagetm/storagetm.c +++ b/src/storagetm/storagetm.c @@ -950,9 +950,14 @@ static int device_added(Context *c, sd_device *device) { .st_mode = S_IFBLK, }; - r = sd_device_get_devnum(device, &lookup_key.st_rdev); + /* MIPS OABI declares st_rdev as unsigned long instead of dev_t. + * Use a temp var to avoid passing an incompatible pointer. + * https://sourceware.org/bugzilla/show_bug.cgi?id=21278 */ + dev_t devnum; + r = sd_device_get_devnum(device, &devnum); if (r < 0) return log_device_error_errno(device, r, "Failed to get major/minor from device: %m"); + lookup_key.st_rdev = devnum; if (hashmap_contains(c->subsystems, &lookup_key)) { log_debug("Device '%s' already seen.", devname); @@ -1006,9 +1011,14 @@ static int device_removed(Context *c, sd_device *device) { .st_mode = S_IFBLK, }; - r = sd_device_get_devnum(device, &lookup_key.st_rdev); + /* MIPS OABI declares st_rdev as unsigned long instead of dev_t. + * Use a temp var to avoid passing an incompatible pointer. + * https://sourceware.org/bugzilla/show_bug.cgi?id=21278 */ + dev_t devnum; + r = sd_device_get_devnum(device, &devnum); if (r < 0) return log_device_error_errno(device, r, "Failed to get major/minor from device: %m"); + lookup_key.st_rdev = devnum; NvmeSubsystem *s = hashmap_remove(c->subsystems, &lookup_key); if (!s)