We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38c0304 commit 3063da9Copy full SHA for 3063da9
drivers/staging/rtl8712/rtl8712_recv.c
@@ -663,17 +663,11 @@ static u8 evm_db2percentage(s8 value)
663
/*
664
* -33dB~0dB to 0%~99%
665
*/
666
- s8 ret_val;
+ s8 ret_val = clamp(-value, 0, 33) * 3;
667
668
- ret_val = value;
669
- if (ret_val >= 0)
670
- ret_val = 0;
671
- if (ret_val <= -33)
672
- ret_val = -33;
673
- ret_val = -ret_val;
674
- ret_val *= 3;
675
if (ret_val == 99)
676
ret_val = 100;
+
677
return ret_val;
678
}
679
0 commit comments