rfkill: introduce RFKILL_STATE_MAX
commit9a3f0b0b57f64860a6cadf8c9fd7fef1717c8094
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 19 Oct 2008 21:00:15 +0000 (19 19:00 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 19 Oct 2008 21:00:15 +0000 (19 19:00 -0200)
tree4907602511b985e0cf8250ddd596160a59dba4c6
parentaacc8c96c9b618e46bf8d9f94fbe34bfef5322d5
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