Re: [PATCH] misc/pvpanic: Remove some dead-code

From: Andy Shevchenko
Date: Mon Jun 07 2021 - 05:07:18 EST


On Sat, Jun 05, 2021 at 06:53:47PM +0200, Christophe JAILLET wrote:
> 'pvpanic_remove()' is referenced only by a 'devm_add_action_or_reset()'
> call in 'devm_pvpanic_probe()'. So, we know that its parameter is non-NULL.
>
> Axe the unneeded check to save a few lines of code.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Thanks!

> Suggested-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> drivers/misc/pvpanic/pvpanic.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
> index 82770a088d62..02b807c788c9 100644
> --- a/drivers/misc/pvpanic/pvpanic.c
> +++ b/drivers/misc/pvpanic/pvpanic.c
> @@ -66,9 +66,6 @@ static void pvpanic_remove(void *param)
> struct pvpanic_instance *pi_cur, *pi_next;
> struct pvpanic_instance *pi = param;
>
> - if (!pi)
> - return;
> -
> spin_lock(&pvpanic_lock);
> list_for_each_entry_safe(pi_cur, pi_next, &pvpanic_list, list) {
> if (pi_cur == pi) {
> --
> 2.30.2
>

--
With Best Regards,
Andy Shevchenko