[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31b88290-5e2b-5c13-338c-3a08ad1e02fb@linaro.org>
Date: Mon, 12 Jun 2023 07:57:37 -0500
From: Alex Elder <elder@...aro.org>
To: Elliot Berman <quic_eberman@...cinc.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Prakruthi Deepak Heragu <quic_pheragu@...cinc.com>,
Jonathan Corbet <corbet@....net>
Cc: Murali Nalajala <quic_mnalajal@...cinc.com>,
Trilok Soni <quic_tsoni@...cinc.com>,
Srivatsa Vaddagiri <quic_svaddagi@...cinc.com>,
Carl van Schaik <quic_cvanscha@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Bagas Sanjaya <bagasdotme@...il.com>,
Will Deacon <will@...nel.org>, Andy Gross <agross@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Jassi Brar <jassisinghbrar@...il.com>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v13 17/24] gunyah: vm_mgr: Add framework for VM Functions
On 6/9/23 2:49 PM, Elliot Berman wrote:
>>> +static struct gh_vm_function *gh_vm_get_function(u32 type)
>>> +{
>>> + struct gh_vm_function *fn;
>>> + int r;
>>> +
>>> + fn = xa_load(&gh_vm_functions, type);
>>> + if (!fn) {
>>> + r = request_module("ghfunc:%d", type);
>>> + if (r)
>>> + return ERR_PTR(r > 0 ? -r : r);
>>
>> Almost all callers of request_module() simply ignore the
>> return value. What positive values are you expecting to
>> see here (and are you sure they're positive errno values)?
>>
>
> I can ignore the return value here, too, to follow the convention.
>
> I had observed request_module can return modprobe's exit code.
I actually like checking the return value, but if a positive one comes
back it's not clear at all that it should be interpreted as an errno.
Given that almost everybody ignores the return value, maybe the
called function should change, but blk_request_module() and
cpufreq_parse_governor() (for two examples) actually use the
return value to affect behavior.
If you check its return, and it's positive, I would return a
known negative errno rather than just negating it--and perhaps
issue a warning. But it's OK with me if you just ignore it
like most other callers.
-Alex
Powered by blists - more mailing lists