diff mbox series

[next] tracing histograms: remove redundant check on field->field

Message ID 20241107120530.18728-1-colin.i.king@gmail.com (mailing list archive)
State Queued
Commit 6371b4bc179aad17d84ee301b409a5a8ce675657
Headers show
Series [next] tracing histograms: remove redundant check on field->field | expand

Commit Message

Colin Ian King Nov. 7, 2024, 12:05 p.m. UTC
The check on field->field being true is handled as the first check
on the cascaded if statement, so the later checks on field->field
are redundant because this clause has already been handled. Since
this later check is redundant, just remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 kernel/trace/trace_events_hist.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index c288b92fc4df..9c058aa8baf3 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1332,54 +1332,51 @@  static const char *hist_field_name(struct hist_field *field,
 
 	if (field->field)
 		field_name = field->field->name;
 	else if (field->flags & HIST_FIELD_FL_LOG2 ||
 		 field->flags & HIST_FIELD_FL_ALIAS ||
 		 field->flags & HIST_FIELD_FL_BUCKET)
 		field_name = hist_field_name(field->operands[0], ++level);
 	else if (field->flags & HIST_FIELD_FL_CPU)
 		field_name = "common_cpu";
 	else if (field->flags & HIST_FIELD_FL_EXPR ||
 		 field->flags & HIST_FIELD_FL_VAR_REF) {
 		if (field->system) {
 			static char full_name[MAX_FILTER_STR_VAL];
 
 			strcat(full_name, field->system);
 			strcat(full_name, ".");
 			strcat(full_name, field->event_name);
 			strcat(full_name, ".");
 			strcat(full_name, field->name);
 			field_name = full_name;
 		} else
 			field_name = field->name;
 	} else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
 		field_name = "common_timestamp";
 	else if (field->flags & HIST_FIELD_FL_STACKTRACE) {
-		if (field->field)
-			field_name = field->field->name;
-		else
-			field_name = "common_stacktrace";
+		field_name = "common_stacktrace";
 	} else if (field->flags & HIST_FIELD_FL_HITCOUNT)
 		field_name = "hitcount";
 
 	if (field_name == NULL)
 		field_name = "";
 
 	return field_name;
 }
 
 static enum hist_field_fn select_value_fn(int field_size, int field_is_signed)
 {
 	switch (field_size) {
 	case 8:
 		if (field_is_signed)
 			return HIST_FIELD_FN_S64;
 		else
 			return HIST_FIELD_FN_U64;
 	case 4:
 		if (field_is_signed)
 			return HIST_FIELD_FN_S32;
 		else
 			return HIST_FIELD_FN_U32;
 	case 2:
 		if (field_is_signed)
 			return HIST_FIELD_FN_S16;