linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: CGEL <cgel.zte@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>,
	Colin Ian King <colin.king@canonical.com>,
	Xu Wang <vulab@iscas.ac.cn>,
	linux-kernel@vger.kernel.org,
	jing yangyang <jing.yangyang@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH linux-next] tools/tracing: fix application of sizeof to pointer
Date: Thu, 19 Aug 2021 23:00:43 -0700	[thread overview]
Message-ID: <8fd4bb65ef3da67feac9ce3258cdbe9824752cf1.1629198502.git.jing.yangyang@zte.com.cn> (raw)

From: jing yangyang <jing.yangyang@zte.com.cn>

sizeof when applied to a pointer typed expression gives the size of
the pointer.

./tools/tracing/latency/latency-collector.c:1541:10-16:ERROR application of sizeof to pointer

This issue was detected with the help of Coccinelle.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
---
 tools/tracing/latency/latency-collector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/latency/latency-collector.c
index 3a2e6bb..64d531d 100644
--- a/tools/tracing/latency/latency-collector.c
+++ b/tools/tracing/latency/latency-collector.c
@@ -1538,7 +1538,7 @@ static void tracing_loop(void)
 				mutex_lock(&print_mtx);
 				check_signals();
 				write_or_die(fd_stdout, queue_full_warning,
-					     sizeof(queue_full_warning));
+					     sizeof(*queue_full_warning));
 				mutex_unlock(&print_mtx);
 			}
 			modified--;
-- 
1.8.3.1



             reply	other threads:[~2021-08-20  6:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  6:00 CGEL [this message]
2021-08-20  9:00 ` [PATCH linux-next] tools/tracing: fix application of sizeof to pointer Viktor.Rosendahl
2021-08-20 14:24   ` Steven Rostedt

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=8fd4bb65ef3da67feac9ce3258cdbe9824752cf1.1629198502.git.jing.yangyang@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=Viktor.Rosendahl@bmw.de \
    --cc=colin.king@canonical.com \
    --cc=jing.yangyang@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=vulab@iscas.ac.cn \
    --cc=zealci@zte.com.cn \
    /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).