linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/crypto/hooks.c: fix build with pre-4.6 gcc versions
@ 2018-01-19 21:45 Eric Biggers
  2018-01-19 21:53 ` Andrew Morton
  2018-02-01 15:52 ` Theodore Ts'o
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Biggers @ 2018-01-19 21:45 UTC (permalink / raw)
  To: linux-fscrypt, Theodore Y . Ts'o; +Cc: Andrew Morton, Eric Biggers

From: Eric Biggers <ebiggers@google.com>

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 <akpm@linux-foundation.org>
Fixes: 76e81d6d5048 ("fscrypt: new helper functions for ->symlink()")
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/crypto/hooks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
-- 
2.16.0.rc1.238.g530d649a79-goog

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-01 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19 21:45 [PATCH] fs/crypto/hooks.c: fix build with pre-4.6 gcc versions Eric Biggers
2018-01-19 21:53 ` Andrew Morton
2018-01-25 18:42   ` Eric Biggers
2018-01-29 18:10     ` Eric Biggers
2018-02-01 15:52 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).