diff options
author | Qian Cai <cai@lca.pw> | 2019-04-06 22:48:08 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-04-20 08:02:26 -0400 |
commit | c05f57fdc34a3d00c9ee28a35772e9d11b5ce100 (patch) | |
tree | b1b4fd7c0260ae6d740dd0abcd755e374e6cbc4a | |
parent | bff25143da0d623a1765bf78dbc82044e46da5a4 (diff) |
powerpc/pseries/iommu: Fix set but not used values
The commit b7d6bf4fdd47 ("powerpc/pseries/pci: Remove obsolete SW
invalidate") left 2 variables unused.
arch/powerpc/platforms/pseries/iommu.c:108:17: warning: variable 'tces' set but not used
__be64 *tcep, *tces;
^~~~
arch/powerpc/platforms/pseries/iommu.c:132:17: warning: variable 'tces' set but not used
__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
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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 13 |
1 files 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, | |||
105 | unsigned long attrs) | 105 | unsigned long attrs) |
106 | { | 106 | { |
107 | u64 proto_tce; | 107 | u64 proto_tce; |
108 | __be64 *tcep, *tces; | 108 | __be64 *tcep; |
109 | u64 rpn; | 109 | u64 rpn; |
110 | 110 | ||
111 | proto_tce = TCE_PCI_READ; // Read allowed | 111 | proto_tce = TCE_PCI_READ; // Read allowed |
@@ -113,7 +113,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index, | |||
113 | if (direction != DMA_TO_DEVICE) | 113 | if (direction != DMA_TO_DEVICE) |
114 | proto_tce |= TCE_PCI_WRITE; | 114 | proto_tce |= TCE_PCI_WRITE; |
115 | 115 | ||
116 | tces = tcep = ((__be64 *)tbl->it_base) + index; | 116 | tcep = ((__be64 *)tbl->it_base) + index; |
117 | 117 | ||
118 | while (npages--) { | 118 | while (npages--) { |
119 | /* can't move this out since we might cross MEMBLOCK boundary */ | 119 | /* 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, | |||
129 | 129 | ||
130 | static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages) | 130 | static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages) |
131 | { | 131 | { |
132 | __be64 *tcep, *tces; | 132 | __be64 *tcep; |
133 | 133 | ||
134 | tces = tcep = ((__be64 *)tbl->it_base) + index; | 134 | tcep = ((__be64 *)tbl->it_base) + index; |
135 | 135 | ||
136 | while (npages--) | 136 | while (npages--) |
137 | *(tcep++) = 0; | 137 | *(tcep++) = 0; |
@@ -945,7 +945,7 @@ static phys_addr_t ddw_memory_hotplug_max(void) | |||
945 | 945 | ||
946 | for_each_node_by_type(memory, "memory") { | 946 | for_each_node_by_type(memory, "memory") { |
947 | unsigned long start, size; | 947 | unsigned long start, size; |
948 | int ranges, n_mem_addr_cells, n_mem_size_cells, len; | 948 | int n_mem_addr_cells, n_mem_size_cells, len; |
949 | const __be32 *memcell_buf; | 949 | const __be32 *memcell_buf; |
950 | 950 | ||
951 | memcell_buf = of_get_property(memory, "reg", &len); | 951 | memcell_buf = of_get_property(memory, "reg", &len); |
@@ -955,9 +955,6 @@ static phys_addr_t ddw_memory_hotplug_max(void) | |||
955 | n_mem_addr_cells = of_n_addr_cells(memory); | 955 | n_mem_addr_cells = of_n_addr_cells(memory); |
956 | n_mem_size_cells = of_n_size_cells(memory); | 956 | n_mem_size_cells = of_n_size_cells(memory); |
957 | 957 | ||
958 | /* ranges in cell */ | ||
959 | ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells); | ||
960 | |||
961 | start = of_read_number(memcell_buf, n_mem_addr_cells); | 958 | start = of_read_number(memcell_buf, n_mem_addr_cells); |
962 | memcell_buf += n_mem_addr_cells; | 959 | memcell_buf += n_mem_addr_cells; |
963 | size = of_read_number(memcell_buf, n_mem_size_cells); | 960 | size = of_read_number(memcell_buf, n_mem_size_cells); |