From patchwork Fri Dec 11 13:34:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 7829821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D3539F387 for ; Fri, 11 Dec 2015 13:34:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6816220524 for ; Fri, 11 Dec 2015 13:34:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C3CE20588 for ; Fri, 11 Dec 2015 13:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752775AbbLKNed (ORCPT ); Fri, 11 Dec 2015 08:34:33 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:51756 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbbLKNe3 (ORCPT ); Fri, 11 Dec 2015 08:34:29 -0500 Received: from 179.186.108.20.dynamic.adsl.gvt.net.br ([179.186.108.20] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1a7Nq8-000355-HB; Fri, 11 Dec 2015 13:34:28 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86) (envelope-from ) id 1a7Npw-0003Ha-AU; Fri, 11 Dec 2015 11:34:16 -0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 09/10] media-entity: get rid of forward __media_entity_remove_link() declaration Date: Fri, 11 Dec 2015 11:34:14 -0200 Message-Id: <71b0cac4a89540f4f17b89a33624c9acdbd02631.1449840443.git.mchehab@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move this function to happen earlier, in order to avoid a uneeded forward declaration. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/media-entity.c | 67 +++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 5a5432524c10..452af1d5a20d 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -588,7 +588,38 @@ static struct media_link *media_add_link(struct list_head *head) } static void __media_entity_remove_link(struct media_entity *entity, - struct media_link *link); + struct media_link *link) +{ + struct media_link *rlink, *tmp; + struct media_entity *remote; + unsigned int r = 0; + + if (link->source->entity == entity) + remote = link->sink->entity; + else + remote = link->source->entity; + + list_for_each_entry_safe(rlink, tmp, &remote->links, list) { + if (rlink != link->reverse) { + r++; + continue; + } + + if (link->source->entity == entity) + remote->num_backlinks--; + + /* Remove the remote link */ + list_del(&rlink->list); + media_gobj_remove(&rlink->graph_obj); + kfree(rlink); + + if (--remote->num_links == 0) + break; + } + list_del(&link->list); + media_gobj_remove(&link->graph_obj); + kfree(link); +} int media_create_pad_link(struct media_entity *source, u16 source_pad, @@ -642,40 +673,6 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, } EXPORT_SYMBOL_GPL(media_create_pad_link); -static void __media_entity_remove_link(struct media_entity *entity, - struct media_link *link) -{ - struct media_link *rlink, *tmp; - struct media_entity *remote; - unsigned int r = 0; - - if (link->source->entity == entity) - remote = link->sink->entity; - else - remote = link->source->entity; - - list_for_each_entry_safe(rlink, tmp, &remote->links, list) { - if (rlink != link->reverse) { - r++; - continue; - } - - if (link->source->entity == entity) - remote->num_backlinks--; - - /* Remove the remote link */ - list_del(&rlink->list); - media_gobj_remove(&rlink->graph_obj); - kfree(rlink); - - if (--remote->num_links == 0) - break; - } - list_del(&link->list); - media_gobj_remove(&link->graph_obj); - kfree(link); -} - void __media_entity_remove_links(struct media_entity *entity) { struct media_link *link, *tmp;