drivers: Fix coding guidelines MISRAC:2012 Rule 14.4 do-whiles/Zero checks

MISRA C:2012 Rule 14.4 (The controlling expression of an if statement
and the controlling expression of an iteration-statement shall have
essentially Boolean type.)

Use `do { ... } while (false)' instead of `do { ... } while (0)'.
Use comparisons with zero instead of implicitly testing integers.

The commit is a subset of the original auditable-branch commit:
5d02614e34a86b549c7707d3d9f0984bc3a5f22a

Signed-off-by: Simon Hein <SHein@baumer.com>
This commit is contained in:
Simon Hein 2022-07-20 08:37:40 +02:00 committed by Anas Nashif
commit d0921018fc
32 changed files with 49 additions and 49 deletions

View file

@ -323,7 +323,7 @@ int z_irq_controller_isr_vector_get(void)
*/
for (block = 7; likely(block > 0); block--) {
pReg = x86_read_loapic(LOAPIC_ISR + (block * 0x10));
if (pReg) {
if (pReg != 0) {
return (block * 32) + (find_msb_set(pReg) - 1);
}