xen/common: Remove dead code
cover xen/common: Remove dead code
Hello,
This patch fixes Coverity-ID 1055253. Its history says a fix was required.
Thank you,
Ariel Otilibili (1):
xen/common: Remove dead code
xen/common/gzip/inflate.c | 2 -- 1 file changed, 2 deletions(-)
Signature · 1 line
2.47.1
PATCH 1/1 xen/common: Remove dead code
The if-statement tests res is non-zero; meaning the case zero is never reached.
Coverity-ID: 1055253
--
Cc: Andrew Cooper <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Michal Orzel <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: "Roger Pau Monné" <[email protected]>
Cc: Stefano Stabellini <[email protected]>
--- xen/common/gzip/inflate.c | 2 -- 1 file changed, 2 deletions(-)
xen/common/gzip/inflate.c +0 -2
@@ -1164,8 +1164,6 @@ static int __init gunzip(struct gunzip_state *s)if ( (res =inflate (s)) ) {switch (res) { -case 0 : -break ;case 1 :error ("invalid compressed format (err=1)" );break ;
Signature · 1 line
2.47.1
Quoted 5 lines · Ariel Otilibili
The if-statement tests
resis non-zero; meaning the case zero is never reached.Coverity-ID: 1055253
Fixes e2b1ebf4de ("x86: Support booting a bzImage format domain 0 kernel.")Signed-off-by Ariel Otilibili <[email protected]>
I certainly agree with the change, especially if Coverity complains about it. In fact I'd expect Eclair to complain too, for this being unreachable or dead code (I'm never sure which one's which in their nomenclature). The Misra violation addressed may therefore want mentioning, too.
However, the commit referenced says "xen/common/inflate.c is taken unmodified from Linux v2.6.28." Therefore the preferred approach would be to correct the original first, then pull in that patch to our tree. (And yes, the code is still as was even in 6.13-rc3.)
Jan
Quoted 11 lines · Jan Beulich
Quoted 5 lines · Ariel Otilibili
The if-statement tests
resis non-zero; meaning the case zero is never reached.Coverity-ID: 1055253
Fixes e2b1ebf4de ("x86: Support booting a bzImage format domain 0 kernel.")Signed-off-by Ariel Otilibili <[email protected]>I certainly agree with the change, especially if Coverity complains about it. In fact I'd expect Eclair to complain too, for this being unreachable or dead code (I'm never sure which one's which in their nomenclature). The Misra violation addressed may therefore want mentioning, too.
I didn't know Eclair and Miscra could send warnings. Are they commands available for that?
Quoted 5 lines
However, the commit referenced says "
xen/common/inflate.cis taken unmodified from Linux v2.6.28." Therefore the preferred approach would be to correct the original first, then pull in that patch to our tree. (And yes, the code is still as was even in 6.13-rc3.)
So old a commit...
This approach makes sense, Jan; thanks for the feedback. I am sending the patch to Linux.
And will keep you posted.
Quoted 2 lines
Jan
Quoted 21 lines · Ariel Otilibili-Anieli
Quoted 11 lines · Jan Beulich
Quoted 5 lines · Ariel Otilibili
The if-statement tests
resis non-zero; meaning the case zero is never reached.Coverity-ID: 1055253
Fixes e2b1ebf4de ("x86: Support booting a bzImage format domain 0 kernel.")Signed-off-by Ariel Otilibili <[email protected]>I certainly agree with the change, especially if Coverity complains about it. In fact I'd expect Eclair to complain too, for this being unreachable or dead code (I'm never sure which one's which in their nomenclature). The Misra violation addressed may therefore want mentioning, too.
I didn't know Eclair and Miscra could send warnings. Are they commands available for that?
Quoted 5 lines
However, the commit referenced says "
xen/common/inflate.cis taken unmodified from Linux v2.6.28." Therefore the preferred approach would be to correct the original first, then pull in that patch to our tree. (And yes, the code is still as was even in 6.13-rc3.)
Quoted 5 lines
So old a commit...
This approach makes sense, Jan; thanks for the feedback. I am sending the patch to Linux.
And will keep you posted.
The patch sent to Linux,
https://lore.kernel.org/lkml/[email protected]/
Quoted 2 lines
Quoted 2 lines
Jan
Quoted 5 lines · Ariel Otilibili
The if-statement tests
resis non-zero; meaning the case zero is never reached.Coverity-ID: 1055253
Fixes e2b1ebf4de ("x86: Support booting a bzImage format domain 0 kernel.")Signed-off-by Ariel Otilibili <[email protected]>
Quoted 28 lines
--
Cc: Andrew Cooper <[email protected]>
Cc: Anthony PERARD <[email protected]>
Cc: Michal Orzel <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Julien Grall <[email protected]>
Cc: "Roger Pau Monné" <[email protected]>
Cc: Stefano Stabellini <[email protected]>--- xen/common/gzip/inflate.c | 2 -- 1 file changed, 2 deletions(-)xen/common/gzip/inflate.c +0
-2@@ -1164,8 +1164,6 @@ static int __init gunzip(struct gunzip_state *s)if ( (res =inflate (s)) ) {switch (res) { -case 0 : -break ;case 1 :error ("invalid compressed format (err=1)" );break ;Signature · 1 line
2.47.1
Hi Stefano,
Quoted 5 lines · Stefano Stabellini
On Thu, 19 Dec 2024, Ariel Otilibili wrote:
Reviewed-by Stefano Stabellini <[email protected]>
Thanks for having looked into the patch; sorry for the late response, I have had limited access to my mailbox.
I will follow up with an upstream update.
Regards,
Ariel