Re: + checkpatch-add-check-for-use-of-sizeof-without-parenthesis.patchadded to -mm tree

From: David Rientjes
Date: Mon Jul 09 2012 - 18:23:14 EST


On Mon, 9 Jul 2012, akpm@xxxxxxxxxxxxxxxxxxxx wrote:

> From: Joe Perches <joe@xxxxxxxxxxx>
> Subject: checkpatch: Add acheck for use of sizeof without parenthesis
>
> Kernel style uses parenthesis around sizeof.
>

Nack, there's a difference between "sizeof *task" and
"sizeof(struct task_struct)". The former operates on a unary expression
and the latter operates on a type. There are over 1000 occurrences in the
kernel where the sizeof operator, the former, is used on a unary
expression.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/