summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorIvan Safonov <insafonov@gmail.com>2015-10-27 22:15:31 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-29 09:09:08 +0900
commit66eaaf4d0dee6fefb8b1b9a67e3228be4ec41052 (patch)
tree86e56834f0f7e9ebec91efff0485e610ca57043b /drivers/staging
parentbbef4729a1c9eefa509f10c9a0a799e026d54719 (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.c3
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;