]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
user-record: use clzll() instead of clzl() for uint64_t
authorMike Yuan <me@yhndnzj.com>
Mon, 17 Nov 2025 22:49:53 +0000 (23:49 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 18 Nov 2025 00:49:01 +0000 (09:49 +0900)
src/shared/user-record.c

index 1fd292dba8c87ca3ef35f7053fc4950442aa3c29..5c720de21ccef44b477650e9d506e2ac8fa2d144 100644 (file)
@@ -2041,7 +2041,7 @@ uint64_t user_record_luks_sector_size(UserRecord *h) {
                 return 512;
 
         /* Allow up to 4K due to dm-crypt support and 4K alignment by the homed LUKS backend */
-        return CLAMP(UINT64_C(1) << (63 - __builtin_clzl(h->luks_sector_size)), 512U, 4096U);
+        return CLAMP(UINT64_C(1) << (63 - __builtin_clzll(h->luks_sector_size)), 512U, 4096U);
 }
 
 const char* user_record_luks_pbkdf_hash_algorithm(UserRecord *h) {