Re: [PATCH] powerpc/powernv: fix a W=1 compilation warning
From: Qian Cai
Date: Tue Sep 03 2019 - 09:29:19 EST
I saw Christ start to remove npu-dma.c code [1]
[1] https://lore.kernel.org/linuxppc-dev/20190625145239.2759-4-hch@xxxxxx/
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@xxxxxx>
> ---
> Â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