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:
parent
bbef4729a1
commit
66eaaf4d0d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user