LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Stefan Wahren <stefan.wahren@i2se.com>,
	linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org
Subject: Re: [PATCH] staging: bcm2835-camera: Replace open-coded idr with a struct idr.
Date: Tue, 15 May 2018 14:46:23 +0100	[thread overview]
Message-ID: <87in7p6ngw.fsf@anholt.net> (raw)
In-Reply-To: <20180515120446.74vrnucehduhi554@mwanda>


[-- Attachment #1.1: Type: text/plain, Size: 1013 bytes --]

Dan Carpenter <dan.carpenter@oracle.com> writes:

> On Thu, May 10, 2018 at 04:31:07PM -0700, Eric Anholt wrote:
>> @@ -258,32 +181,40 @@ get_msg_context(struct vchiq_mmal_instance *instance)
>>  	if (!msg_context)
>>  		return ERR_PTR(-ENOMEM);
>>  
>> -	msg_context->instance = instance;
>> -	msg_context->handle =
>> -		mmal_context_map_create_handle(&instance->context_map,
>> -					       msg_context,
>> -					       GFP_KERNEL);
>> +	/* Create an ID that will be passed along with our message so
>> +	 * that when we service the VCHI reply, we can look up what
>> +	 * message is being replied to.
>> +	 */
>> +	spin_lock(&instance->context_map_lock);
>> +	handle = idr_alloc(&instance->context_map, msg_context,
>> +			   0, 0, GFP_KERNEL);
>> +	spin_unlock(&instance->context_map_lock);
>>  
>> -	if (!msg_context->handle) {
>> +	if (msg_context->handle < 0) {
>
> This should probably be testing:
>
> 	if (handle < 0) {

That's what Stefan said and was fixed in v2 already.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

      reply	other threads:[~2018-05-15 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 23:31 Eric Anholt
2018-05-10 23:40 ` Stefan Wahren
2018-05-11  0:41   ` Eric Anholt
2018-05-15 12:04 ` Dan Carpenter
2018-05-15 13:46   ` Eric Anholt [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=87in7p6ngw.fsf@anholt.net \
    --to=eric@anholt.net \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=stefan.wahren@i2se.com \
    --subject='Re: [PATCH] staging: bcm2835-camera: Replace open-coded idr with a struct idr.' \
    /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

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).