From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2847BFD21E1 for ; Mon, 30 Jul 2018 14:55:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D429320870 for ; Mon, 30 Jul 2018 14:55:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kfSViWBP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D429320870 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731906AbeG3Qas (ORCPT ); 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