Skip to contentSkip to conversation

checkpatch ALLOC_SIZEOF_STRUCT ignoring devm_* functions

BUG Armin Wolf 1 participant 1 message Jun 27, 2021

lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

When checking a source file containing something like:

data = devm_kzalloc(&pdev->dev, sizeof(struct dell_smm_data), GFP_KERNEL);

checkpatch is not complaining.
But when doing the same without devres:

data = kzalloc(sizeof(struct dell_smm_data), GFP_KERNEL);

checkpatch complains "Prefer kzalloc(sizeof(*data)...) over kzalloc(sizeof(struct dell_smm_data)...)".
I think checkpatch ignoring the devm_* function is not intended.