linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org,
	mihai.carabas@oracle.com, akpm@linux-foundation.org,
	yuehaibing@huawei.com, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] misc/pvpanic: Remove some dead-code
Date: Mon, 7 Jun 2021 12:07:08 +0300	[thread overview]
Message-ID: <YL3hvMW3d2cd8IT1@smile.fi.intel.com> (raw)
In-Reply-To: <8e425618f4042a8ab8366be4d34026972e77bd40.1622911768.git.christophe.jaillet@wanadoo.fr>

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



      reply	other threads:[~2021-06-07  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 16:53 [PATCH] misc/pvpanic: Remove some dead-code Christophe JAILLET
2021-06-07  9:07 ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YL3hvMW3d2cd8IT1@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mihai.carabas@oracle.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).