Thread (33 messages) 33 messages, 2 authors, 2021-01-04

Re: [PATCH 02/23] powerpc/pseries/ras: Remove unused variable 'status'

From: Christophe Leroy <hidden>
Date: 2020-12-21 08:26:14


Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
quoted hunk ↗ jump to hunk
The last use of 'status' was removed in 2012. Remove the variable to
fix this W=1 compile error.

../arch/powerpc/platforms/pseries/ras.c: In function ‘ras_epow_interrupt’:
../arch/powerpc/platforms/pseries/ras.c:318:6: error: variable ‘status’ set but not used [-Werror=unused-but-set-variable]
   318 |  int status;
       |      ^~~~~~

Fixes: 55fc0c561742 ("powerpc/pseries: Parse and handle EPOW interrupts")
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Cc: Ganesh Goudar <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
  arch/powerpc/platforms/pseries/ras.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 149cec2212e6..e27310fc1481 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -315,11 +315,10 @@ static irqreturn_t ras_hotplug_interrupt(int irq, void *dev_id)
  /* Handle environmental and power warning (EPOW) interrupts. */
  static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
  {
-	int status;
  	int state;
  	int critical;
  
-	status = rtas_get_sensor_fast(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX,
+	rtas_get_sensor_fast(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX,
  				      &state);
Should fit on a single line now.
quoted hunk ↗ jump to hunk
  
  	if (state > 3)
@@ -329,7 +328,7 @@ static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
  
  	spin_lock(&ras_log_buf_lock);
  
-	status = rtas_call(ras_check_exception_token, 6, 1, NULL,
+	rtas_call(ras_check_exception_token, 6, 1, NULL,
  			   RTAS_VECTOR_EXTERNAL_INTERRUPT,
  			   virq_to_hw(irq),
  			   RTAS_EPOW_WARNING,
Take the opportunity to reduce the number of lines taken by the instruction (should fit on two 
lines) and get arguments of the second line properly aligned to the open parenthesis.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help