x86: make tests of a value against zero should be made explicit
Tests of a value against zero should be made explicit, unless the operand is effectively Boolean. This is based on MISRA rule 14.4. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
0ec3774bde
commit
0630452890
5 changed files with 6 additions and 6 deletions
|
@ -154,14 +154,14 @@ int get_value(const struct device *dev, uint32_t *ticks)
|
|||
* the HOUR_PM flag before we adjust for BCD.
|
||||
*/
|
||||
|
||||
if (state.status_b & STATUS_B_24HR) {
|
||||
if ((state.status_b & STATUS_B_24HR) != 0U) {
|
||||
pm = false;
|
||||
} else {
|
||||
pm = ((state.hour & HOUR_PM) == HOUR_PM);
|
||||
state.hour &= ~HOUR_PM;
|
||||
}
|
||||
|
||||
if (!(state.status_b & STATUS_B_BIN)) {
|
||||
if ((state.status_b & STATUS_B_BIN) == 0U) {
|
||||
uint8_t *cp = (uint8_t *) &state;
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue