atm: Use list_for_each_entry() to simplify code in resources.c