From 32a92f8c89326985e05dce8b22d3f0aa07a3e1bd Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 21 Feb 2026 20:03:00 -0800 Subject: Convert more 'alloc_obj' cases to default GFP_KERNEL arguments This converts some of the visually simpler cases that have been split over multiple lines. I only did the ones that are easy to verify the resulting diff by having just that final GFP_KERNEL argument on the next line. Somebody should probably do a proper coccinelle script for this, but for me the trivial script actually resulted in an assertion failure in the middle of the script. I probably had made it a bit _too_ trivial. So after fighting that far a while I decided to just do some of the syntactically simpler cases with variations of the previous 'sed' scripts. The more syntactically complex multi-line cases would mostly really want whitespace cleanup anyway. Signed-off-by: Linus Torvalds --- drivers/extcon/extcon.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/extcon') diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index b5d32236da68..b2c6a1660c51 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -1098,8 +1098,7 @@ static int extcon_alloc_cables(struct extcon_dev *edev) if (!edev->max_supported) return 0; - edev->cables = kzalloc_objs(*edev->cables, edev->max_supported, - GFP_KERNEL); + edev->cables = kzalloc_objs(*edev->cables, edev->max_supported); if (!edev->cables) return -ENOMEM; @@ -1160,13 +1159,11 @@ static int extcon_alloc_muex(struct extcon_dev *edev) for (index = 0; edev->mutually_exclusive[index]; index++) ; - edev->attrs_muex = kzalloc_objs(*edev->attrs_muex, index + 1, - GFP_KERNEL); + edev->attrs_muex = kzalloc_objs(*edev->attrs_muex, index + 1); if (!edev->attrs_muex) return -ENOMEM; - edev->d_attrs_muex = kzalloc_objs(*edev->d_attrs_muex, index, - GFP_KERNEL); + edev->d_attrs_muex = kzalloc_objs(*edev->d_attrs_muex, index); if (!edev->d_attrs_muex) { kfree(edev->attrs_muex); return -ENOMEM; @@ -1294,8 +1291,7 @@ int extcon_dev_register(struct extcon_dev *edev) spin_lock_init(&edev->lock); if (edev->max_supported) { - edev->nh = kzalloc_objs(*edev->nh, edev->max_supported, - GFP_KERNEL); + edev->nh = kzalloc_objs(*edev->nh, edev->max_supported); if (!edev->nh) { ret = -ENOMEM; goto err_alloc_nh; -- cgit v1.2.3