Re: [PATCH v2 -next] btrfs: Remove unnecessary casts in btrfs_read_root_item

2019-02-22 Thread David Sterba
On Wed, Feb 20, 2019 at 12:32:02PM +, YueHaibing wrote: > There is a messy cast here: > min_t(int, len, (int)sizeof(*item))); > > min_t() should normally cast to unsigned. It's not possible for > "len" to be negative, but if it were then we definitely > wouldn't want to pass negatives

Re: [PATCH v2 -next] btrfs: Remove unnecessary casts in btrfs_read_root_item

2019-02-20 Thread Qu Wenruo
On 2019/2/20 下午8:32, YueHaibing wrote: > There is a messy cast here: > min_t(int, len, (int)sizeof(*item))); > > min_t() should normally cast to unsigned. It's not possible for > "len" to be negative, but if it were then we definitely > wouldn't want to pass negatives to

Re: [PATCH v2 -next] btrfs: Remove unnecessary casts in btrfs_read_root_item

2019-02-20 Thread Dan Carpenter
On Wed, Feb 20, 2019 at 12:32:02PM +, YueHaibing wrote: > There is a messy cast here: > min_t(int, len, (int)sizeof(*item))); > > min_t() should normally cast to unsigned. It's not possible for > "len" to be negative, but if it were then we definitely > wouldn't want to pass negatives

[PATCH v2 -next] btrfs: Remove unnecessary casts in btrfs_read_root_item

2019-02-20 Thread YueHaibing
There is a messy cast here: min_t(int, len, (int)sizeof(*item))); min_t() should normally cast to unsigned. It's not possible for "len" to be negative, but if it were then we definitely wouldn't want to pass negatives to read_extent_buffer(). Also there is an extra cast. This patch