From: Eric Biggers Date: Fri, 19 Jan 2018 21:45:24 +0000 (-0800) Subject: fscrypt: fix build with pre-4.6 gcc versions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b4edfb10398cae62114f95201bdd2e997319920;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fscrypt: fix build with pre-4.6 gcc versions gcc versions prior to 4.6 require an extra level of braces when using a designated initializer for a member in an anonymous struct or union. This caused a compile error with the 'struct qstr' initialization in __fscrypt_encrypt_symlink(). Fix it by using QSTR_INIT(). Reported-by: Andrew Morton Fixes: 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()") Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o --- diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 28f9f059571d..bec06490fb13 100644 --- a/fs/crypto/hooks.c +++ b/fs/crypto/hooks.c @@ -158,7 +158,7 @@ int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, unsigned int len, struct fscrypt_str *disk_link) { int err; - struct qstr iname = { .name = target, .len = len }; + struct qstr iname = QSTR_INIT(target, len); struct fscrypt_symlink_data *sd; unsigned int ciphertext_len;