From 83a98864ff62b23dfa93baeaaf340741e263c02b Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 2 May 2016 12:05:55 +0200 Subject: pwm: Add missing newline checkpatch requires that declarations be separated from code by a blank line. Add one for readability and to silence the warning. Signed-off-by: Thierry Reding --- drivers/pwm/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 7831bc6b51dd..bc0c20ac90a1 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -75,6 +75,7 @@ static void free_pwms(struct pwm_chip *chip) for (i = 0; i < chip->npwm; i++) { struct pwm_device *pwm = &chip->pwms[i]; + radix_tree_delete(&pwm_tree, pwm->pwm); } -- cgit v1.2.3 From 2907f8abb7ec3aec85ceaaf03dfbc16cca0018dc Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 2 May 2016 12:07:34 +0200 Subject: pwm: Use kcalloc() instead of kzalloc() kcalloc() should be preferred for allocations of arrays over kzalloc() with multiplication. Signed-off-by: Thierry Reding --- drivers/pwm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index bc0c20ac90a1..2a1a2d566e39 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -255,7 +255,7 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip, if (ret < 0) goto out; - chip->pwms = kzalloc(chip->npwm * sizeof(*pwm), GFP_KERNEL); + chip->pwms = kcalloc(chip->npwm, sizeof(*pwm), GFP_KERNEL); if (!chip->pwms) { ret = -ENOMEM; goto out; -- cgit v1.2.3