Skip to contentSkip to conversation

dissect: cleanup report_implicit()

PATCH Applied Oleg Nesterov 2 participants 2 messages Dec 14, 2006 – Feb 23, 2007 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dissect: cleanup report_implicit()

It doesn't make sense to do report_implicit() for the anonymous structures, check "type->ident != NULL".

dissect.c renamed from dissect.c~ +6 -4
@@ -130,12 +130,14 @@ static void report_implicit(usage_t mode
 	if (type->type != SYM_STRUCT && type->type != SYM_UNION)
 		return;
 
-	if (reporter->r_member) {
+	if (!reporter->r_member)
+		return;
+
+	if (type->ident != NULL)
 		reporter->r_member(mode, pos, type, NULL);
 
-		DO_LIST(type->symbol_list, mem,
-			report_implicit(mode, pos, base_type(mem)));
-	}
+	DO_LIST(type->symbol_list, mem,
+		report_implicit(mode, pos, base_type(mem)));
 }
 
 static inline struct symbol *expr_symbol(struct expression *expr)