mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-media@vger.kernel.org, Akihiro Tsukada <tskd08@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] [media] pt3: remove bogus module_is_live() check
Date: Mon, 29 Sep 2014 12:14:12 -0300	[thread overview]
Message-ID: <20140929121412.66f2dd67.m.chehab@samsung.com> (raw)
In-Reply-To: <6460819.BmnhuA22YH@wuerfel>

Hi Arnd,

Em Mon, 29 Sep 2014 16:28:55 +0200
Arnd Bergmann <arnd@arndb.de> escreveu:

> The new pt3 driver checks the module reference for presence
> before dropping it, which fails to compile when modules
> are disabled:
> 
> media/pci/pt3/pt3.c: In function 'pt3_attach_fe':
> media/pci/pt3/pt3.c:433:6: error: implicit declaration of function 'module_is_live' [-Werror=implicit-function-declaration]
>       module_is_live(pt3->adaps[i]->i2c_tuner->dev.driver->owner))
> 
> As far as I can tell however, this check is not needed at all, because
> the module will not go away as long as pt3 is holding a reference on
> it. Also the previous check for NULL pointer is not needed at all,
> because module_put has the same check.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for this patch. Antti was quicker than you ;)

I merged the patch on my tree yesterday. It should be popping up
on the tomorrow's -next (I think that sfr didn't release one today).

> 
> diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c
> index 90f86ce7a001..39305f07dc2e 100644
> --- a/drivers/media/pci/pt3/pt3.c
> +++ b/drivers/media/pci/pt3/pt3.c
> @@ -429,14 +429,10 @@ static int pt3_attach_fe(struct pt3_board *pt3, int i)
>  
>  err_tuner:
>  	i2c_unregister_device(pt3->adaps[i]->i2c_tuner);
> -	if (pt3->adaps[i]->i2c_tuner->dev.driver->owner &&
> -	    module_is_live(pt3->adaps[i]->i2c_tuner->dev.driver->owner))
> -		module_put(pt3->adaps[i]->i2c_tuner->dev.driver->owner);
> +	module_put(pt3->adaps[i]->i2c_tuner->dev.driver->owner);
>  err_demod:
>  	i2c_unregister_device(pt3->adaps[i]->i2c_demod);
> -	if (pt3->adaps[i]->i2c_demod->dev.driver->owner &&
> -	    module_is_live(pt3->adaps[i]->i2c_demod->dev.driver->owner))
> -		module_put(pt3->adaps[i]->i2c_demod->dev.driver->owner);
> +	module_put(pt3->adaps[i]->i2c_demod->dev.driver->owner);
>  	return ret;
>  }
>  
> 

      reply	other threads:[~2014-09-29 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 14:28 Arnd Bergmann
2014-09-29 15:14 ` Mauro Carvalho Chehab [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=20140929121412.66f2dd67.m.chehab@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=tskd08@gmail.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

Powered by JetHome