brektrou / rtl8821CU

Realtek RTL8811CU/RTL8821CU USB Wi-Fi adapter driver for Linux
GNU General Public License v2.0
1.59k stars 461 forks source link

Negation (complement) of a boolean not being done correct #94

Closed pprindeville closed 3 years ago

pprindeville commented 3 years ago

Ones complement of an (unsigned) integer value is done via the ~ (bitwise complement) unary operator in C. The boolean complement unary operator in C is !. The compiler is complaining:

/tmp/rtl8821CU/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c: In function ‘_iqk_reload_iqk_setting_8821c’:
/tmp/rtl8821CU/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c:579:49: warning: ‘~’ on a boolean expression [-Wbool-operation]
     odm_set_bb_reg(dm, iqk_apply[path], BIT(0), ~(iqk_info->iqk_fail_report[channel][path][idx]));
                                                 ^
/tmp/rtl8821CU/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c:579:49: note: did you mean to use logical not?
     odm_set_bb_reg(dm, iqk_apply[path], BIT(0), ~(iqk_info->iqk_fail_report[channel][path][idx]));
                                                 ^
                                                 !
/tmp/rtl8821CU/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c:581:50: warning: ‘~’ on a boolean expression [-Wbool-operation]
     odm_set_bb_reg(dm, iqk_apply[path], BIT(10), ~(iqk_info->iqk_fail_report[channel][path][idx]));
                                                  ^
/tmp/rtl8821CU/hal/phydm/halrf/rtl8821c/halrf_iqk_8821c.c:581:50: note: did you mean to use logical not?
     odm_set_bb_reg(dm, iqk_apply[path], BIT(10), ~(iqk_info->iqk_fail_report[channel][path][idx]));
                                                  ^
                                                  !

that the wrong one is being used.