linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: fix a W=1 compilation warning
@ 2019-05-22 16:09 Qian Cai
  2019-07-12 15:29 ` Qian Cai
  2019-09-03 13:29 ` Qian Cai
  0 siblings, 2 replies; 5+ messages in thread
From: Qian Cai @ 2019-05-22 16:09 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: aik, Qian Cai, linuxppc-dev, linux-kernel

The commit b575c731fe58 ("powerpc/powernv/npu: Add set/unset window
helpers") called pnv_npu_set_window() in a void function
pnv_npu_dma_set_32(), but the return code from pnv_npu_set_window() has
no use there as all the error logging happen in pnv_npu_set_window(),
so just remove the unused variable to avoid a compilation warning,

arch/powerpc/platforms/powernv/npu-dma.c: In function
'pnv_npu_dma_set_32':
arch/powerpc/platforms/powernv/npu-dma.c:198:10: warning: variable ‘rc’
set but not used [-Wunused-but-set-variable]

Signed-off-by: Qian Cai <cai@lca.pw>
---
 arch/powerpc/platforms/powernv/npu-dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
index 495550432f3d..035208ed591f 100644
--- a/arch/powerpc/platforms/powernv/npu-dma.c
+++ b/arch/powerpc/platforms/powernv/npu-dma.c
@@ -195,7 +195,6 @@ static void pnv_npu_dma_set_32(struct pnv_ioda_pe *npe)
 {
 	struct pci_dev *gpdev;
 	struct pnv_ioda_pe *gpe;
-	int64_t rc;
 
 	/*
 	 * Find the assoicated PCI devices and get the dma window
@@ -208,8 +207,8 @@ static void pnv_npu_dma_set_32(struct pnv_ioda_pe *npe)
 	if (!gpe)
 		return;
 
-	rc = pnv_npu_set_window(&npe->table_group, 0,
-			gpe->table_group.tables[0]);
+	pnv_npu_set_window(&npe->table_group, 0,
+			   gpe->table_group.tables[0]);
 
 	/*
 	 * NVLink devices use the same TCE table configuration as
-- 
1.8.3.1


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

* Re: [PATCH] powerpc/powernv: fix a W=1 compilation warning
  2019-05-22 16:09 [PATCH] powerpc/powernv: fix a W=1 compilation warning Qian Cai
@ 2019-07-12 15:29 ` Qian Cai
  2019-09-03 13:29 ` Qian Cai
  1 sibling, 0 replies; 5+ messages in thread
From: Qian Cai @ 2019-07-12 15:29 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: aik, linuxppc-dev, linux-kernel

Ping.

On Wed, 2019-05-22 at 12:09 -0400, Qian Cai wrote:
> The commit b575c731fe58 ("powerpc/powernv/npu: Add set/unset window
> helpers") called pnv_npu_set_window() in a void function
> pnv_npu_dma_set_32(), but the return code from pnv_npu_set_window() has
> no use there as all the error logging happen in pnv_npu_set_window(),
> so just remove the unused variable to avoid a compilation warning,
> 
> arch/powerpc/platforms/powernv/npu-dma.c: In function
> 'pnv_npu_dma_set_32':
> arch/powerpc/platforms/powernv/npu-dma.c:198:10: warning: variable ‘rc’
> set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  arch/powerpc/platforms/powernv/npu-dma.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c
> b/arch/powerpc/platforms/powernv/npu-dma.c
> index 495550432f3d..035208ed591f 100644
> --- a/arch/powerpc/platforms/powernv/npu-dma.c
> +++ b/arch/powerpc/platforms/powernv/npu-dma.c
> @@ -195,7 +195,6 @@ static void pnv_npu_dma_set_32(struct pnv_ioda_pe *npe)
>  {
>  	struct pci_dev *gpdev;
>  	struct pnv_ioda_pe *gpe;
> -	int64_t rc;
>  
>  	/*
>  	 * Find the assoicated PCI devices and get the dma window
> @@ -208,8 +207,8 @@ static void pnv_npu_dma_set_32(struct pnv_ioda_pe *npe)
>  	if (!gpe)
>  		return;
>  
> -	rc = pnv_npu_set_window(&npe->table_group, 0,
> -			gpe->table_group.tables[0]);
> +	pnv_npu_set_window(&npe->table_group, 0,
> +			   gpe->table_group.tables[0]);
>  
>  	/*
>  	 * NVLink devices use the same TCE table configuration as

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

* Re: [PATCH] powerpc/powernv: fix a W=1 compilation warning
  2019-05-22 16:09 [PATCH] powerpc/powernv: fix a W=1 compilation warning Qian Cai
  2019-07-12 15:29 ` Qian Cai
@ 2019-09-03 13:29 ` Qian Cai
  2019-09-03 13:30   ` Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Qian Cai @ 2019-09-03 13:29 UTC (permalink / raw)
  To: benh, paulus, mpe, Christoph Hellwig
  Cc: Alexey Kardashevskiy, linuxppc-dev, linux-kernel

I saw Christ start to remove npu-dma.c code [1]

[1] https://lore.kernel.org/linuxppc-dev/20190625145239.2759-4-hch@lst.de/

Should pnv_npu_dma_set_32() be removed too?

It was only called by pnv_npu_try_dma_set_bypass() but the later is not used
anywhere in the kernel tree. If that is a case, I don't need to bother fixing
the warning here.

On Wed, 2019-05-22 at 12:09 -0400, Qian Cai wrote:
> The commit b575c731fe58 ("powerpc/powernv/npu: Add set/unset window
> helpers") called pnv_npu_set_window() in a void function
> pnv_npu_dma_set_32(), but the return code from pnv_npu_set_window() has
> no use there as all the error logging happen in pnv_npu_set_window(),
> so just remove the unused variable to avoid a compilation warning,
> 
> arch/powerpc/platforms/powernv/npu-dma.c: In function
> 'pnv_npu_dma_set_32':
> arch/powerpc/platforms/powernv/npu-dma.c:198:10: warning: variable ‘rc’
> set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  arch/powerpc/platforms/powernv/npu-dma.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c
> b/arch/powerpc/platforms/powernv/npu-dma.c
> index 495550432f3d..035208ed591f 100644
> --- a/arch/powerpc/platforms/powernv/npu-dma.c
> +++ b/arch/powerpc/platforms/powernv/npu-dma.c
> @@ -195,7 +195,6 @@ static void pnv_npu_dma_set_32(struct pnv_ioda_pe *npe)
>  {
>  	struct pci_dev *gpdev;
>  	struct pnv_ioda_pe *gpe;
> -	int64_t rc;
>  
>  	/*
>  	 * Find the assoicated PCI devices and get the dma window
> @@ -208,8 +207,8 @@ static void pnv_npu_dma_set_32(struct pnv_ioda_pe *npe)
>  	if (!gpe)
>  		return;
>  
> -	rc = pnv_npu_set_window(&npe->table_group, 0,
> -			gpe->table_group.tables[0]);
> +	pnv_npu_set_window(&npe->table_group, 0,
> +			   gpe->table_group.tables[0]);
>  
>  	/*
>  	 * NVLink devices use the same TCE table configuration as

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

* Re: [PATCH] powerpc/powernv: fix a W=1 compilation warning
  2019-09-03 13:29 ` Qian Cai
@ 2019-09-03 13:30   ` Christoph Hellwig
  2019-09-03 13:52     ` Qian Cai
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2019-09-03 13:30 UTC (permalink / raw)
  To: Qian Cai; +Cc: aik, linux-kernel, paulus, linuxppc-dev, Christoph Hellwig

On Tue, Sep 03, 2019 at 09:29:14AM -0400, Qian Cai wrote:
> I saw Christ start to remove npu-dma.c code [1]
> 
> [1] https://lore.kernel.org/linuxppc-dev/20190625145239.2759-4-hch@lst.de/
> 
> Should pnv_npu_dma_set_32() be removed too?
> 
> It was only called by pnv_npu_try_dma_set_bypass() but the later is not used
> anywhere in the kernel tree. If that is a case, I don't need to bother fixing
> the warning here.

Yes, pnv_npu_try_dma_set_bypass and pnv_npu_dma_set_32 should go away
as well as they are unused.  Do you want to send a patch or should I
prepare one?

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

* Re: [PATCH] powerpc/powernv: fix a W=1 compilation warning
  2019-09-03 13:30   ` Christoph Hellwig
@ 2019-09-03 13:52     ` Qian Cai
  0 siblings, 0 replies; 5+ messages in thread
From: Qian Cai @ 2019-09-03 13:52 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: aik, linux-kernel, paulus, linuxppc-dev

On Tue, 2019-09-03 at 15:30 +0200, Christoph Hellwig wrote:
> On Tue, Sep 03, 2019 at 09:29:14AM -0400, Qian Cai wrote:
> > I saw Christ start to remove npu-dma.c code [1]
> > 
> > [1] https://lore.kernel.org/linuxppc-dev/20190625145239.2759-4-hch@lst.de/
> > 
> > Should pnv_npu_dma_set_32() be removed too?
> > 
> > It was only called by pnv_npu_try_dma_set_bypass() but the later is not used
> > anywhere in the kernel tree. If that is a case, I don't need to bother
> > fixing
> > the warning here.
> 
> Yes, pnv_npu_try_dma_set_bypass and pnv_npu_dma_set_32 should go away
> as well as they are unused.  Do you want to send a patch or should I
> prepare one?

I would be nice that you could prepare one since it probably could be a part for
your previous attempt.

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

end of thread, other threads:[~2019-09-03 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 16:09 [PATCH] powerpc/powernv: fix a W=1 compilation warning Qian Cai
2019-07-12 15:29 ` Qian Cai
2019-09-03 13:29 ` Qian Cai
2019-09-03 13:30   ` Christoph Hellwig
2019-09-03 13:52     ` Qian Cai

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).