checkpatch: qualify do-while-0 advice
authorJim Cromie <jim.cromie@gmail.com>
Tue, 25 Mar 2025 23:51:55 +0000 (17:51 -0600)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:54:05 +0000 (17:54 -0700)
commit15d4734c7a5837bd1a3d261ae232fa698fef39c4
tree730622792d04baf62bda5f8f02318e070288a49c
parentdf3d527495376e29333035e087ead194580ea3b2
checkpatch: qualify do-while-0 advice

Add a paragraph of advice qualifying the general do-while-0 advice, noting
3 possible misguidings.  reduce one ERROR to WARN, for the case I actually
encountered.

And add 'static_assert' to named exceptions, along with some additional
comments about named exceptions vs (detection of) declarative construction
primitives (union, struct, [], etc).

Link: https://lkml.kernel.org/r/20250325235156.663269-3-jim.cromie@gmail.com
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Louis Chauvet <louis.chauvet@bootlin.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl