* Re: linux-5.17-rc5/arch/mips/cavium-octeon/executive/octeon-model.c bug report
[not found] <VI1P189MB0573726CE8E7812C1D91A9519C3B9@VI1P189MB0573.EURP189.PROD.OUTLOOK.COM>
@ 2022-02-22 21:44 ` Thomas Bogendoerfer
0 siblings, 0 replies; only message in thread
From: Thomas Bogendoerfer @ 2022-02-22 21:44 UTC (permalink / raw)
To: David Binderman; +Cc: linux-mips, Linux Kernel Mailing List
On Tue, Feb 22, 2022 at 05:00:26PM +0000, David Binderman wrote:
> I just ran static analyser cppcheck over the linux kernel 5.17-rc5. It said:
>
> linux-5.17-rc5/arch/mips/cavium-octeon/executive/octeon-model.c:359:11: style: Variable 'suffix' is reassigned a value before the old one has been used. [redundantAssignment]
>
> Source code is
>
> if (fus_dat2.cn66xx.nocrypto && fus_dat2.cn66xx.dorm_crypto)
> suffix = "AP";
> if (fus_dat2.cn66xx.nocrypto)
> suffix = "CP";
>
> Maybe better code:
>
> if (fus_dat2.cn66xx.nocrypto && fus_dat2.cn66xx.dorm_crypto)
> suffix = "AP";
> else if (fus_dat2.cn66xx.nocrypto)
> suffix = "CP";
IMHO this isn't better just different. As I don't have any Cavium docs
about their SoCs, it's hard to say what's the correct way to fix this.
There is the same pattern in CN61XX case
if (fus_dat2.cn61xx.nocrypto && fus_dat2.cn61xx.dorm_crypto)
suffix = "AP";
if (fus_dat2.cn61xx.nocrypto)
suffix = "CP";
which isn't present in the latest Cavium SDK. So maybe just removing
if (fus_dat2.cn66xx.nocrypto && fus_dat2.cn66xx.dorm_crypto)
suffix = "AP";
is more appropriate.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-22 21:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <VI1P189MB0573726CE8E7812C1D91A9519C3B9@VI1P189MB0573.EURP189.PROD.OUTLOOK.COM>
2022-02-22 21:44 ` linux-5.17-rc5/arch/mips/cavium-octeon/executive/octeon-model.c bug report Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®