public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] media: rc: remove unneeded mutex in rc_register_device
Date: Wed, 16 Mar 2016 22:24:11 +0100	[thread overview]
Message-ID: <56E9CEFB.1050601@gmail.com> (raw)
In-Reply-To: <56E9B4FA.3060707@mentor.com>

Am 16.03.2016 um 20:33 schrieb Vladimir Zapolskiy:
> On 16.03.2016 20:53, Heiner Kallweit wrote:
>> Access to dev->initialized is atomic, therefore we don't have to
>> protect it with a mutex.
> 
> Mutexes are used to split the code to mutually exclusive execution blocks,
> so not arguing about the apparently correct change itself I want to
> emphasize that the given explanation of the change in the commit message is
> wrong. Atomic access does not cancel a specific care about execution
> ordering.
> 
> Indirectly it applies to ("rc-core: allow calling rc_open with device not
> initialized"), where "initialized" bool property was changed to atomic_t
> type --- this (sub-)change is just useless.
> 
> Please grasp the topic and reword the commit message.
> 
Thanks for the hint, you're right.
Will change the commit message and send a v2.

Regards, Heiner

>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/media/rc/rc-main.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
>> index 4e9bbe7..68541b1 100644
>> --- a/drivers/media/rc/rc-main.c
>> +++ b/drivers/media/rc/rc-main.c
>> @@ -1492,9 +1492,7 @@ int rc_register_device(struct rc_dev *dev)
>>  	}
>>  
>>  	/* Allow the RC sysfs nodes to be accessible */
>> -	mutex_lock(&dev->lock);
>>  	atomic_set(&dev->initialized, 1);
>> -	mutex_unlock(&dev->lock);
>>  
>>  	IR_dprintk(1, "Registered rc%u (driver: %s, remote: %s, mode %s)\n",
>>  		   dev->minor,
>>
> 
> --
> With best wishes,
> Vladimir
> 


      reply	other threads:[~2016-03-16 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 18:53 [PATCH] media: rc: remove unneeded mutex in rc_register_device Heiner Kallweit
2016-03-16 19:33 ` Vladimir Zapolskiy
2016-03-16 21:24   ` Heiner Kallweit [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=56E9CEFB.1050601@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=vladimir_zapolskiy@mentor.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