public inbox for smatch@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] check_release_resource: Use INT_PTR instead of hand writing it
@ 2022-05-26  5:19 Christophe JAILLET
  2022-05-26 10:17 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-05-26  5:19 UTC (permalink / raw)
  To: smatch; +Cc: Christophe JAILLET

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

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

* Re: [PATCH] check_release_resource: Use INT_PTR instead of hand writing it
  2022-05-26  5:19 [PATCH] check_release_resource: Use INT_PTR instead of hand writing it Christophe JAILLET
@ 2022-05-26 10:17 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2022-05-26 10:17 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: smatch

On Thu, May 26, 2022 at 07:19:59AM +0200, Christophe JAILLET wrote:
> 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>

Applied.  Thanks!

regards,
dan carpenter

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

end of thread, other threads:[~2022-05-26 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-26  5:19 [PATCH] check_release_resource: Use INT_PTR instead of hand writing it Christophe JAILLET
2022-05-26 10:17 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox