[sheepdog] [PATCH 2/2] checkpatch: wran on direct calling of pthread_create()

Hitoshi Mitake mitake.hitoshi at gmail.com
Sun Jul 27 14:47:29 CEST 2014


From: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>

Basically developers shouldn't use the function directly.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 script/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/script/checkpatch.pl b/script/checkpatch.pl
index 5df44c6..a00e43d 100755
--- a/script/checkpatch.pl
+++ b/script/checkpatch.pl
@@ -2919,6 +2919,12 @@ sub process {
 		    WARN("STRERROR",
 			 "use %m instead of strerror(errno)\n" . $herecurr);
 		}
+
+# check for direct calling of pthread_create()
+		if ($line =~ /\bpthread_create\(/) {
+		    WARN("PTHREAD_CREATE",
+			 "use sd_thread_create() instead of pthread_create()\n" . $herecurr);
+		}
 	}
 
 	# If we have no input at all, then there is nothing to report on
-- 
1.9.1




More information about the sheepdog mailing list