slp_global_lock: Fixed for kernel 3.12
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Mon, 17 Mar 2014 07:59:10 +0000 (11:59 +0400)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 9 Apr 2014 05:42:29 +0000 (14:42 +0900)
Change-Id: I89f0cedba73eae66e56911b8ebcfb9010443d4bd

drivers/misc/slp_global_lock.c

index 01f2d38eb74b4c58a1841782794465976ec7bd6d..4e78e7976b97871c3ca1cb3412336b3e4c5ab702 100644 (file)
@@ -101,12 +101,11 @@ static struct sgl_hash_node *sgl_hash_get_node(struct sgl_hash_head *hash, unsig
        struct sgl_hash_node *found = NULL;
 
        struct hlist_head *head = &hash_head->head;
-       struct hlist_node *pos;
 
        SGL_LOG("key %d", key);
 
        mutex_lock(&hash_head->mutex);
-       hlist_for_each_entry(hash_node, pos, head, node) {
+       hlist_for_each_entry(hash_node, head, node) {
                if (hash_node->key == key) {
                        found = hash_node;
                        break;
@@ -152,14 +151,13 @@ static int sgl_hash_remove_node(struct sgl_hash_head *hash, unsigned int key)
        struct sgl_hash_node *hash_node;
 
        struct hlist_head *head = &hash_head->head;
-       struct hlist_node *pos;
 
        int err = -ENOENT;
 
        SGL_LOG("key %d", key);
 
        mutex_lock(&hash_head->mutex);
-       hlist_for_each_entry(hash_node, pos, head, node) {
+       hlist_for_each_entry(hash_node, head, node) {
                if (hash_node->key == key) {
                        hlist_del(&hash_node->node);
                        kfree(hash_node);
@@ -667,14 +665,13 @@ static void sgl_dump_locks(void)
                struct sgl_hash_head *shead;
                struct sgl_hash_node *snode;
                struct hlist_head *hhead;
-               struct hlist_node *pos;
 
                shead = &((struct sgl_hash_head *)sgl_global.locks)[i];
                if (!shead)
                        continue;
                mutex_lock(&shead->mutex);
                hhead = &shead->head;
-               hlist_for_each_entry(snode, pos, hhead, node) {
+               hlist_for_each_entry(snode, hhead, node) {
                        struct sgl_lock *lock = snode->lock;
                        mutex_lock(&lock->data_mutex);
                        SGL_INFO("lock key: %d, refcnt: %d, owner_pid: %d, owner_tid: %d\n",