summaryrefslogtreecommitdiff
path: root/drivers/extcon/extcon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 20:03:00 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 20:03:00 -0800
commit32a92f8c89326985e05dce8b22d3f0aa07a3e1bd (patch)
tree65f84985b9ed2d5cf3c5243aca78d9428e25c312 /drivers/extcon/extcon.c
parent323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3 (diff)
Convert more 'alloc_obj' cases to default GFP_KERNEL argumentsHEADtorvalds/mastertorvalds/HEADmaster
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 <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r--drivers/extcon/extcon.c12
1 files changed, 4 insertions, 8 deletions
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;