public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries/iommu: fix set but not used values
@ 2019-04-07  2:48 Qian Cai
  2019-04-07  6:34 ` Mukesh Ojha
  2019-04-21 14:19 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Qian Cai @ 2019-04-07  2:48 UTC (permalink / raw)
  To: mpe, benh, paulus; +Cc: aik, linuxppc-dev, linux-kernel, Qian Cai

The commit b7d6bf4fdd47 ("powerpc/pseries/pci: Remove obsolete SW
invalidate") left 2 variables unused.

arch/powerpc/platforms/pseries/iommu.c: In function 'tce_build_pSeries':
arch/powerpc/platforms/pseries/iommu.c:108:17: warning: variable 'tces'
set but not used [-Wunused-but-set-variable]
  __be64 *tcep, *tces;
                 ^~~~
arch/powerpc/platforms/pseries/iommu.c: In function 'tce_free_pSeries':
arch/powerpc/platforms/pseries/iommu.c:132:17: warning: variable 'tces'
set but not used [-Wunused-but-set-variable]
  __be64 *tcep, *tces;
                 ^~~~

Also, the commit 68c0449ea16d ("powerpc/pseries/iommu: Use memory@ nodes
in max RAM address calculation") set "ranges" in
ddw_memory_hotplug_max() but never use it.

arch/powerpc/platforms/pseries/iommu.c: In function
'ddw_memory_hotplug_max':
arch/powerpc/platforms/pseries/iommu.c:948:7: warning: variable 'ranges'
set but not used [-Wunused-but-set-variable]
   int ranges, n_mem_addr_cells, n_mem_size_cells, len;
       ^~~~~~

Signed-off-by: Qian Cai <cai@lca.pw>
---
 arch/powerpc/platforms/pseries/iommu.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 36eb1ddbac69..03bbb299320e 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -105,7 +105,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
 			      unsigned long attrs)
 {
 	u64 proto_tce;
-	__be64 *tcep, *tces;
+	__be64 *tcep;
 	u64 rpn;
 
 	proto_tce = TCE_PCI_READ; // Read allowed
@@ -113,7 +113,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
 	if (direction != DMA_TO_DEVICE)
 		proto_tce |= TCE_PCI_WRITE;
 
-	tces = tcep = ((__be64 *)tbl->it_base) + index;
+	tcep = ((__be64 *)tbl->it_base) + index;
 
 	while (npages--) {
 		/* can't move this out since we might cross MEMBLOCK boundary */
@@ -129,9 +129,9 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
 
 static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
 {
-	__be64 *tcep, *tces;
+	__be64 *tcep;
 
-	tces = tcep = ((__be64 *)tbl->it_base) + index;
+	tcep = ((__be64 *)tbl->it_base) + index;
 
 	while (npages--)
 		*(tcep++) = 0;
@@ -945,7 +945,7 @@ static phys_addr_t ddw_memory_hotplug_max(void)
 
 	for_each_node_by_type(memory, "memory") {
 		unsigned long start, size;
-		int ranges, n_mem_addr_cells, n_mem_size_cells, len;
+		int n_mem_addr_cells, n_mem_size_cells, len;
 		const __be32 *memcell_buf;
 
 		memcell_buf = of_get_property(memory, "reg", &len);
@@ -955,9 +955,6 @@ static phys_addr_t ddw_memory_hotplug_max(void)
 		n_mem_addr_cells = of_n_addr_cells(memory);
 		n_mem_size_cells = of_n_size_cells(memory);
 
-		/* ranges in cell */
-		ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells);
-
 		start = of_read_number(memcell_buf, n_mem_addr_cells);
 		memcell_buf += n_mem_addr_cells;
 		size = of_read_number(memcell_buf, n_mem_size_cells);
-- 
2.17.2 (Apple Git-113)


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

* Re: [PATCH] powerpc/pseries/iommu: fix set but not used values
  2019-04-07  2:48 [PATCH] powerpc/pseries/iommu: fix set but not used values Qian Cai
@ 2019-04-07  6:34 ` Mukesh Ojha
  2019-04-21 14:19 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-04-07  6:34 UTC (permalink / raw)
  To: Qian Cai, mpe, benh, paulus; +Cc: aik, linuxppc-dev, linux-kernel


