linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: linux-fscrypt@vger.kernel.org, "Theodore Y . Ts'o" <tytso@mit.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Eric Biggers <ebiggers@google.com>
Subject: [PATCH] fs/crypto/hooks.c: fix build with pre-4.6 gcc versions
Date: Fri, 19 Jan 2018 13:45:24 -0800	[thread overview]
Message-ID: <20180119214524.222850-1-ebiggers3@gmail.com> (raw)

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

             reply	other threads:[~2018-01-19 21:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 21:45 Eric Biggers [this message]
2018-01-19 21:53 ` [PATCH] fs/crypto/hooks.c: fix build with pre-4.6 gcc versions Andrew Morton
2018-01-25 18:42   ` Eric Biggers
2018-01-29 18:10     ` Eric Biggers
2018-02-01 15:52 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180119214524.222850-1-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiggers@google.com \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).