]> git.hungrycats.org Git - linux/commitdiff
Make "static const" initializer to zero explicit, since truly
authorLinus Torvalds <torvalds@home.osdl.org>
Tue, 5 Aug 2003 03:13:37 +0000 (20:13 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 5 Aug 2003 03:13:37 +0000 (20:13 -0700)
constant values should not end up in the BSS.

We're better off having the compiler put it in the .rodata
section (which it will, thanks to the initializer and the
"const"), since that will result in it being nicely cacheable
in shared SMP caches.

mm/shmem.c

index bb1629c4512b68824a681fd96a9c2b49b90ce543..9b943298b0fdc81a087eb9da0f6b853dbfe5db1e 100644 (file)
@@ -296,7 +296,7 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long
        struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
        struct page *page = NULL;
        swp_entry_t *entry;
-       static const swp_entry_t unswapped;
+       static const swp_entry_t unswapped = { 0 };
 
        if (sgp != SGP_WRITE &&
            ((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode))