]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/mm: add __rcu annotations
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 9 May 2017 11:44:43 +0000 (13:44 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 12 Jun 2017 14:25:55 +0000 (16:25 +0200)
Add __rcu annotations so sparse correctly warns only if "slot" gets
derefenced without using rcu_dereference(). Right now we get warnings
because of the missing annotation:

arch/s390/mm/gmap.c:135:17: warning: incorrect type in assignment (different address spaces)
arch/s390/mm/gmap.c:135:17:    expected void **slot
arch/s390/mm/gmap.c:135:17:    got void [noderef] <asn:4>**

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/gmap.c

index fbd664e4809830894033cc17fd7a49ebd8b52a04..4fb3d3cdb370db610c0fcafb6d7f25af7084d331 100644 (file)
@@ -125,7 +125,7 @@ static void gmap_radix_tree_free(struct radix_tree_root *root)
        struct radix_tree_iter iter;
        unsigned long indices[16];
        unsigned long index;
-       void **slot;
+       void __rcu **slot;
        int i, nr;
 
        /* A radix tree is freed by deleting all of its entries */
@@ -150,7 +150,7 @@ static void gmap_rmap_radix_tree_free(struct radix_tree_root *root)
        struct radix_tree_iter iter;
        unsigned long indices[16];
        unsigned long index;
-       void **slot;
+       void __rcu **slot;
        int i, nr;
 
        /* A radix tree is freed by deleting all of its entries */
@@ -1011,7 +1011,7 @@ EXPORT_SYMBOL_GPL(gmap_read_table);
 static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr,
                                    struct gmap_rmap *rmap)
 {
-       void **slot;
+       void __rcu **slot;
 
        BUG_ON(!gmap_is_shadow(sg));
        slot = radix_tree_lookup_slot(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT);