All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] signal: use sizeof() instead of sizeof
@ 2016-02-02  7:35 Wei Tang
  2016-02-02  7:55 ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Tang @ 2016-02-02  7:35 UTC (permalink / raw)
  To: akpm, oleg
  Cc: richard, amanieu, dave, vdavydov, palmer, linux-kernel, Wei Tang

This patch fixes the checkpatch.pl warning to signal.c:

WARNING: sizeof info should be sizeof(info)

Signed-off-by: Wei Tang <tangwei@cmss.chinamobile.com>
---
 kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index f3f1f7a..13b267a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1900,7 +1900,7 @@ static void ptrace_do_notify(int signr, int exit_code, int why)
 {
 	siginfo_t info;
 
-	memset(&info, 0, sizeof info);
+	memset(&info, 0, sizeof(info));
 	info.si_signo = signr;
 	info.si_code = exit_code;
 	info.si_pid = task_pid_vnr(current);
-- 
1.9.1

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

* Re: [PATCH] signal: use sizeof() instead of sizeof
  2016-02-02  7:35 [PATCH] signal: use sizeof() instead of sizeof Wei Tang
@ 2016-02-02  7:55 ` Richard Weinberger
       [not found]   ` <000001d15d90$f3c40a40$db4c1ec0$@cmss.chinamobile.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2016-02-02  7:55 UTC (permalink / raw)
  To: Wei Tang, akpm, oleg; +Cc: amanieu, dave, vdavydov, palmer, linux-kernel

Hi!

Am 02.02.2016 um 08:35 schrieb Wei Tang:
> This patch fixes the checkpatch.pl warning to signal.c:
> 
> WARNING: sizeof info should be sizeof(info)

And why is this patch needed? What problem does it fix?
Complex expressions should be within parents
but in this case it is IMHO perfectly fine.

Thanks,
//richard

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

* Re: 答复: [PATCH] signal: use sizeof() instead of sizeof
       [not found]   ` <000001d15d90$f3c40a40$db4c1ec0$@cmss.chinamobile.com>
@ 2016-02-02  8:14     ` Richard Weinberger
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2016-02-02  8:14 UTC (permalink / raw)
  To: Wei Tang, akpm, oleg; +Cc: amanieu, dave, vdavydov, palmer, linux-kernel

Am 02.02.2016 um 09:08 schrieb Wei Tang:
> This is a simple patch, just to clear up the output from checkpatch.pl
> script, otherwise, we will get WARNING always.

This does not answer my question.
What problem does it fix? How does your patch make the kernel better?

Doing patches just because of checkpatch warnings (not errors)
is IMHO not good.
It is a script and not human, it does not understand all the corner cases.
All it can do is giving us hints. But this does not mean that you have to
blindly follow them.

Thanks,
//richard

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

end of thread, other threads:[~2016-02-02  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-02  7:35 [PATCH] signal: use sizeof() instead of sizeof Wei Tang
2016-02-02  7:55 ` Richard Weinberger
     [not found]   ` <000001d15d90$f3c40a40$db4c1ec0$@cmss.chinamobile.com>
2016-02-02  8:14     ` 答复: " Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.