tracing/user_events: Use NULL for strstr checks
Trivial fix to ensure strstr checks use NULL instead of 0. Link: https://lkml.kernel.org/r/20220728233309.1896-2-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
e841e8bfac
commit
9cbf12343d
|
@ -277,7 +277,7 @@ static int user_event_add_field(struct user_event *user, const char *type,
|
||||||
goto add_field;
|
goto add_field;
|
||||||
|
|
||||||
add_validator:
|
add_validator:
|
||||||
if (strstr(type, "char") != 0)
|
if (strstr(type, "char") != NULL)
|
||||||
validator_flags |= VALIDATOR_ENSURE_NULL;
|
validator_flags |= VALIDATOR_ENSURE_NULL;
|
||||||
|
|
||||||
validator = kmalloc(sizeof(*validator), GFP_KERNEL);
|
validator = kmalloc(sizeof(*validator), GFP_KERNEL);
|
||||||
|
@ -458,7 +458,7 @@ static const char *user_field_format(const char *type)
|
||||||
return "%d";
|
return "%d";
|
||||||
if (strcmp(type, "unsigned char") == 0)
|
if (strcmp(type, "unsigned char") == 0)
|
||||||
return "%u";
|
return "%u";
|
||||||
if (strstr(type, "char[") != 0)
|
if (strstr(type, "char[") != NULL)
|
||||||
return "%s";
|
return "%s";
|
||||||
|
|
||||||
/* Unknown, likely struct, allowed treat as 64-bit */
|
/* Unknown, likely struct, allowed treat as 64-bit */
|
||||||
|
@ -479,7 +479,7 @@ static bool user_field_is_dyn_string(const char *type, const char **str_func)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
check:
|
check:
|
||||||
return strstr(type, "char") != 0;
|
return strstr(type, "char") != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LEN_OR_ZERO (len ? len - pos : 0)
|
#define LEN_OR_ZERO (len ? len - pos : 0)
|
||||||
|
|
Loading…
Reference in New Issue