diff options
author | Ivan Safonov <insafonov@gmail.com> | 2015-10-27 15:15:31 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-29 00:09:08 (GMT) |
commit | 66eaaf4d0dee6fefb8b1b9a67e3228be4ec41052 (patch) | |
tree | 86e56834f0f7e9ebec91efff0485e610ca57043b /drivers/staging | |
parent | bbef4729a1c9eefa509f10c9a0a799e026d54719 (diff) | |
download | linux-66eaaf4d0dee6fefb8b1b9a67e3228be4ec41052.tar.xz |
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 993c7db..2c4afb8 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; |