Changeset 91bef446 in mainline for kernel/genarch/src/mm/page_ht.c


Ignore:
Timestamp:
2019-02-24T15:45:40Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Parents:
0c48e14
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-24 15:44:39)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-24 15:45:40)
Message:

Const hash table keys in kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/mm/page_ht.c

    r0c48e14 r91bef446  
    5454
    5555static size_t ht_hash(const ht_link_t *);
    56 static size_t ht_key_hash(void *);
    57 static bool ht_key_equal(void *, const ht_link_t *);
     56static size_t ht_key_hash(const void *);
     57static bool ht_key_equal(const void *, const ht_link_t *);
    5858static void ht_remove_callback(ht_link_t *);
    5959
     
    109109
    110110/** Return the hash of the key. */
    111 size_t ht_key_hash(void *arg)
    112 {
    113         uintptr_t *key = (uintptr_t *) arg;
     111size_t ht_key_hash(const void *arg)
     112{
     113        const uintptr_t *key = arg;
    114114        size_t hash = 0;
    115115        hash = hash_combine(hash, key[KEY_AS]);
     
    119119
    120120/** Return true if the key is equal to the item's lookup key. */
    121 bool ht_key_equal(void *arg, const ht_link_t *item)
    122 {
    123         uintptr_t *key = (uintptr_t *) arg;
     121bool ht_key_equal(const void *arg, const ht_link_t *item)
     122{
     123        const uintptr_t *key = arg;
    124124        pte_t *pte = hash_table_get_inst(item, pte_t, link);
    125125        return (key[KEY_AS] == (uintptr_t) pte->as) &&
Note: See TracChangeset for help on using the changeset viewer.