smatch: add --pedantic option
commit78b2f42e3ccaff5ea1d4652d3b74a69c4215856e
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 23 Feb 2021 07:32:15 +0000 (23 10:32 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 23 Feb 2021 07:42:09 +0000 (23 10:42 +0300)
tree9ef2c618a6d373c992918647c41b485e065d6007
parent1d5bae88b9566960ae500f8d156bc147cf34b2c3
smatch: add --pedantic option

The --pedantic option is to help me review new drivers.  It means complain
about every possible thing.

Generally, with Smatch I avoid adding code to find style issues.  I want
to focus on bugs and that keeps me busy enough.  Plus style issues are
controversial so they require more energy than bug fixes.

So an example of a pedantic warning would be extra NULL checks when we know
that the pointer isn't NULL.  I might not email to the author about
that, but I might.  Another example would be using commas instead of
semi-colons.

In pedantic mode a high false positive rate is acceptable.  So maybe every
array index has to be something that Smatch knows is correct otherwise it
generates a warning.

Basically I'm going to be going through the driver with a fine tooth comb
looking for any issues and style questions.  You can't go through the whole
kernel line by line, but for new drivers then we can do it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch.c
smatch.h