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 <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds
2026-02-21 20:03:00 -08:00
parent 323bbfcf1e
commit 32a92f8c89
826 changed files with 1211 additions and 2422 deletions

View File

@@ -9831,8 +9831,7 @@ static int ca0132_prepare_verbs(struct hda_codec *codec)
*/
if (ca0132_use_pci_mmio(spec))
spec->desktop_init_verbs = ca0132_init_verbs1;
spec->spec_init_verbs = kzalloc_objs(struct hda_verb, NUM_SPEC_VERBS,
GFP_KERNEL);
spec->spec_init_verbs = kzalloc_objs(struct hda_verb, NUM_SPEC_VERBS);
if (!spec->spec_init_verbs)
return -ENOMEM;

View File

@@ -845,8 +845,7 @@ static void print_codec_info(struct snd_info_entry *entry,
if (wid_caps & AC_WCAP_CONN_LIST) {
conn_len = snd_hda_get_num_raw_conns(codec, nid);
if (conn_len > 0) {
conn = kmalloc_objs(hda_nid_t, conn_len,
GFP_KERNEL);
conn = kmalloc_objs(hda_nid_t, conn_len);
if (!conn)
return;
if (snd_hda_get_raw_connections(codec, nid, conn,

View File

@@ -101,8 +101,7 @@ int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
setup_op = snd_hdac_stream_setup;
for (i = 0; i < num_stream; i++) {
struct hdac_ext_stream *hext_stream = kzalloc_obj(*hext_stream,
GFP_KERNEL);
struct hdac_ext_stream *hext_stream = kzalloc_obj(*hext_stream);
if (!hext_stream)
return -ENOMEM;
tag = ++stream_tag;

View File

@@ -374,8 +374,7 @@ static int widget_tree_create(struct hdac_device *codec)
if (!tree->root)
return -ENOMEM;
tree->nodes = kzalloc_objs(*tree->nodes, codec->num_nodes + 1,
GFP_KERNEL);
tree->nodes = kzalloc_objs(*tree->nodes, codec->num_nodes + 1);
if (!tree->nodes)
return -ENOMEM;