提交 5c761ce5 编写于 作者: H Heinrich Schuchardt 提交者: Tom Rini

checkpatch.pl: Add warning for new __packed additions

While there are valid reasons to use __packed, often the answer is that
you should be doing something else here instead.

This reintroduces the changes of
f503cc49 (Add warning for new __packed additions)
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
上级 e2888a7f
......@@ -5616,6 +5616,13 @@ sub process {
"__packed is preferred over __attribute__((packed))\n" . $herecurr);
}
# Check for new packed members, warn to use care
if ($realfile !~ m@\binclude/uapi/@ &&
$line =~ /\b(__attribute__\s*\(\s*\(.*\bpacked|__packed)\b/) {
WARN("NEW_PACKED",
"Adding new packed members is to be done with care\n" . $herecurr);
}
# Check for __attribute__ aligned, prefer __aligned
if ($realfile !~ m@\binclude/uapi/@ &&
$line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册