linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy'
  2021-06-01  8:51 [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy' Baokun Li
@ 2021-06-01  8:46 ` Arnd Bergmann
  2021-06-18  3:51 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-06-01  8:46 UTC (permalink / raw)
  To: Baokun Li
  Cc: Jeremy Kerr, Michael Ellerman, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, Linux Kernel Mailing List,
	Wei Yongjun, YueHaibing, yangjihong1, Yu Kuai

On Tue, Jun 1, 2021 at 10:43 AM Baokun Li <libaokun1@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppu_mb_stat':
> arch/powerpc/platforms/cell/spufs/switch.c:1660:6: warning:
> variable ‘dummy’ set but not used [-Wunused-but-set-variable]
>
> arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppuint_mb_stat':
> arch/powerpc/platforms/cell/spufs/switch.c:1675:6: warning:
> variable ‘dummy’ set but not used [-Wunused-but-set-variable]
>
> It never used since introduction.
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>

I think in_be64() used to cause a different warning if the result was
ignored, but this is no longer the case.

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy'
@ 2021-06-01  8:51 Baokun Li
  2021-06-01  8:46 ` Arnd Bergmann
  2021-06-18  3:51 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Baokun Li @ 2021-06-01  8:51 UTC (permalink / raw)
  To: jk, arnd, mpe, benh, paulus, linuxppc-dev, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1

Fixes gcc '-Wunused-but-set-variable' warning:

arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppu_mb_stat':
arch/powerpc/platforms/cell/spufs/switch.c:1660:6: warning:
variable ‘dummy’ set but not used [-Wunused-but-set-variable]

arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppuint_mb_stat':
arch/powerpc/platforms/cell/spufs/switch.c:1675:6: warning:
variable ‘dummy’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 arch/powerpc/platforms/cell/spufs/switch.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index d56b4e3241cd..b41e81b22fdc 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -1657,14 +1657,13 @@ static inline void restore_spu_mb(struct spu_state *csa, struct spu *spu)
 static inline void check_ppu_mb_stat(struct spu_state *csa, struct spu *spu)
 {
 	struct spu_problem __iomem *prob = spu->problem;
-	u32 dummy = 0;
 
 	/* Restore, Step 66:
 	 *     If CSA.MB_Stat[P]=0 (mailbox empty) then
 	 *     read from the PPU_MB register.
 	 */
 	if ((csa->prob.mb_stat_R & 0xFF) == 0) {
-		dummy = in_be32(&prob->pu_mb_R);
+		in_be32(&prob->pu_mb_R);
 		eieio();
 	}
 }
@@ -1672,14 +1671,13 @@ static inline void check_ppu_mb_stat(struct spu_state *csa, struct spu *spu)
 static inline void check_ppuint_mb_stat(struct spu_state *csa, struct spu *spu)
 {
 	struct spu_priv2 __iomem *priv2 = spu->priv2;
-	u64 dummy = 0UL;
 
 	/* Restore, Step 66:
 	 *     If CSA.MB_Stat[I]=0 (mailbox empty) then
 	 *     read from the PPUINT_MB register.
 	 */
 	if ((csa->prob.mb_stat_R & 0xFF0000) == 0) {
-		dummy = in_be64(&priv2->puint_mb_R);
+		in_be64(&priv2->puint_mb_R);
 		eieio();
 		spu_int_stat_clear(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
 		eieio();
-- 
2.31.1


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

* Re: [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy'
  2021-06-01  8:51 [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy' Baokun Li
  2021-06-01  8:46 ` Arnd Bergmann
@ 2021-06-18  3:51 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-06-18  3:51 UTC (permalink / raw)
  To: linuxppc-dev, jk, paulus, arnd, mpe, benh, linux-kernel, Baokun Li
  Cc: weiyongjun1, yangjihong1, yukuai3, yuehaibing

On Tue, 1 Jun 2021 16:51:27 +0800, Baokun Li wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppu_mb_stat':
> arch/powerpc/platforms/cell/spufs/switch.c:1660:6: warning:
> variable ‘dummy’ set but not used [-Wunused-but-set-variable]
> 
> arch/powerpc/platforms/cell/spufs/switch.c: In function 'check_ppuint_mb_stat':
> arch/powerpc/platforms/cell/spufs/switch.c:1675:6: warning:
> variable ‘dummy’ set but not used [-Wunused-but-set-variable]
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/spufs: disp: Remove set but not used variable 'dummy'
      https://git.kernel.org/powerpc/c/911bacda4658129bee039dc90fc0c3f193ee2695

cheers

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

end of thread, other threads:[~2021-06-18  4:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01  8:51 [PATCH -next] powerpc/spufs: disp: Remove set but not used variable 'dummy' Baokun Li
2021-06-01  8:46 ` Arnd Bergmann
2021-06-18  3:51 ` 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).