diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2013-06-05 19:09:55 +0200 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2013-08-14 14:26:43 +0200 |
commit | f3802156a3e34ac0e98cf44d7bee3fea84b31a89 (patch) | |
tree | 230c9219bb4a453665741683ea200171af31b99c /drm_hashtab.c | |
parent | cf095dfed8c2bd71352767c68b14ab86b82948da (diff) |
drm: Workaround new hlist interface
This interface was changed in 3.9 which is found on Fedora 18.
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Diffstat (limited to 'drm_hashtab.c')
-rw-r--r-- | drm_hashtab.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drm_hashtab.c b/drm_hashtab.c index aa80304..960b5a5 100644 --- a/drm_hashtab.c +++ b/drm_hashtab.c @@ -74,7 +74,11 @@ void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key) hashed_key = hash_long(key, ht->order); DRM_DEBUG("Key is 0x%08lx, Hashed key is 0x%08x\n", key, hashed_key); h_list = &ht->table[hashed_key]; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) hlist_for_each_entry(entry, list, h_list, head) +#else + hlist_for_each_entry(entry, h_list, head) +#endif DRM_DEBUG("count %d, key: 0x%08lx\n", count++, entry->key); } @@ -88,9 +92,13 @@ static struct hlist_node *drm_ht_find_key(struct drm_open_hash *ht, hashed_key = hash_long(key, ht->order); h_list = &ht->table[hashed_key]; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) hlist_for_each_entry(entry, list, h_list, head) { +#else + hlist_for_each_entry(entry, h_list, head) { +#endif if (entry->key == key) - return list; + return &entry->head; if (entry->key > key) break; } @@ -107,9 +115,13 @@ static struct hlist_node *drm_ht_find_key_rcu(struct drm_open_hash *ht, hashed_key = hash_long(key, ht->order); h_list = &ht->table[hashed_key]; - hlist_for_each_entry_rcu(entry, list, h_list, head) { +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) + hlist_for_each_entry(entry, list, h_list, head) { +#else + hlist_for_each_entry(entry, h_list, head) { +#endif if (entry->key == key) - return list; + return &entry->head; if (entry->key > key) break; } @@ -127,12 +139,16 @@ int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item) hashed_key = hash_long(key, ht->order); h_list = &ht->table[hashed_key]; parent = NULL; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) hlist_for_each_entry(entry, list, h_list, head) { +#else + hlist_for_each_entry(entry, h_list, head) { +#endif if (entry->key == key) return -EINVAL; if (entry->key > key) break; - parent = list; + parent = &entry->head; } if (parent) { hlist_add_after_rcu(parent, &item->head); |