From: "Arnd Bergmann" <arnd@arndb.de>
To: "Peter Zijlstra" <peterz@infradead.org>,
"Arnd Bergmann" <arnd@kernel.org>
Cc: "Robert Foss" <robert.foss@linaro.org>,
"Todor Tomov" <todor.too@gmail.com>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Andy Gross" <agross@kernel.org>,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konrad.dybcio@linaro.org>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
"Jonathan Marek" <jonathan@marek.ca>,
"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Nick Desaulniers" <ndesaulniers@google.com>
Subject: Re: [PATCH] media: camss: csiphy-3ph: avoid undefined behavior
Date: Fri, 16 Dec 2022 12:46:18 +0100 [thread overview]
Message-ID: <7528ccc8-7337-4e7f-9474-0d94ed6152ed@app.fastmail.com> (raw)
In-Reply-To: <Y5xVHU5FBr5qzAOs@hirez.programming.kicks-ass.net>
[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]
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
[-- Attachment #2: camss-csiphy-3ph-1-0.o.xz --]
[-- Type: application/x-xz, Size: 2440 bytes --]
prev parent reply other threads:[~2022-12-16 11:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 16:28 [PATCH] media: camss: csiphy-3ph: avoid undefined behavior Arnd Bergmann
2022-12-16 10:59 ` Robert Foss
2022-12-16 11:23 ` Peter Zijlstra
2022-12-16 11:46 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7528ccc8-7337-4e7f-9474-0d94ed6152ed@app.fastmail.com \
--to=arnd@arndb.de \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=arnd@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jonathan@marek.ca \
--cc=jpoimboe@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=robert.foss@linaro.org \
--cc=todor.too@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.