From: Christian Brauner <christian.brauner@ubuntu.com>
To: Yadav Lamichhane <tuxomega1@gmail.com>
Cc: serge@hallyn.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] userns: Fix a kernel coding style issue
Date: Mon, 27 Jul 2020 15:39:49 +0200 [thread overview]
Message-ID: <20200727133949.fh6htr4zff3uwm5p@wittgenstein> (raw)
In-Reply-To: <20200727113323.79720-1-tuxomega1@gmail.com>
On Mon, Jul 27, 2020 at 05:18:23PM +0545, Yadav Lamichhane wrote:
> fix a brace around if-else statement and for loop.
>
> Signed-off-by: Yadav Lamichhane <tuxomega1@gmail.com>
> ---
> kernel/user_namespace.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
> index 87804e0371fe..7703753cac97 100644
> --- a/kernel/user_namespace.c
> +++ b/kernel/user_namespace.c
> @@ -118,9 +118,8 @@ int create_user_ns(struct cred *new)
> ns->owner = owner;
> ns->group = group;
> INIT_WORK(&ns->work, free_user_ns);
> - for (i = 0; i < UCOUNT_COUNTS; i++) {
> + for (i = 0; i < UCOUNT_COUNTS; i++)
> ns->ucount_max[i] = INT_MAX;
> - }
> ns->ucounts = ucounts;
>
> /* Inherit USERNS_SETGROUPS_ALLOWED from our parent */
> @@ -1156,12 +1155,10 @@ ssize_t proc_setgroups_write(struct file *file, const char __user *buf,
> if (strncmp(pos, "allow", 5) == 0) {
> pos += 5;
> setgroups_allowed = true;
> - }
> - else if (strncmp(pos, "deny", 4) == 0) {
> + } else if (strncmp(pos, "deny", 4) == 0) {
> pos += 4;
> setgroups_allowed = false;
> - }
> - else
> + } else
> goto out;
Kernel coding style would mandate that the else be enclosed in {} as well.
Christian
prev parent reply other threads:[~2020-07-27 13:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 11:33 Yadav Lamichhane
2020-07-27 13:39 ` Christian Brauner [this message]
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=20200727133949.fh6htr4zff3uwm5p@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=serge@hallyn.com \
--cc=tuxomega1@gmail.com \
/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
all inboxes | Powered by JetHome®