Skip to content

Commit

Permalink
mm/zswap: delete unnecessary check before calling free_percpu()
Browse files Browse the repository at this point in the history
free_percpu() tests whether its argument is NULL and then returns
immediately.  Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Cc: Seth Jennings <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
elfring authored and torvalds committed Dec 13, 2014
1 parent dd01d7d commit 442cc43
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/zswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ static int __init zswap_comp_init(void)
static void __init zswap_comp_exit(void)
{
/* free percpu transforms */
if (zswap_comp_pcpu_tfms)
free_percpu(zswap_comp_pcpu_tfms);
free_percpu(zswap_comp_pcpu_tfms);
}

/*********************************
Expand Down

0 comments on commit 442cc43

Please sign in to comment.