Skip to content

Commit

Permalink
platform/x86: dell_rbu: Simplify cleanup code in create_packet()
Browse files Browse the repository at this point in the history
The code looks more nicer if we use:
	while (idx--)
instead:
	for (;idx>0;idx--)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
Andy Shevchenko committed Feb 10, 2020
1 parent d19f359 commit 45e2127
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/platform/x86/dell_rbu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 45e2127

Please sign in to comment.