On 4/7/2019 8:18 AM, Qian Cai wrote:
> The commit b7d6bf4fdd47 ("powerpc/pseries/pci: Remove obsolete SW
> invalidate") left 2 variables unused.
>
> arch/powerpc/platforms/pseries/iommu.c: In function 'tce_build_pSeries':
> arch/powerpc/platforms/pseries/iommu.c:108:17: warning: variable 'tces'
> set but not used [-Wunused-but-set-variable]
>    __be64 *tcep, *tces;
>                   ^~~~
> arch/powerpc/platforms/pseries/iommu.c: In function 'tce_free_pSeries':
> arch/powerpc/platforms/pseries/iommu.c:132:17: warning: variable 'tces'
> set but not used [-Wunused-but-set-variable]
>    __be64 *tcep, *tces;
>                   ^~~~
>
> Also, the commit 68c0449ea16d ("powerpc/pseries/iommu: Use memory@ nodes
> in max RAM address calculation") set "ranges" in
> ddw_memory_hotplug_max() but never use it.
>
> arch/powerpc/platforms/pseries/iommu.c: In function
> 'ddw_memory_hotplug_max':
> arch/powerpc/platforms/pseries/iommu.c:948:7: warning: variable 'ranges'
> set but not used [-Wunused-but-set-variable]
>     int ranges, n_mem_addr_cells, n_mem_size_cells, len;
>         ^~~~~~
>
> Signed-off-by: Qian Cai <cai@lca.pw>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> ---
>   arch/powerpc/platforms/pseries/iommu.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> index 36eb1ddbac69..03bbb299320e 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -105,7 +105,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
>   			      unsigned long attrs)
>   {
>   	u64 proto_tce;
> -	__be64 *tcep, *tces;
> +	__be64 *tcep;
>   	u64 rpn;
>   
>   	proto_tce = TCE_PCI_READ; // Read allowed
> @@ -113,7 +113,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
>   	if (direction != DMA_TO_DEVICE)
>   		proto_tce |= TCE_PCI_WRITE;
>   
> -	tces = tcep = ((__be64 *)tbl->it_base) + index;
> +	tcep = ((__be64 *)tbl->it_base) + index;
>   
>   	while (npages--) {
>   		/* can't move this out since we might cross MEMBLOCK boundary */
> @@ -129,9 +129,9 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
>   
>   static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
>   {
> -	__be64 *tcep, *tces;
> +	__be64 *tcep;
>   
> -	tces = tcep = ((__be64 *)tbl->it_base) + index;
> +	tcep = ((__be64 *)tbl->it_base) + index;
>   
>   	while (npages--)
>   		*(tcep++) = 0;
> @@ -945,7 +945,7 @@ static phys_addr_t ddw_memory_hotplug_max(void)
>   
>   	for_each_node_by_type(memory, "memory") {
>   		unsigned long start, size;
> -		int ranges, n_mem_addr_cells, n_mem_size_cells, len;
> +		int n_mem_addr_cells, n_mem_size_cells, len;
>   		const __be32 *memcell_buf;
>   
>   		memcell_buf = of_get_property(memory, "reg", &len);
> @@ -955,9 +955,6 @@ static phys_addr_t ddw_memory_hotplug_max(void)
>   		n_mem_addr_cells = of_n_addr_cells(memory);
>   		n_mem_size_cells = of_n_size_cells(memory);
>   
> -		/* ranges in cell */
> -		ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells);
> -
>   		start = of_read_number(memcell_buf, n_mem_addr_cells);
>   		memcell_buf += n_mem_addr_cells;
>   		size = of_read_number(memcell_buf, n_mem_size_cells);

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

* Re: powerpc/pseries/iommu: fix set but not used values
  2019-04-07  2:48 [PATCH] powerpc/pseries/iommu: fix set but not used values Qian Cai
  2019-04-07  6:34 ` Mukesh Ojha
@ 2019-04-21 14:19 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2019-04-21 14:19 UTC (permalink / raw)
  To: Qian Cai, benh, paulus; +Cc: aik, Qian Cai, linuxppc-dev, linux-kernel

On Sun, 2019-04-07 at 02:48:08 UTC, Qian Cai wrote:
> The commit b7d6bf4fdd47 ("powerpc/pseries/pci: Remove obsolete SW
> invalidate") left 2 variables unused.
> 
> arch/powerpc/platforms/pseries/iommu.c: In function 'tce_build_pSeries':
> arch/powerpc/platforms/pseries/iommu.c:108:17: warning: variable 'tces'
> set but not used [-Wunused-but-set-variable]
>   __be64 *tcep, *tces;
>                  ^~~~
> arch/powerpc/platforms/pseries/iommu.c: In function 'tce_free_pSeries':
> arch/powerpc/platforms/pseries/iommu.c:132:17: warning: variable 'tces'
> set but not used [-Wunused-but-set-variable]
>   __be64 *tcep, *tces;
>                  ^~~~
> 
> Also, the commit 68c0449ea16d ("powerpc/pseries/iommu: Use memory@ nodes
> in max RAM address calculation") set "ranges" in
> ddw_memory_hotplug_max() but never use it.
> 
> arch/powerpc/platforms/pseries/iommu.c: In function
> 'ddw_memory_hotplug_max':
> arch/powerpc/platforms/pseries/iommu.c:948:7: warning: variable 'ranges'
> set but not used [-Wunused-but-set-variable]
>    int ranges, n_mem_addr_cells, n_mem_size_cells, len;
>        ^~~~~~
> 
> Signed-off-by: Qian Cai <cai@lca.pw>
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c05f57fdc34a3d00c9ee28a35772e9d1

cheers

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

end of thread, other threads:[~2019-04-21 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-07  2:48 [PATCH] powerpc/pseries/iommu: fix set but not used values Qian Cai
2019-04-07  6:34 ` Mukesh Ojha
2019-04-21 14:19 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox