Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SDCA: Tidy up some memory allocations

It is slightly better to deference the type being allocate for a sizeof
rather than manually using the type. Saves effort if types change in the
future. This results in no functional changes, just tidies up the style
of the code a little.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260115114607.271990-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
61d2a769 57aa7735

+4 -4
+1 -1
sound/soc/sdca/sdca_fdl.c
··· 487 487 struct device *dev = interrupt->dev; 488 488 struct fdl_state *fdl_state; 489 489 490 - fdl_state = devm_kzalloc(dev, sizeof(struct fdl_state), GFP_KERNEL); 490 + fdl_state = devm_kzalloc(dev, sizeof(*fdl_state), GFP_KERNEL); 491 491 if (!fdl_state) 492 492 return -ENOMEM; 493 493
+3 -3
sound/soc/sdca/sdca_functions.c
··· 952 952 } 953 953 954 954 control->values = devm_kcalloc(dev, hweight64(control->cn_list), 955 - sizeof(int), GFP_KERNEL); 955 + sizeof(*control->values), GFP_KERNEL); 956 956 if (!control->values) 957 957 return -ENOMEM; 958 958 ··· 2048 2048 fwnode_property_read_u32_array(function_node, "mipi-sdca-file-set-id-list", 2049 2049 filesets_list, num_sets); 2050 2050 2051 - sets = devm_kcalloc(dev, num_sets, sizeof(struct sdca_fdl_set), GFP_KERNEL); 2051 + sets = devm_kcalloc(dev, num_sets, sizeof(*sets), GFP_KERNEL); 2052 2052 if (!sets) 2053 2053 return -ENOMEM; 2054 2054 ··· 2074 2074 dev_dbg(dev, "fileset: %#x\n", filesets_list[i]); 2075 2075 2076 2076 files = devm_kcalloc(dev, num_entries / mult_fileset, 2077 - sizeof(struct sdca_fdl_file), GFP_KERNEL); 2077 + sizeof(*files), GFP_KERNEL); 2078 2078 if (!files) 2079 2079 return -ENOMEM; 2080 2080