diff mbox series

[4/4] typeof: avoid using is_bitfield_type()

Message ID 20191215110425.76533-5-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series tidy-up of typeof expansion | expand

Commit Message

Luc Van Oostenryck Dec. 15, 2019, 11:04 a.m. UTC
is_bitfield_type() is one of the few type-testing helper
based on get_sym_type(). But get_sym_type() test for SYM_NODE
and SYM_ENUM, which is not needed here.

So, simply test for SYM_BITFIELD.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 symbol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/symbol.c b/symbol.c
index 46fe740b4cc1..ab6e9841696f 100644
--- a/symbol.c
+++ b/symbol.c
@@ -460,12 +460,12 @@  static struct symbol *examine_typeof(struct symbol *sym)
 
 	if (!base)
 		base = &bad_ctype;
-	if (is_bitfield_type(base))
-		warning(base->pos, "typeof applied to bitfield type");
 	if (base->type == SYM_NODE) {
 		mod |= base->ctype.modifiers & MOD_TYPEOF;
 		base = base->ctype.base_type;
 	}
+	if (base->type == SYM_BITFIELD)
+		warning(base->pos, "typeof applied to bitfield type");
 	sym->type = SYM_NODE;
 	sym->ctype.modifiers = mod;
 	sym->ctype.base_type = base;