[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 8 Aug 2022 10:43:35 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Borislav Petkov <bp@...en8.de>, Ira Weiny <ira.weiny@...el.com>
Cc: Rik van Riel <riel@...riel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [RFC PATCH 1/5] entry: Pass pt_regs to
irqentry_exit_cond_resched()
On 8/8/22 10:38, Borislav Petkov wrote:
> On Mon, Aug 08, 2022 at 10:34:19AM -0700, Ira Weiny wrote:
>> I thought about that but generally have been steered away from using bool
>> arguments like this.
> The reason being?
Might have been me. Function calls that look like this:
foo(&ptr, false, true, false, true, 1, 0);
are incomprehensible. A true/false is effectively a magic number here
and you have to go looking at the code implementing 'foo()' or at least
the declaration hoping that the variable names help (if the declaration
has variable names).
I think I've encouraged Ira to do something like this instead:
enum foo_mode {
MODE_BAR,
MODE_BAZ
}
where the call ends up looking like:
foo(&ptr, MODE_BAR);
which is much more self-documenting.
Powered by blists - more mailing lists