unsigned long attrs)
 {
        u64 proto_tce;
-       __be64 *tcep, *tces;
+       __be64 *tcep;
        u64 rpn;
 
        proto_tce = TCE_PCI_READ; // Read allowed
        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 */
 
 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;
 
        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);
                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);