diff options
author | Ivan Safonov <insafonov@gmail.com> | 2015-10-27 22:15:31 +0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-29 09:09:08 +0900 |
commit | 66eaaf4d0dee6fefb8b1b9a67e3228be4ec41052 (patch) | |
tree | 86e56834f0f7e9ebec91efff0485e610ca57043b /drivers/staging | |
parent | bbef4729a1c9eefa509f10c9a0a799e026d54719 (diff) |
staging: rtl8188eu: clamp kernel macro used in proc_get_rx_signal
To limit the range of integers there is clamp macro.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_debug.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c b/drivers/staging/rtl8188eu/core/rtw_debug.c index 993c7db87a1a..2c4afb80fc64 100644 --- a/drivers/staging/rtl8188eu/core/rtw_debug.c +++ b/drivers/staging/rtl8188eu/core/rtw_debug.c @@ -594,8 +594,7 @@ int proc_set_rx_signal(struct file *file, const char __user *buffer, if (is_signal_dbg && num != 2) return count; - signal_strength = signal_strength > 100 ? 100 : signal_strength; - signal_strength = signal_strength < 0 ? 0 : signal_strength; + signal_strength = clamp(signal_strength, 0, 100); padapter->recvpriv.is_signal_dbg = is_signal_dbg; padapter->recvpriv.signal_strength_dbg = signal_strength; |