Powered by Linux
[PATCH v2] direct_return_instead_of_goto: don't warn about other forms of printks — Semantic Matching Tool

[PATCH v2] direct_return_instead_of_goto: don't warn about other forms of printks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Also tracking these type of goto labels are uninteresting for the check.
fail:
    ata_dev_err(dev, "failed to set xfermode (err_mask=0x%x)\n", err_mask);
    return -EIO;

Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
---
v1->v2: Use strstr() instead to strcmp as suggested by Christophe which is
	a better way to check for a match.
---
 check_direct_return_instead_of_goto.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/check_direct_return_instead_of_goto.c b/check_direct_return_instead_of_goto.c
index b075bc2f..0ea0c2e5 100644
--- a/check_direct_return_instead_of_goto.c
+++ b/check_direct_return_instead_of_goto.c
@@ -92,6 +92,11 @@ static bool is_printk_stmt(struct statement *stmt)
 	    strcmp(str, "pr_debug") == 0)
 		return true;
 
+	if (strstr(str, "_dev_err") ||
+	    strstr(str, "_dev_warn") ||
+	    strstr(str, "_dev_dbg"))
+		return true;
+
 	return false;
 }
 
-- 
2.38.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux