Commit 45e21277 authored by Andy Shevchenko's avatar Andy Shevchenko

platform/x86: dell_rbu: Simplify cleanup code in create_packet()

The code looks more nicer if we use:
	while (idx--)
instead:
	for (;idx>0;idx--)
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent d19f359f
......@@ -199,12 +199,10 @@ static int create_packet(void *data, size_t length)
out_alloc_packet_array:
/* always free packet array */
for (;idx>0;idx--) {
while (idx--) {
pr_debug("freeing unused packet below floor 0x%lx.\n",
(unsigned long)virt_to_phys(
invalid_addr_packet_array[idx-1]));
free_pages((unsigned long)invalid_addr_packet_array[idx-1],
ordernum);
(unsigned long)virt_to_phys(invalid_addr_packet_array[idx]));
free_pages((unsigned long)invalid_addr_packet_array[idx], ordernum);
}
kfree(invalid_addr_packet_array);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment