From patchwork Fri Sep 11 10:09:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 7159201 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AAEAEBF036 for ; Fri, 11 Sep 2015 10:11:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC92A20830 for ; Fri, 11 Sep 2015 10:11:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8C1720829 for ; Fri, 11 Sep 2015 10:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbbIKKLa (ORCPT ); Fri, 11 Sep 2015 06:11:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:15153 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbbIKKL3 (ORCPT ); Fri, 11 Sep 2015 06:11:29 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Sep 2015 03:11:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,511,1437462000"; d="scan'208";a="802336022" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2015 03:11:01 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 7A3C820895; Fri, 11 Sep 2015 13:11:00 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id 5FB1B201EF; Fri, 11 Sep 2015 13:09:23 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, javier@osg.samsung.com, mchehab@osg.samsung.com, hverkuil@xs4all.nl Subject: [RFC 1/9] media: Rename MEDIA_ENTITY_ENUM_MAX_ID as MEDIA_ENTITY_MAX_LOW_ID Date: Fri, 11 Sep 2015 13:09:04 +0300 Message-Id: <1441966152-28444-2-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.1.0.231.g7484e3b In-Reply-To: <1441966152-28444-1-git-send-email-sakari.ailus@linux.intel.com> References: <1441966152-28444-1-git-send-email-sakari.ailus@linux.intel.com> 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 Rename the macro as it no longer is a maximum ID that an entity can have, but a low ID which is used for internal purposes of enumeration. This is the maximum number of concurrent entities that may exist in a media device. Signed-off-by: Sakari Ailus --- drivers/media/media-entity.c | 6 +++--- include/media/media-entity.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 2c984fb..5526e8c 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -332,9 +332,9 @@ void media_entity_graph_walk_start(struct media_entity_graph *graph, { graph->top = 0; graph->stack[graph->top].entity = NULL; - bitmap_zero(graph->entities, MEDIA_ENTITY_ENUM_MAX_ID); + bitmap_zero(graph->entities, MEDIA_ENTITY_MAX_LOW_ID); - if (WARN_ON(media_entity_id(entity) >= MEDIA_ENTITY_ENUM_MAX_ID)) + if (WARN_ON(media_entity_id(entity) >= MEDIA_ENTITY_MAX_LOW_ID)) return; __set_bit(media_entity_id(entity), graph->entities); @@ -381,7 +381,7 @@ media_entity_graph_walk_next(struct media_entity_graph *graph) /* Get the entity in the other end of the link . */ next = media_entity_other(entity, link); - if (WARN_ON(media_entity_id(next) >= MEDIA_ENTITY_ENUM_MAX_ID)) + if (WARN_ON(media_entity_id(next) >= MEDIA_ENTITY_MAX_LOW_ID)) return NULL; /* Has the entity already been visited? */ diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 44ab153..bb6383b 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -304,7 +304,7 @@ static inline bool is_media_entity_v4l2_subdev(struct media_entity *entity) } #define MEDIA_ENTITY_ENUM_MAX_DEPTH 16 -#define MEDIA_ENTITY_ENUM_MAX_ID 64 +#define MEDIA_ENTITY_MAX_LOW_ID 64 struct media_entity_graph { struct { @@ -312,7 +312,7 @@ struct media_entity_graph { struct list_head *link; } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH]; - DECLARE_BITMAP(entities, MEDIA_ENTITY_ENUM_MAX_ID); + DECLARE_BITMAP(entities, MEDIA_ENTITY_MAX_LOW_ID); int top; };