From patchwork Sun Nov 21 10:46:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ionut Nicu X-Patchwork-Id: 345571 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oALAl0Ru024320 for ; Sun, 21 Nov 2010 10:47:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752698Ab0KUKrP (ORCPT ); Sun, 21 Nov 2010 05:47:15 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:43575 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376Ab0KUKrO (ORCPT ); Sun, 21 Nov 2010 05:47:14 -0500 Received: by mail-fx0-f46.google.com with SMTP id 13so1867561fxm.19 for ; Sun, 21 Nov 2010 02:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=aDgj4HlRIKd3nvV+IvzXkC3GabKWnfDyP/BWKJ03JVY=; b=QzrLnvycNu1cPt5g4r5WdcrFYHI358Fzq4as1/8i+ysgbLseQcUhndfoidBYqSdAp2 h/gpudBjZhQVIo4tXMtQS0sfUNRntOuKaFm0We00SSqlTIJ8wljPj63WFXWAVhHc8bR8 z2XEannioDyCl3yM8zbnTMS6cfgoQ6jFSdfQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=tBhgP0/pgMTjm6dnntuzIagS40VRa91TQDUZPAyhzIqVEG7tKVl8afousR6XmNKWqQ U+7QJksVUrul5p/PluzRoaS30WDaZo4oWnCYHk2VbhKxAygynB88Pm8Zj/EN7dGJYrBz lieU6UwHxZMeBz3Zytl1x9KjuUD3LUudMOVaA= Received: by 10.223.102.141 with SMTP id g13mr2985165fao.133.1290336433960; Sun, 21 Nov 2010 02:47:13 -0800 (PST) Received: from localhost.localdomain (196-98-odb-svnet.titannet.ro [77.81.196.98]) by mx.google.com with ESMTPS id e6sm1012936fav.32.2010.11.21.02.47.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 21 Nov 2010 02:47:13 -0800 (PST) From: Ionut Nicu To: Omar Ramirez Luna Cc: Greg Kroah-Hartman , Sapiens Rene , Andy Shevchenko , Fernando Guzman Lugo , Felipe Contreras , linux-omap , Ionut Nicu Subject: [PATCH v3 09/12] staging: tidspbridge: remove custom linked list Date: Sun, 21 Nov 2010 12:46:27 +0200 Message-Id: <1290336390-2581-10-git-send-email-ionut.nicu@mindbit.ro> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1290336390-2581-1-git-send-email-ionut.nicu@mindbit.ro> References: <1290336390-2581-1-git-send-email-ionut.nicu@mindbit.ro> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 21 Nov 2010 10:47:20 +0000 (UTC) diff --git a/drivers/staging/tidspbridge/TODO b/drivers/staging/tidspbridge/TODO index 187363f..1c51e2d 100644 --- a/drivers/staging/tidspbridge/TODO +++ b/drivers/staging/tidspbridge/TODO @@ -6,7 +6,6 @@ * Eliminate general services and libraries - use or extend existing kernel libraries instead (e.g. gcf/lcm in nldr.c, global helpers in gen/) * Eliminate direct manipulation of OMAP_SYSC_BASE -* Eliminate list.h : seem like a redundant wrapper to existing kernel lists * Eliminate DSP_SUCCEEDED macros and their imposed redundant indentations (adopt the kernel way of checking for return values) * Audit interfaces exposed to user space diff --git a/drivers/staging/tidspbridge/include/dspbridge/list.h b/drivers/staging/tidspbridge/include/dspbridge/list.h deleted file mode 100644 index 6837b61..0000000 --- a/drivers/staging/tidspbridge/include/dspbridge/list.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * list.h - * - * DSP-BIOS Bridge driver support functions for TI OMAP processors. - * - * Declarations of list management control structures and definitions - * of inline list management functions. - * - * Copyright (C) 2008 Texas Instruments, Inc. - * - * This package is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef LIST_ -#define LIST_ - -#include -#include - -#define LST_IS_EMPTY(l) list_empty(&(l)->head) - -struct lst_list { - struct list_head head; -}; - -/* - * ======== lst_first ======== - * Purpose: - * Returns a pointer to the first element of the list, or NULL if the list - * is empty. - * Parameters: - * lst: Pointer to list control structure. - * Returns: - * Pointer to first list element, or NULL. - * Requires: - * - LST initialized. - * - lst != NULL. - * Ensures: - */ -static inline struct list_head *lst_first(struct lst_list *lst) -{ - if (lst && !list_empty(&lst->head)) - return lst->head.next; - return NULL; -} - -/* - * ======== lst_get_head ======== - * Purpose: - * Pops the head off the list and returns a pointer to it. - * Details: - * If the list is empty, returns NULL. - * Else, removes the element at the head of the list, making the next - * element the head of the list. - * The head is removed by making the tail element of the list point its - * "next" pointer at the next element after the head, and by making the - * "prev" pointer of the next element after the head point at the tail - * element. So the next element after the head becomes the new head of - * the list. - * Parameters: - * lst: Pointer to list control structure of list whose head - * element is to be removed - * Returns: - * Pointer to element that was at the head of the list (success) - * NULL No elements in list - * Requires: - * - LST initialized. - * - lst != NULL. - * Ensures: - * Notes: - * Because the tail of the list points forward (its "next" pointer) to - * the head of the list, and the head of the list points backward (its - * "prev" pointer) to the tail of the list, this list is circular. - */ -static inline struct list_head *lst_get_head(struct lst_list *lst) -{ - struct list_head *elem_list; - - if (!lst || list_empty(&lst->head)) - return NULL; - - elem_list = lst->head.next; - lst->head.next = elem_list->next; - elem_list->next->prev = &lst->head; - - return elem_list; -} - -/* - * ======== lst_init_elem ======== - * Purpose: - * Initializes a list element to default (cleared) values - * Details: - * Parameters: - * elem_list: Pointer to list element to be reset - * Returns: - * Requires: - * LST initialized. - * Ensures: - * Notes: - * This function must not be called to "reset" an element in the middle - * of a list chain -- that would break the chain. - * - */ -static inline void lst_init_elem(struct list_head *elem_list) -{ - if (elem_list) { - elem_list->next = NULL; - elem_list->prev = NULL; - } -} - -/* - * ======== lst_insert_before ======== - * Purpose: - * Insert the element before the existing element. - * Parameters: - * lst: Pointer to list control structure. - * elem_list: Pointer to element in list to insert. - * elem_existing: Pointer to existing list element. - * Returns: - * Requires: - * - LST initialized. - * - lst != NULL. - * - elem_list != NULL. - * - elem_existing != NULL. - * Ensures: - */ -static inline void lst_insert_before(struct lst_list *lst, - struct list_head *elem_list, - struct list_head *elem_existing) -{ - if (lst && elem_list && elem_existing) - list_add_tail(elem_list, elem_existing); -} - -/* - * ======== lst_next ======== - * Purpose: - * Returns a pointer to the next element of the list, or NULL if the next - * element is the head of the list or the list is empty. - * Parameters: - * lst: Pointer to list control structure. - * cur_elem: Pointer to element in list to remove. - * Returns: - * Pointer to list element, or NULL. - * Requires: - * - LST initialized. - * - lst != NULL. - * - cur_elem != NULL. - * Ensures: - */ -static inline struct list_head *lst_next(struct lst_list *lst, - struct list_head *cur_elem) -{ - if (lst && !list_empty(&lst->head) && cur_elem && - (cur_elem->next != &lst->head)) - return cur_elem->next; - return NULL; -} - -/* - * ======== lst_put_tail ======== - * Purpose: - * Adds the specified element to the tail of the list - * Details: - * Sets new element's "prev" pointer to the address previously held by - * the head element's prev pointer. This is the previous tail member of - * the list. - * Sets the new head's prev pointer to the address of the element. - * Sets next pointer of the previous tail member of the list to point to - * the new element (rather than the head, which it had been pointing at). - * Sets new element's next pointer to the address of the head element. - * Sets head's prev pointer to the address of the new element. - * Parameters: - * lst: Pointer to list control structure to which *elem_list will be - * added - * elem_list: Pointer to list element to be added - * Returns: - * Void - * Requires: - * *elem_list and *lst must both exist. - * LST initialized. - * Ensures: - * Notes: - * Because the tail is always "just before" the head of the list (the - * tail's "next" pointer points at the head of the list, and the head's - * "prev" pointer points at the tail of the list), the list is circular. - */ -static inline void lst_put_tail(struct lst_list *lst, - struct list_head *elem_list) -{ - if (lst && elem_list) - list_add_tail(elem_list, &lst->head); -} - -/* - * ======== lst_remove_elem ======== - * Purpose: - * Removes (unlinks) the given element from the list, if the list is not - * empty. Does not free the list element. - * Parameters: - * lst: Pointer to list control structure. - * cur_elem: Pointer to element in list to remove. - * Returns: - * Requires: - * - LST initialized. - * - lst != NULL. - * - cur_elem != NULL. - * Ensures: - */ -static inline void lst_remove_elem(struct lst_list *lst, - struct list_head *cur_elem) -{ - if (lst && !list_empty(&lst->head) && cur_elem) - list_del_init(cur_elem); -} - -#endif /* LIST_ */