Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1323901

Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof
Date 2016-02-02 10:20 +0100
Message-ID <qXFhU-mN-13@gated-at.bofh.it> (permalink)
References <qXE2v-7EE-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Wei Tang <tangwei@cmss.chinamobile.com> wrote:

> This patch fixes the checkpatch.pl warning to fork.c:
> 
> WARNING: sizeof sig->rlim should be sizeof(sig->rlim)
> 
> Signed-off-by: Wei Tang <tangwei@cmss.chinamobile.com>
> ---
>  kernel/fork.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 2e391c7..30e04d2 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1143,7 +1143,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
>  	sig->real_timer.function = it_real_fn;
>  
>  	task_lock(current->group_leader);
> -	memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
> +	memcpy(sig->rlim, current->signal->rlim, sizeof(sig->rlim));
>  	task_unlock(current->group_leader);
>  
>  	posix_cpu_timers_init_group(sig);

So there's over 1,000 such occurances in the kernel and we do not need this 
drip-drip churn...

If anyone feels strongly about accepting such patches, then the right solution is 
to create a Coccinelle semantic patch to run over the whole kernel and get over 
with the churn once and for all.

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] kernel/fork.c: use sizeof() instead of sizeof Wei Tang <tangwei@cmss.chinamobile.com> - 2016-02-02 09:00 +0100
  Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Ingo Molnar <mingo@kernel.org> - 2016-02-02 10:20 +0100
    Re: [PATCH] treewide: Use 'sizeof(x)' instead of 'sizeof x' Joe Perches <joe@perches.com> - 2016-02-02 15:00 +0100
    Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-02 16:50 +0100
      Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Joe Perches <joe@perches.com> - 2016-02-02 18:10 +0100
        Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-02 18:20 +0100
          Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Joe Perches <joe@perches.com> - 2016-02-02 19:00 +0100
      Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-02 18:10 +0100
        Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Kevin Easton <kevin@guarana.org> - 2016-02-03 05:00 +0100
          Re: [PATCH] kernel/fork.c: use sizeof() instead of sizeof Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-03 05:10 +0100

csiph-web