Signed-off-by: Julia Suvorova <jus...@mail.ru>
---
 scripts/checkpatch.pl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1b4b812..6c4fb42 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2584,6 +2584,11 @@ sub process {
                        ERROR("__func__ should be used instead of gcc specific 
__FUNCTION__\n"  . $herecurr);
                }
 
+# recommend g_path_get_* over basename(3) and dirname(3)
+               if ($line =~ /\b(basename|dirname)\s*\(/) {
+                       WARN("consider using g_path_get_$1 in preference to 
$1(3)\n" . $herecurr);
+               }
+
 # recommend qemu_strto* over strto* for numeric conversions
                if ($line =~ /\b(strto[^kd].*?)\s*\(/) {
                        ERROR("consider using qemu_$1 in preference to $1\n" . 
$herecurr);
-- 
2.1.4


Reply via email to