mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <christian.brauner@ubuntu.com>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: oleg@redhat.com, axboe@kernel.dk, ebiederm@xmission.com,
	madhuparnabhowmik10@gmail.com, gustavoars@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] signal: clean up codestyle
Date: Tue, 1 Sep 2020 14:20:47 +0200	[thread overview]
Message-ID: <20200901122047.7hzztrssvr72wb2d@wittgenstein> (raw)
In-Reply-To: <20200901115800.7916-1-linmiaohe@huawei.com>

On Tue, Sep 01, 2020 at 07:58:00AM -0400, Miaohe Lin wrote:
> No functional change intended.

Hey Miaohe,

Thank you for the patch.
I'm sure this is well-intended but afaict the whole file has more or
less a consistent style already where e.g. sig-1 without spaces seems to
be preferred. The same for the casts where most places use a single
space.

Now, I know CodingStyle.rst is on your side at least when it comes to
the first point:

Use one space around (on each side of) most binary and ternary operators,
such as any of these::

	=  +  -  <  >  *  /  %  |  &  ^  <=  >=  ==  !=  ?  :

but then you'd need to change each place in kernel/signal.c where that
is currently not the case. Otherwise we end up with a weird mix.

Thanks!
Christian

> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  kernel/signal.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/signal.c b/kernel/signal.c
> index a38b3edc6851..10a31fafc35b 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1115,8 +1115,8 @@ static int __send_signal(int sig, struct kernel_siginfo *info, struct task_struc
>  	q = __sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit);
>  	if (q) {
>  		list_add_tail(&q->list, &pending->list);
> -		switch ((unsigned long) info) {
> -		case (unsigned long) SEND_SIG_NOINFO:
> +		switch ((unsigned long)info) {
> +		case (unsigned long)SEND_SIG_NOINFO:
>  			clear_siginfo(&q->info);
>  			q->info.si_signo = sig;
>  			q->info.si_errno = 0;
> @@ -1129,7 +1129,7 @@ static int __send_signal(int sig, struct kernel_siginfo *info, struct task_struc
>  						 current_uid());
>  			rcu_read_unlock();
>  			break;
> -		case (unsigned long) SEND_SIG_PRIV:
> +		case (unsigned long)SEND_SIG_PRIV:
>  			clear_siginfo(&q->info);
>  			q->info.si_signo = sig;
>  			q->info.si_errno = 0;
> @@ -1314,7 +1314,7 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
>  	int sig = info->si_signo;
>  
>  	spin_lock_irqsave(&t->sighand->siglock, flags);
> -	action = &t->sighand->action[sig-1];
> +	action = &t->sighand->action[sig - 1];
>  	ignored = action->sa.sa_handler == SIG_IGN;
>  	blocked = sigismember(&t->blocked, sig);
>  	if (blocked || ignored) {
> -- 
> 2.19.1
> 

  reply	other threads:[~2020-09-01 12:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 11:58 Miaohe Lin
2020-09-01 12:20 ` Christian Brauner [this message]
2020-09-01 16:39   ` Oleg Nesterov
2020-09-01 16:42     ` Christian Brauner
2020-09-01 12:47 linmiaohe
2020-09-02  1:34 linmiaohe
2020-09-02  8:47 ` Christian Brauner
2020-09-03  1:54 linmiaohe

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=20200901122047.7hzztrssvr72wb2d@wittgenstein \
    --to=christian.brauner@ubuntu.com \
    --cc=axboe@kernel.dk \
    --cc=ebiederm@xmission.com \
    --cc=gustavoars@kernel.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madhuparnabhowmik10@gmail.com \
    --cc=oleg@redhat.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®