mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:27:35 +00:00
Kernel: Resolve clang-tidy readability-implicit-bool-conversion warnings
... In files included from Kernel/Process.cpp and Kernel/Thread.cpp
This commit is contained in:
parent
6f580f2047
commit
a92132e44a
17 changed files with 85 additions and 84 deletions
|
@ -100,7 +100,7 @@ ALWAYS_INLINE void write_gs_ptr(u32 offset, FlatPtr val)
|
|||
|
||||
ALWAYS_INLINE bool are_interrupts_enabled()
|
||||
{
|
||||
return cpu_flags() & 0x200;
|
||||
return (cpu_flags() & 0x200) != 0;
|
||||
}
|
||||
|
||||
FlatPtr read_cr0();
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
|
||||
~InterruptDisabler()
|
||||
{
|
||||
if (m_flags & 0x200)
|
||||
if ((m_flags & 0x200) != 0)
|
||||
sti();
|
||||
}
|
||||
|
||||
|
|
|
@ -39,28 +39,28 @@ public:
|
|||
NoExecute = 0x8000000000000000ULL,
|
||||
};
|
||||
|
||||
bool is_present() const { return raw() & Present; }
|
||||
bool is_present() const { return (raw() & Present) == Present; }
|
||||
void set_present(bool b) { set_bit(Present, b); }
|
||||
|
||||
bool is_user_allowed() const { return raw() & UserSupervisor; }
|
||||
bool is_user_allowed() const { return (raw() & UserSupervisor) == UserSupervisor; }
|
||||
void set_user_allowed(bool b) { set_bit(UserSupervisor, b); }
|
||||
|
||||
bool is_huge() const { return raw() & Huge; }
|
||||
bool is_huge() const { return (raw() & Huge) == Huge; }
|
||||
void set_huge(bool b) { set_bit(Huge, b); }
|
||||
|
||||
bool is_writable() const { return raw() & ReadWrite; }
|
||||
bool is_writable() const { return (raw() & ReadWrite) == ReadWrite; }
|
||||
void set_writable(bool b) { set_bit(ReadWrite, b); }
|
||||
|
||||
bool is_write_through() const { return raw() & WriteThrough; }
|
||||
bool is_write_through() const { return (raw() & WriteThrough) == WriteThrough; }
|
||||
void set_write_through(bool b) { set_bit(WriteThrough, b); }
|
||||
|
||||
bool is_cache_disabled() const { return raw() & CacheDisabled; }
|
||||
bool is_cache_disabled() const { return (raw() & CacheDisabled) == CacheDisabled; }
|
||||
void set_cache_disabled(bool b) { set_bit(CacheDisabled, b); }
|
||||
|
||||
bool is_global() const { return raw() & Global; }
|
||||
bool is_global() const { return (raw() & Global) == Global; }
|
||||
void set_global(bool b) { set_bit(Global, b); }
|
||||
|
||||
bool is_execute_disabled() const { return raw() & NoExecute; }
|
||||
bool is_execute_disabled() const { return (raw() & NoExecute) == NoExecute; }
|
||||
void set_execute_disabled(bool b) { set_bit(NoExecute, b); }
|
||||
|
||||
void set_bit(u64 bit, bool value)
|
||||
|
@ -96,25 +96,25 @@ public:
|
|||
NoExecute = 0x8000000000000000ULL,
|
||||
};
|
||||
|
||||
bool is_present() const { return raw() & Present; }
|
||||
bool is_present() const { return (raw() & Present) == Present; }
|
||||
void set_present(bool b) { set_bit(Present, b); }
|
||||
|
||||
bool is_user_allowed() const { return raw() & UserSupervisor; }
|
||||
bool is_user_allowed() const { return (raw() & UserSupervisor) == UserSupervisor; }
|
||||
void set_user_allowed(bool b) { set_bit(UserSupervisor, b); }
|
||||
|
||||
bool is_writable() const { return raw() & ReadWrite; }
|
||||
bool is_writable() const { return (raw() & ReadWrite) == ReadWrite; }
|
||||
void set_writable(bool b) { set_bit(ReadWrite, b); }
|
||||
|
||||
bool is_write_through() const { return raw() & WriteThrough; }
|
||||
bool is_write_through() const { return (raw() & WriteThrough) == WriteThrough; }
|
||||
void set_write_through(bool b) { set_bit(WriteThrough, b); }
|
||||
|
||||
bool is_cache_disabled() const { return raw() & CacheDisabled; }
|
||||
bool is_cache_disabled() const { return (raw() & CacheDisabled) == CacheDisabled; }
|
||||
void set_cache_disabled(bool b) { set_bit(CacheDisabled, b); }
|
||||
|
||||
bool is_global() const { return raw() & Global; }
|
||||
bool is_global() const { return (raw() & Global) == Global; }
|
||||
void set_global(bool b) { set_bit(Global, b); }
|
||||
|
||||
bool is_execute_disabled() const { return raw() & NoExecute; }
|
||||
bool is_execute_disabled() const { return (raw() & NoExecute) == NoExecute; }
|
||||
void set_execute_disabled(bool b) { set_bit(NoExecute, b); }
|
||||
|
||||
bool is_null() const { return m_raw == 0; }
|
||||
|
|
|
@ -304,12 +304,12 @@ private:
|
|||
{
|
||||
VERIFY(m_in_critical > 0);
|
||||
if (m_in_critical == 1) {
|
||||
if (!m_in_irq) {
|
||||
if (m_in_irq == 0) {
|
||||
deferred_call_execute_pending();
|
||||
VERIFY(m_in_critical == 1);
|
||||
}
|
||||
m_in_critical = 0;
|
||||
if (!m_in_irq)
|
||||
if (m_in_irq == 0)
|
||||
check_invoke_scheduler();
|
||||
} else {
|
||||
m_in_critical = m_in_critical - 1;
|
||||
|
@ -327,7 +327,7 @@ public:
|
|||
auto prev_critical = in_critical();
|
||||
write_gs_ptr(__builtin_offsetof(Processor, m_in_critical), 0);
|
||||
auto& proc = current();
|
||||
if (!proc.m_in_irq)
|
||||
if (proc.m_in_irq == 0)
|
||||
proc.check_invoke_scheduler();
|
||||
return prev_critical;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
VERIFY(is_locked());
|
||||
track_lock_release(m_rank);
|
||||
m_lock.store(0, AK::memory_order_release);
|
||||
if (prev_flags & 0x200)
|
||||
if ((prev_flags & 0x200) != 0)
|
||||
sti();
|
||||
else
|
||||
cli();
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
track_lock_release(m_rank);
|
||||
m_lock.store(0, AK::memory_order_release);
|
||||
}
|
||||
if (prev_flags & 0x200)
|
||||
if ((prev_flags & 0x200) != 0)
|
||||
sti();
|
||||
else
|
||||
cli();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue