From: Yu Watanabe Date: Fri, 18 Dec 2020 09:47:44 +0000 (+0900) Subject: memory-id: fix never hit condition X-Git-Tag: v248-rc1~468 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3693cbacf79fd450acb3f3d22574122d576995ca;p=thirdparty%2Fsystemd.git memory-id: fix never hit condition As sizeof(int64_t) is always 8. --- diff --git a/src/udev/dmi_memory_id/dmi_memory_id.c b/src/udev/dmi_memory_id/dmi_memory_id.c index 5529daa602f..c5bea8c9a80 100644 --- a/src/udev/dmi_memory_id/dmi_memory_id.c +++ b/src/udev/dmi_memory_id/dmi_memory_id.c @@ -602,8 +602,11 @@ static int smbios3_decode(const uint8_t *buf, const char *devmem, bool no_file_o return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to verify checksum."); offset = QWORD(buf + 0x10); - if (!no_file_offset && (offset >> 32) != 0 && sizeof(int64_t) < 8) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "64-bit addresses not supported."); + +#if __SIZEOF_SIZE_T__ != 8 + if (!no_file_offset && (offset >> 32) != 0) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "64-bit addresses not supported on 32-bit systems."); +#endif return dmi_table(offset, DWORD(buf + 0x0C), 0, devmem, no_file_offset); }