@@ -396,18 +396,18 @@ static bool btrfs_ioctl_search_args_inc(struct btrfs_ioctl_search_args *args) {
396396 * comparing. This call increases the counter by one, dealing
397397 * with the overflow between the overflows */
398398
399- if (args -> key .min_offset < ( uint64_t ) -1 ) {
399+ if (args -> key .min_offset < UINT64_MAX ) {
400400 args -> key .min_offset ++ ;
401401 return true;
402402 }
403403
404- if (args -> key .min_type < ( uint8_t ) -1 ) {
404+ if (args -> key .min_type < UINT8_MAX ) {
405405 args -> key .min_type ++ ;
406406 args -> key .min_offset = 0 ;
407407 return true;
408408 }
409409
410- if (args -> key .min_objectid < ( uint64_t ) -1 ) {
410+ if (args -> key .min_objectid < UINT64_MAX ) {
411411 args -> key .min_objectid ++ ;
412412 args -> key .min_offset = 0 ;
413413 args -> key .min_type = 0 ;
@@ -464,11 +464,11 @@ int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret) {
464464 .key .max_type = BTRFS_ROOT_ITEM_KEY ,
465465
466466 .key .min_offset = 0 ,
467- .key .max_offset = ( uint64_t ) -1 ,
467+ .key .max_offset = UINT64_MAX ,
468468
469469 /* No restrictions on the other components */
470470 .key .min_transid = 0 ,
471- .key .max_transid = ( uint64_t ) -1 ,
471+ .key .max_transid = UINT64_MAX ,
472472 };
473473
474474 bool found = false;
@@ -562,7 +562,7 @@ int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret) {
562562
563563 /* No restrictions on the other components */
564564 .key .min_transid = 0 ,
565- .key .max_transid = ( uint64_t ) -1 ,
565+ .key .max_transid = UINT64_MAX ,
566566 };
567567
568568 bool found_info = false, found_limit = false;
@@ -624,12 +624,12 @@ int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret) {
624624 if (le64toh (qli -> flags ) & BTRFS_QGROUP_LIMIT_MAX_RFER )
625625 ret -> referenced_max = le64toh (qli -> max_rfer );
626626 else
627- ret -> referenced_max = ( uint64_t ) -1 ;
627+ ret -> referenced_max = UINT64_MAX ;
628628
629629 if (le64toh (qli -> flags ) & BTRFS_QGROUP_LIMIT_MAX_EXCL )
630630 ret -> exclusive_max = le64toh (qli -> max_excl );
631631 else
632- ret -> exclusive_max = ( uint64_t ) -1 ;
632+ ret -> exclusive_max = UINT64_MAX ;
633633
634634 found_limit = true;
635635 }
@@ -648,13 +648,13 @@ int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret) {
648648 return - ENODATA ;
649649
650650 if (!found_info ) {
651- ret -> referenced = ( uint64_t ) -1 ;
652- ret -> exclusive = ( uint64_t ) -1 ;
651+ ret -> referenced = UINT64_MAX ;
652+ ret -> exclusive = UINT64_MAX ;
653653 }
654654
655655 if (!found_limit ) {
656- ret -> referenced_max = ( uint64_t ) -1 ;
657- ret -> exclusive_max = ( uint64_t ) -1 ;
656+ ret -> referenced_max = UINT64_MAX ;
657+ ret -> exclusive_max = UINT64_MAX ;
658658 }
659659
660660 return 0 ;
@@ -671,7 +671,7 @@ int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *
671671}
672672
673673int btrfs_subvol_find_subtree_qgroup (int fd , uint64_t subvol_id , uint64_t * ret ) {
674- uint64_t level , lowest = ( uint64_t ) -1 , lowest_qgroupid = 0 ;
674+ uint64_t level , lowest = UINT64_MAX , lowest_qgroupid = 0 ;
675675 _cleanup_free_ uint64_t * qgroups = NULL ;
676676 int r , n ;
677677
@@ -713,13 +713,13 @@ int btrfs_subvol_find_subtree_qgroup(int fd, uint64_t subvol_id, uint64_t *ret)
713713 if (id != subvol_id )
714714 continue ;
715715
716- if (lowest == ( uint64_t ) -1 || level < lowest ) {
716+ if (lowest == UINT64_MAX || level < lowest ) {
717717 lowest_qgroupid = qgroups [i ];
718718 lowest = level ;
719719 }
720720 }
721721
722- if (lowest == ( uint64_t ) -1 ) {
722+ if (lowest == UINT64_MAX ) {
723723 /* No suitable higher-level qgroup found, let's return
724724 * the leaf qgroup instead, and indicate that with the
725725 * return value. */
@@ -1089,7 +1089,7 @@ static int subvol_remove_children(int fd, const char *subvolume, uint64_t subvol
10891089 .key .max_type = BTRFS_ROOT_BACKREF_KEY ,
10901090
10911091 .key .min_transid = 0 ,
1092- .key .max_transid = ( uint64_t ) -1 ,
1092+ .key .max_transid = UINT64_MAX ,
10931093 };
10941094
10951095 struct btrfs_ioctl_vol_args vol_args = {};
@@ -1265,7 +1265,7 @@ int btrfs_qgroup_copy_limits(int fd, uint64_t old_qgroupid, uint64_t new_qgroupi
12651265
12661266 /* No restrictions on the other components */
12671267 .key .min_transid = 0 ,
1268- .key .max_transid = ( uint64_t ) -1 ,
1268+ .key .max_transid = UINT64_MAX ,
12691269 };
12701270
12711271 int r ;
@@ -1451,7 +1451,7 @@ static int subvol_snapshot_children(
14511451 .key .max_type = BTRFS_ROOT_BACKREF_KEY ,
14521452
14531453 .key .min_transid = 0 ,
1454- .key .max_transid = ( uint64_t ) -1 ,
1454+ .key .max_transid = UINT64_MAX ,
14551455 };
14561456
14571457 struct btrfs_ioctl_vol_args_v2 vol_args = {
@@ -1721,10 +1721,10 @@ int btrfs_qgroup_find_parents(int fd, uint64_t qgroupid, uint64_t **ret) {
17211721
17221722 /* No restrictions on the other components */
17231723 .key .min_offset = 0 ,
1724- .key .max_offset = ( uint64_t ) -1 ,
1724+ .key .max_offset = UINT64_MAX ,
17251725
17261726 .key .min_transid = 0 ,
1727- .key .max_transid = ( uint64_t ) -1 ,
1727+ .key .max_transid = UINT64_MAX ,
17281728 };
17291729
17301730 _cleanup_free_ uint64_t * items = NULL ;
@@ -1965,10 +1965,10 @@ int btrfs_subvol_get_parent(int fd, uint64_t subvol_id, uint64_t *ret) {
19651965
19661966 /* No restrictions on the other components */
19671967 .key .min_offset = 0 ,
1968- .key .max_offset = ( uint64_t ) -1 ,
1968+ .key .max_offset = UINT64_MAX ,
19691969
19701970 .key .min_transid = 0 ,
1971- .key .max_transid = ( uint64_t ) -1 ,
1971+ .key .max_transid = UINT64_MAX ,
19721972 };
19731973 int r ;
19741974
0 commit comments