checkpatch: add a few DEVICE_ATTR style tests
authorJoe Perches <joe@perches.com>
Tue, 6 Feb 2018 23:38:55 +0000 (15:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 02:32:45 +0000 (18:32 -0800)
commit001804689b0d41410ae483d3e3dcdb16c3a6640f
tree322c581d2e28210142d6604bf67f01203aa05608
parent3f7f335dbc8675e0b55b2cedb5164b7ead1e4fe6
checkpatch: add a few DEVICE_ATTR style tests

DEVICE_ATTR is a declaration macro that has a few alternate and
preferred forms like DEVICE_ATTR_RW, DEVICE_ATTR_RO, and DEVICE_ATTR.

As well, many uses of DEVICE_ATTR could use the preferred forms when the
show or store functions are also named in a regular form.

Suggest the preferred forms when appropriate.

Also emit a permissions warning if the the permissions are not the
typical 0644, 0444, or 0200.

Link: http://lkml.kernel.org/r/725864f363d91d1e1e6894a39fb57662eabd6d65.1513803306.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl