Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4053213imm; Mon, 30 Jul 2018 07:56:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeM03mE71GhkBGWwT6dT5z2Qf16wxPdl1LT+IprIUKwTc7iNOM22tGoq/KJcwg2i9QkfT/O X-Received: by 2002:a63:5421:: with SMTP id i33-v6mr16887085pgb.417.1532962589342; Mon, 30 Jul 2018 07:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532962589; cv=none; d=google.com; s=arc-20160816; b=OVyJESV5pwuUvZ5nXw9YuYx4zd7qFRyAjK9w4pvM+1+XzU+FyHvEnoYk42mIPdv9SD MubRXQQ2EflzCnGPp5smAvd6LHM+Exr4289wXOghNqY0+AKK5ghrPmgkrP3+LrvW5IPW HvtghkzB3uZOprN46kE4wzWe5+Pl/3DKnyHhg/wS4aKxZiiA7khZvgByO3hgcFS/zlWi +uXXTpKmorAs40YhnSphIWryt267fS5ow1ve2kYg14t6r516i0ivt73I9MLzP5w50l9t wNYfYJuZetC1z/XZDtvXsOApSf7YLo0rp2mRE/IaBRVo/5O/ulBTz+33MZW5/18wc8BS XRjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=v+OLD6G4z9ltQBOF2eK6j9TFvIbGB1hYnBrzR92BR24=; b=rFuPzPYUfJeiPbHJpaaRkZc/UwqDkTdaQX1mzKTSk5y/1E74px35UTgDkG/nVdhfsx d1EUxmTAtF/K3eUXxlEIKBieb7+T54it9VfiT38qUO9n8Uxsw2nTchJ3MOmevljDL3fc yHjVdZAQKnyOTDvvTJI+18Z4x6QoaFv7Y5R5qQ/nk6bzOmySkTmTlLbTWY99t4KWllme Ssxj1V+Ir/ZUFXnMzD8ziU1ybRjB576xownlLoYZEEuaIqd7D3pE0KrZbOsNDFLDt8s6 MjHrJtzG3HJA14yU9oOpFD+H5+j+4YbJkrgPMJtaiLrvN5gqpL7jUCbnT/K1UP801igB gCOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kfSViWBP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24-v6si9643158pls.353.2018.07.30.07.56.14; Mon, 30 Jul 2018 07:56:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kfSViWBP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731860AbeG3Qas (ORCPT + 99 others); Mon, 30 Jul 2018 12:30:48 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40080 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727100AbeG3Qas (ORCPT ); Mon, 30 Jul 2018 12:30:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=v+OLD6G4z9ltQBOF2eK6j9TFvIbGB1hYnBrzR92BR24=; b=kfSViWBPCYxeInO1O0OSbw1n2 uHGzejo3fbOSeU88hCGThc5Ne8KnQ2Vuypsiak4e8+jjeovNuH6KEJ2pINshBlRvw8V1+k1bk4bhz TKr28sL7SKodGcYBnmLrDMTgmbT0kZ9ComCazPz6kLhYr/7g73FHRtdP5GMrIEwOE90gvAGCOiV6z ZWQMw5wOdm2YV9orbsHEcMOBNtMuqC5Bqowtx9lXmMr9pqTiMi1waV1mAyds/gPUZ4gbpD4507oiF MFFIeFw3GZbox4k+3jK/wQbYflMOse8bL3yHBf8qpYFLPABmFO1Xa02dH6ksF+5z1z7uUyzGG8H1a f2AF2XFTw==; Received: from [179.95.0.119] (helo=coco.lan) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fk9a0-0002YJ-Ua; Mon, 30 Jul 2018 14:55:25 +0000 Date: Mon, 30 Jul 2018 11:55:21 -0300 From: Mauro Carvalho Chehab To: Sakari Ailus Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [PATCH 14/26] media: Convert entity ID allocation to new IDA API Message-ID: <20180730115521.23f7afa9@coco.lan> In-Reply-To: <20180724110507.idyjc3vbbivwbxtb@valkosipuli.retiisi.org.uk> References: <20180621212835.5636-1-willy@infradead.org> <20180621212835.5636-15-willy@infradead.org> <20180724110507.idyjc3vbbivwbxtb@valkosipuli.retiisi.org.uk> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, 24 Jul 2018 14:05:07 +0300 Sakari Ailus escreveu: > On Thu, Jun 21, 2018 at 02:28:23PM -0700, Matthew Wilcox wrote: > > Removes a call to ida_pre_get(). > > > > Signed-off-by: Matthew Wilcox > > Reviewed-by: Sakari Ailus I'm assuming that the entire series will be applied together via some other tree. So: Acked-by: Mauro Carvalho Chehab > > > --- > > drivers/media/media-device.c | 16 +++++----------- > > 1 file changed, 5 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c > > index ae59c3177555..d51088bcd735 100644 > > --- a/drivers/media/media-device.c > > +++ b/drivers/media/media-device.c > > @@ -575,18 +575,12 @@ int __must_check media_device_register_entity(struct media_device *mdev, > > entity->num_links = 0; > > entity->num_backlinks = 0; > > > > - if (!ida_pre_get(&mdev->entity_internal_idx, GFP_KERNEL)) > > - return -ENOMEM; > > - > > - mutex_lock(&mdev->graph_mutex); > > - > > - ret = ida_get_new_above(&mdev->entity_internal_idx, 1, > > - &entity->internal_idx); > > - if (ret < 0) { > > - mutex_unlock(&mdev->graph_mutex); > > + ret = ida_alloc_min(&mdev->entity_internal_idx, 1, GFP_KERNEL); > > + if (ret < 0) > > return ret; > > - } > > + entity->internal_idx = ret; > > > > + mutex_lock(&mdev->graph_mutex); > > mdev->entity_internal_idx_max = > > max(mdev->entity_internal_idx_max, entity->internal_idx); > > > > @@ -632,7 +626,7 @@ static void __media_device_unregister_entity(struct media_entity *entity) > > struct media_interface *intf; > > unsigned int i; > > > > - ida_simple_remove(&mdev->entity_internal_idx, entity->internal_idx); > > + ida_free(&mdev->entity_internal_idx, entity->internal_idx); > > > > /* Remove all interface links pointing to this entity */ > > list_for_each_entry(intf, &mdev->interfaces, graph_obj.list) { > Thanks, Mauro