linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arch/powerpc: Remove unnecessary endian conversion code in XICS
@ 2023-07-31 11:55 Gautam Menghani
  2023-08-23 11:55 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Gautam Menghani @ 2023-07-31 11:55 UTC (permalink / raw)
  To: mpe, npiggin, christophe.leroy
  Cc: Jordan Niethe, Gautam Menghani, linuxppc-dev, linux-kernel

Remove an unnecessary piece of code that does an endianness conversion but
does not use the result. The following warning was reported by Clang's
static analyzer:

arch/powerpc/sysdev/xics/ics-opal.c:114:2: warning: Value stored to
'server' is never read [deadcode.DeadStores]
server = be16_to_cpu(oserver);

'server' was used as a parameter to opal_get_xive() in commit
5c7c1e9444d8 ("powerpc/powernv: Add OPAL ICS backend") when it was
introduced. 'server' was also used in an error message for the call to
opal_get_xive().

'server' was always later set by a call to ics_opal_mangle_server()
before being used.

Commit bf8e0f891a32 ("powerpc/powernv: Fix endian issues in OPAL ICS
backend") used a new variable 'oserver' as the parameter to
opal_get_xive() instead of 'server' for endian correctness. It also
removed 'server' from the error message for the call to opal_get_xive().

Fix the warning by removing the server variable assignment.

Fixes: bf8e0f891a32 ("powerpc/powernv: Fix endian issues in OPAL ICS backend")
Reviewed-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
---
V1 -> V2:
1. Add context of the code provided by Jordan
2. Add fixes tag

 arch/powerpc/sysdev/xics/ics-opal.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c
index 6cfbb4fac7fb..5fe73dabab79 100644
--- a/arch/powerpc/sysdev/xics/ics-opal.c
+++ b/arch/powerpc/sysdev/xics/ics-opal.c
@@ -111,7 +111,6 @@ static int ics_opal_set_affinity(struct irq_data *d,
 		       __func__, d->irq, hw_irq, rc);
 		return -1;
 	}
-	server = be16_to_cpu(oserver);
 
 	wanted_server = xics_get_irq_server(d->irq, cpumask, 1);
 	if (wanted_server < 0) {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] arch/powerpc: Remove unnecessary endian conversion code in XICS
  2023-07-31 11:55 [PATCH v2] arch/powerpc: Remove unnecessary endian conversion code in XICS Gautam Menghani
@ 2023-08-23 11:55 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2023-08-23 11:55 UTC (permalink / raw)
  To: npiggin, christophe.leroy, Gautam Menghani
  Cc: Jordan Niethe, linuxppc-dev, linux-kernel

On Mon, 31 Jul 2023 17:25:39 +0530, Gautam Menghani wrote:
> Remove an unnecessary piece of code that does an endianness conversion but
> does not use the result. The following warning was reported by Clang's
> static analyzer:
> 
> arch/powerpc/sysdev/xics/ics-opal.c:114:2: warning: Value stored to
> 'server' is never read [deadcode.DeadStores]
> server = be16_to_cpu(oserver);
> 
> [...]

Applied to powerpc/next.

[1/1] arch/powerpc: Remove unnecessary endian conversion code in XICS
      https://git.kernel.org/powerpc/c/984b07b428994d9e83c6de9a5f1307948188fe71

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-23 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31 11:55 [PATCH v2] arch/powerpc: Remove unnecessary endian conversion code in XICS Gautam Menghani
2023-08-23 11:55 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).