From patchwork Fri Nov 5 15:13:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ionut Nicu X-Patchwork-Id: 304212 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 oA5FEQrW027759 for ; Fri, 5 Nov 2010 15:14:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753332Ab0KEPOZ (ORCPT ); Fri, 5 Nov 2010 11:14:25 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:33152 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297Ab0KEPOZ (ORCPT ); Fri, 5 Nov 2010 11:14:25 -0400 Received: by mail-gw0-f46.google.com with SMTP id 21so2210883gwj.19 for ; Fri, 05 Nov 2010 08:14:24 -0700 (PDT) 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=v1BeFObienTigSHTn3MuJdq8gxAPeUfswNEvDMLD4ns=; b=lStIuTkwVxGtV9O+CRX7DHTcTV/JvEQVLtxYnacW3yZmJ3JX4IZcXvyBqmXuyoGXNK 0o464vkAb9VadIvqtshcIcQnfa5OkHHyUGiZdwN0KD8sC5j+SLLAyH0AAAD5HBy5pZXq iU5DKIcm+szfcgR8ly9LJk9ZO9FeE8sn7rm+s= 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=XwMdVKdtYFMj0FeDQ9//uiM/dKbSdaBBcT0w6ASkL5fOgE3pSevosXB1GA7LjcIWTA WgNqG5OunjAZ6FHYejJEUr4CsKpBS3hT0dt5XAsQxJ+v3qbPy7GNP/lmyX6MY9N5eYL7 FdkwElyGRVcyJbauPk9WHwPmGCmX2XYgQ7P4M= Received: by 10.204.119.145 with SMTP id z17mr1960322bkq.128.1288970063895; Fri, 05 Nov 2010 08:14:23 -0700 (PDT) Received: from localhost.localdomain (196-98-odb-svnet.titannet.ro [77.81.196.98]) by mx.google.com with ESMTPS id r21sm1072535bkj.22.2010.11.05.08.14.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Nov 2010 08:14:22 -0700 (PDT) From: Ionut Nicu To: Greg Kroah-Hartman , Omar Ramirez Luna Cc: Fernando Guzman Lugo , Felipe Contreras , Andy Shevchenko , Sapiens Rene , linux-omap , Ionut Nicu Subject: [PATCH v2 09/12] staging: tidspbridge: remove custom linked list Date: Fri, 5 Nov 2010 17:13:13 +0200 Message-Id: <1288969996-22103-10-git-send-email-ionut.nicu@mindbit.ro> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1288969996-22103-1-git-send-email-ionut.nicu@mindbit.ro> References: <1288969996-22103-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]); Fri, 05 Nov 2010 15:14:26 +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_ */