rfkill: introduce RFKILL_STATE_MAX
commitf901c81694a4ae3ba9e5f85e359874f23f377c44
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 24 Mar 2009 06:52:59 +0000 (24 03:52 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 24 Mar 2009 06:52:59 +0000 (24 03:52 -0300)
tree3858bef4aacea4ca0e0080625e0d57a230f80796
parent198bbc67b7ca17e443e3056b8e14cd60a96e2d8d
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>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
include/linux/rfkill.h
net/rfkill/rfkill.c