]> git.baikalelectronics.ru Git - kernel.git/commit
rfkill: introduce RFKILL_STATE_MAX
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sat, 2 Aug 2008 18:11:00 +0000 (15:11 -0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 22 Aug 2008 20:29:57 +0000 (16:29 -0400)
commit1b722870c4268a3818ffb863fc26ff7f2913f3ec
treed8a7d538b2bd05b5ee2957828563b31cf7db8540
parente139b236830d8d0958a645617d3c2d56f67f5dee
rfkill: introduce RFKILL_STATE_MAX

While it is interesting to not add last-enum-markers because it allows gcc
to warn us of switch() statements missing a valid state, we really should
be handling memory corruption on a rfkill state with default clauses,
anyway.

So add RFKILL_STATE_MAX and use it where applicable.  It makes for safer
code in the long run.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/linux/rfkill.h
net/rfkill/rfkill.c