2021-06-27 14:55:07

by Armin Wolf

[permalink] [raw]
Subject: [BUG] checkpatch ALLOC_SIZEOF_STRUCT ignoring devm_* functions

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.