* [PATCH] misc/pvpanic: Remove some dead-code
@ 2021-06-05 16:53 Christophe JAILLET
2021-06-07 9:07 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2021-06-05 16:53 UTC (permalink / raw)
To: arnd, gregkh, mihai.carabas, akpm, andriy.shevchenko, yuehaibing
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, Andy Shevchenko
'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.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] misc/pvpanic: Remove some dead-code
2021-06-05 16:53 [PATCH] misc/pvpanic: Remove some dead-code Christophe JAILLET
@ 2021-06-07 9:07 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2021-06-07 9:07 UTC (permalink / raw)
To: Christophe JAILLET
Cc: arnd, gregkh, mihai.carabas, akpm, yuehaibing, linux-kernel,
kernel-janitors
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@linux.intel.com>
Thanks!
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-07 9:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05 16:53 [PATCH] misc/pvpanic: Remove some dead-code Christophe JAILLET
2021-06-07 9:07 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).