mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
77fba13ccc
commit
96c87607ac
2 changed files with 9 additions and 3 deletions
|
@ -49,6 +49,7 @@ enum rfkill_state {
|
|||
RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */
|
||||
RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */
|
||||
RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */
|
||||
RFKILL_STATE_MAX, /* marker for last valid state */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue