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>
This commit is contained in:
Ivan Safonov 2015-10-27 22:15:31 +07:00 committed by Greg Kroah-Hartman
parent bbef4729a1
commit 66eaaf4d0d

View File

@ -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;