smatch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: smatch@vger.kernel.org
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH] check_release_resource: Use INT_PTR instead of hand writing it
Date: Thu, 26 May 2022 07:19:59 +0200	[thread overview]
Message-ID: <50e5dc71a6e09fbfe78b06515f6d4b68a36b284c.1653542384.git.christophe.jaillet@wanadoo.fr> (raw)

INT_PTR() is cleaner and more widely used in smatch than '(void *)x'.
So use it instead

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 check_release_resource.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/check_release_resource.c b/check_release_resource.c
index b6f9d626e1b6..7ea2c291c259 100644
--- a/check_release_resource.c
+++ b/check_release_resource.c
@@ -82,9 +82,9 @@ void check_release_resource(int id)
 	if (option_project != PROJ_KERNEL)
 		return;
 
-	add_function_hook("request_resource", &match_request, (void *)1);
-	add_function_hook("release_resource", &match_release, (void *)0);
-	add_function_hook("request_mem_resource", &match_request, (void *)0);
-	add_function_hook("release_mem_resource", &match_release, (void *)0);
+	add_function_hook("request_resource", &match_request, INT_PTR(1));
+	add_function_hook("release_resource", &match_release, INT_PTR(0));
+	add_function_hook("request_mem_resource", &match_request, INT_PTR(0));
+	add_function_hook("release_mem_resource", &match_release, INT_PTR(0));
 	add_hook(&match_end_func, END_FUNC_HOOK);
 }
-- 
2.34.1

             reply	other threads:[~2022-05-26  5:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26  5:19 Christophe JAILLET [this message]
2022-05-26 10:17 ` [PATCH] check_release_resource: Use INT_PTR instead of hand writing it Dan Carpenter

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=50e5dc71a6e09fbfe78b06515f6d4b68a36b284c.1653542384.git.christophe.jaillet@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=smatch@vger.kernel.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).