[PATCH] arch: use list_move()
This patch converts the combination of list_del(A) and list_add(A, B) to list_move(A, B) under arch/. Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
		
					parent
					
						
							
								8e13059a37
							
						
					
				
			
			
				commit
				
					
						a7addcea6a
					
				
			
		
					 3 changed files with 6 additions and 12 deletions
				
			
		| 
						 | 
					@ -371,8 +371,7 @@ void __devinit pcibios_sort(void)
 | 
				
			||||||
			list_for_each(ln, &pci_devices) {
 | 
								list_for_each(ln, &pci_devices) {
 | 
				
			||||||
				d = pci_dev_g(ln);
 | 
									d = pci_dev_g(ln);
 | 
				
			||||||
				if (d->bus->number == bus && d->devfn == devfn) {
 | 
									if (d->bus->number == bus && d->devfn == devfn) {
 | 
				
			||||||
					list_del(&d->global_list);
 | 
										list_move_tail(&d->global_list, &sorted_devices);
 | 
				
			||||||
					list_add_tail(&d->global_list, &sorted_devices);
 | 
					 | 
				
			||||||
					if (d == dev)
 | 
										if (d == dev)
 | 
				
			||||||
						found = 1;
 | 
											found = 1;
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
| 
						 | 
					@ -390,8 +389,7 @@ void __devinit pcibios_sort(void)
 | 
				
			||||||
		if (!found) {
 | 
							if (!found) {
 | 
				
			||||||
			printk(KERN_WARNING "PCI: Device %s not found by BIOS\n",
 | 
								printk(KERN_WARNING "PCI: Device %s not found by BIOS\n",
 | 
				
			||||||
				pci_name(dev));
 | 
									pci_name(dev));
 | 
				
			||||||
			list_del(&dev->global_list);
 | 
								list_move_tail(&dev->global_list, &sorted_devices);
 | 
				
			||||||
			list_add_tail(&dev->global_list, &sorted_devices);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	list_splice(&sorted_devices, &pci_devices);
 | 
						list_splice(&sorted_devices, &pci_devices);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -94,8 +94,7 @@ pmd_t *get_pointer_table (void)
 | 
				
			||||||
	PD_MARKBITS(dp) = mask & ~tmp;
 | 
						PD_MARKBITS(dp) = mask & ~tmp;
 | 
				
			||||||
	if (!PD_MARKBITS(dp)) {
 | 
						if (!PD_MARKBITS(dp)) {
 | 
				
			||||||
		/* move to end of list */
 | 
							/* move to end of list */
 | 
				
			||||||
		list_del(dp);
 | 
							list_move_tail(dp, &ptable_list);
 | 
				
			||||||
		list_add_tail(dp, &ptable_list);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return (pmd_t *) (page_address(PD_PAGE(dp)) + off);
 | 
						return (pmd_t *) (page_address(PD_PAGE(dp)) + off);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -123,8 +122,7 @@ int free_pointer_table (pmd_t *ptable)
 | 
				
			||||||
		 * move this descriptor to the front of the list, since
 | 
							 * move this descriptor to the front of the list, since
 | 
				
			||||||
		 * it has one or more free tables.
 | 
							 * it has one or more free tables.
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		list_del(dp);
 | 
							list_move(dp, &ptable_list);
 | 
				
			||||||
		list_add(dp, &ptable_list);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -119,8 +119,7 @@ static inline int refill(void)
 | 
				
			||||||
		if(hole->end == prev->start) {
 | 
							if(hole->end == prev->start) {
 | 
				
			||||||
			hole->size += prev->size;
 | 
								hole->size += prev->size;
 | 
				
			||||||
			hole->end = prev->end;
 | 
								hole->end = prev->end;
 | 
				
			||||||
			list_del(&(prev->list));
 | 
								list_move(&(prev->list), &hole_cache);
 | 
				
			||||||
			list_add(&(prev->list), &hole_cache);
 | 
					 | 
				
			||||||
			ret++;
 | 
								ret++;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -182,8 +181,7 @@ static inline unsigned long get_baddr(int len, unsigned long align)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
			return hole->end;
 | 
								return hole->end;
 | 
				
			||||||
		} else if(hole->size == newlen) {
 | 
							} else if(hole->size == newlen) {
 | 
				
			||||||
			list_del(&(hole->list));
 | 
								list_move(&(hole->list), &hole_cache);
 | 
				
			||||||
			list_add(&(hole->list), &hole_cache);
 | 
					 | 
				
			||||||
			dvma_entry_use(hole->start) = newlen;
 | 
								dvma_entry_use(hole->start) = newlen;
 | 
				
			||||||
#ifdef DVMA_DEBUG
 | 
					#ifdef DVMA_DEBUG
 | 
				
			||||||
			dvma_allocs++;
 | 
								dvma_allocs++;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue