lkml.org 
[lkml]   [2011]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 15/26] dynamic_debug: drop explicit foo != NULL checks.
Date
From: Jim Cromie <jim.cromie@gmail.com>

Reduce != NULL relational tests to their 0/1 equivalents.
Done separately to preserve code-move character of previous patch.
No generated code difference.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
lib/dynamic_debug.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 329e18d..4c8e178 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -129,20 +129,18 @@ static bool query_matches_callsite(struct _ddebug *dp,
const struct ddebug_query *query)
{
/* match against the source filename */
- if (query->filename != NULL &&
+ if (query->filename &&
strcmp(query->filename, dp->filename) &&
strcmp(query->filename, basename(dp->filename)) &&
strcmp(query->filename, trim_prefix(dp->filename)))
return false;

/* match against the function */
- if (query->function != NULL &&
- strcmp(query->function, dp->function))
+ if (query->function && strcmp(query->function, dp->function))
return false;

/* match against the format */
- if (query->format != NULL &&
- strstr(dp->format, query->format) == NULL)
+ if (query->format && !strstr(dp->format, query->format))
return false;

/* match against the line number range */
--
1.7.4.4


\
 
 \ /
  Last update: 2011-09-21 23:59    [W:0.709 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site