rfkill: introduce RFKILL_STATE_MAX
commitb46b5c3bc5e3081e2c86df0137520fe96a619ec3
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 13 May 2011 12:21:26 +0000 (13 09:21 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Fri, 13 May 2011 12:21:26 +0000 (13 09:21 -0300)
treee5ad9278d7873a353f85c855c99c08fa2a911d6d
parent979ebeaf878fd0dbf89408f2b37c6c42b21b8c1c
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