[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <9f41aee8-49a1-4029-8b21-e4eafaa2e224@app.fastmail.com>
Date: Thu, 30 Oct 2025 15:15:25 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
 "Christian Marangi" <ansuelsmth@...il.com>
Cc: "Ilia Lin" <ilia.lin@...nel.org>,
 "Rafael J . Wysocki" <rafael@...nel.org>,
 "Viresh Kumar" <viresh.kumar@...aro.org>,
 "Bjorn Andersson" <andersson@...nel.org>,
 "Konrad Dybcio" <konradybcio@...nel.org>,
 "Raag Jadav" <raag.jadav@...el.com>, linux-arm-msm@...r.kernel.org,
 linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] err.h: add ERR_PTR_CONST macro
On Thu, Oct 30, 2025, at 15:00, Andy Shevchenko wrote:
> On Thu, Oct 30, 2025 at 11:22:11AM +0100, Christian Marangi wrote:
>> On Thu, Oct 30, 2025 at 10:27:38AM +0200, Andy Shevchenko wrote:
>> > On Wed, Oct 29, 2025 at 04:38:53PM +0100, Christian Marangi wrote:
>> drivers/soc/qcom/smem.c:361:35: error: initializer element is not constant
>>   361 | static struct qcom_smem *__smem = ERR_PTR(-EPROBE_DEFER);
>>       |                                   ^~~~~~~
>> make[9]: *** [scripts/Makefile.build:229: drivers/soc/qcom/smem.o] Error 1
>> 
>> You want me to add this to the commit? Or any hint to better reword this
>> so it's more understandable?
>
> Just the first line would be enough.
> And perhaps better naming for the macro, but I have no ideas from top of my
> head right now. Ah, actually I do. We call those either INIT_*() or DEFINE_*()
> with the difference that INIT_*() works like your proposed idea. i.e. returns
> a suitable value, but DEFINE_*() incorporates a variable and a type.
>
> I think the INIT_ERR_PTR() is what we want as a name.
Agreed, that seems better than ERR_PTR_CONST(). I'm still not sure
there is much benefit in using this in static initializers, but
I don't mind it either.
    Arnd
Powered by blists - more mailing lists
 
