Re: [PATCH] clk: remove unneeded dead-store initialization

Stephen Boyd <[email protected]> Sat, 14 Nov 2020 12:32:34 -0800
Newsgroups tech.elisa.lists.linux-safety,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel
Message-ID <160538595432.60232.9813667976586248163@swboyd.mtv.corp.google.com>
Quoting Lukas Bulwahn (2020-11-06 01:48:20)
> make clang-analyzer on x86_64 defconfig caught my attention with:
>=20
>   drivers/clk/clk.c:423:19:
>   warning: Value stored to 'parent' during its initialization is never re=
ad
>   [clang-analyzer-deadcode.DeadStores]
>           struct clk_core *parent =3D ERR_PTR(-ENOENT);
>                            ^
>=20
> Commit fc0c209c147f ("clk: Allow parents to be specified without string
> names") introduced clk_core_fill_parent_index() with this unneeded
> dead-store initialization.
>=20
> So, simply remove this unneeded dead-store initialization to make
> clang-analyzer happy.
>=20
> As compilers will detect this unneeded assignment and optimize this anywa=
y,
> the resulting object code is identical before and after this change.
>=20
> No functional change. No change to object code.
>=20
> Signed-off-by: Lukas Bulwahn <[email protected]>
> ---

Applied to clk-next