[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <7528ccc8-7337-4e7f-9474-0d94ed6152ed@app.fastmail.com>
Date: Fri, 16 Dec 2022 12:46:18 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Peter Zijlstra" <peterz@...radead.org>,
"Arnd Bergmann" <arnd@...nel.org>
Cc: "Robert Foss" <robert.foss@...aro.org>,
"Todor Tomov" <todor.too@...il.com>,
"Josh Poimboeuf" <jpoimboe@...nel.org>,
"Andy Gross" <agross@...nel.org>,
"Bjorn Andersson" <andersson@...nel.org>,
"Konrad Dybcio" <konrad.dybcio@...aro.org>,
"Mauro Carvalho Chehab" <mchehab@...nel.org>,
"Hans Verkuil" <hverkuil-cisco@...all.nl>,
"Jonathan Marek" <jonathan@...ek.ca>,
"Bryan O'Donoghue" <bryan.odonoghue@...aro.org>,
linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Nick Desaulniers" <ndesaulniers@...gle.com>
Subject: Re: [PATCH] media: camss: csiphy-3ph: avoid undefined behavior
On Fri, Dec 16, 2022, at 12:23, Peter Zijlstra wrote:
> On Thu, Dec 15, 2022 at 05:28:46PM +0100, Arnd Bergmann wrote:
>> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
>> index 451a4c9b3d30..04baa80494c6 100644
>> --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
>> +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
>> @@ -429,7 +429,8 @@ static void csiphy_gen2_config_lanes(struct csiphy_device *csiphy,
>> array_size = ARRAY_SIZE(lane_regs_sm8250[0]);
>> break;
>> default:
>> - unreachable();
>> + WARN(1, "unknown cspi version\n");
>> + return;
>> }
>
> So no real objection here; but unreachable() does have an objtool
> annotation inside, so clearly the compiler managed to defeat that --
> perhaps we should look at that too.
Ah, I forgot this annotation existed. I see that this
particular objtool warning only happens with clang (I used
version 14.0.6), but it does not happen with gcc-12.2.
I see the function ends in
jmp .LBB3_45
.LBB3_54:
#APP
.Ltmp0:
.section .discard.unreachable,"",@progbits
.Ltmp1:
.long .Ltmp0-.Ltmp1
.text
#NO_APP
.Lfunc_end3:
.size csiphy_lanes_enable, .Lfunc_end3-csiphy_lanes_enable
# -- End function
full assembler output at https://pastebin.com/F8HGCUvk, object file
attached.
Arnd
Download attachment "camss-csiphy-3ph-1-0.o.xz" of type "application/x-xz" (2440 bytes)
Powered by blists - more mailing lists