From: David Sterba Date: Tue, 14 Apr 2026 15:30:34 +0000 (+0200) Subject: btrfs: convert kmalloc_array to kmalloc_objs in btrfs_calc_avail_data_space() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37f1f51fba1a4320149b1ea3b21d254d4b221b0a;p=thirdparty%2Fkernel%2Flinux.git btrfs: convert kmalloc_array to kmalloc_objs in btrfs_calc_avail_data_space() There's one use of kmalloc_array() that can be transformed to kmalloc_objs() in the same way as suggested in commit 69050f8d6d075d ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types"), swap the arguments and drop GFP flags. All the other cases of kmalloc_array() do not use a simple type so this is the only one. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index b26aa9169e838..f67a268f36a6d 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1633,8 +1633,7 @@ static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, } } - devices_info = kmalloc_array(nr_devices, sizeof(*devices_info), - GFP_KERNEL); + devices_info = kmalloc_objs(*devices_info, nr_devices); if (!devices_info) return -ENOMEM;