]> git.hungrycats.org Git - linux/commitdiff
Avoid using the gcc-ism of creating an anonymous structure directly
authorLinus Torvalds <torvalds@home.transmeta.com>
Mon, 24 Mar 2003 01:32:59 +0000 (17:32 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 24 Mar 2003 01:32:59 +0000 (17:32 -0800)
by having a cast followed by an initializer. It seems even gcc can't
do it right anyway in some versions (as reported by Jens Axboe).

fs/dcache.c

index 1ba709a1b454fbea299d185fe7bf64607834eaee..bc81b85309e094df7019deb1eb05592d642a2d0f 100644 (file)
@@ -784,7 +784,8 @@ struct dentry * d_alloc_root(struct inode * root_inode)
        struct dentry *res = NULL;
 
        if (root_inode) {
-               res = d_alloc(NULL, &(const struct qstr) { "/", 1, 0 });
+               static const struct qstr name = { .name = "/", .len = 1, .hash = 0 };
+               res = d_alloc(NULL, &name);
                if (res) {
                        res->d_sb = root_inode->i_sb;
                        res->d_parent = res;