*new* check_resource_size(): prod people to use resource_size()
commitf0a6644ddc8d5a3c34c6892fd69259c2892963d3
authorDan Carpenter <error27@gmail.com>
Mon, 22 Mar 2010 18:37:06 +0000 (22 21:37 +0300)
committerDan Carpenter <error27@gmail.com>
Mon, 22 Mar 2010 18:37:06 +0000 (22 21:37 +0300)
treeba6132c40a0f686ce66f44f1710809d22a9bb71c
parent135e965c2f8432e38493bba8e7dbc2f8876482c3
*new* check_resource_size():  prod people to use resource_size()

There is a kernel function called resource_size() and this check
encourages people to use it.  Normally people calculate their resource
size by doing "end - start" but the correct way is to do "end - start + 1".

This check produces at least two false positives:
netxen has an end which is 1 higher than normal so end - start works.
some other driver does "size - 3" depending on the config.

But generally this check works surprisingly well.

Signed-off-by: Dan Carpenter <error27@gmail.com>
check_list.h
check_resource_size.c [new file with mode: 0644]