All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] simplify unrestricted postop
@ 2020-11-18 22:46 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2020-11-18 22:46 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

The '++' and '--' operator used in evaluate_postop() are
'restricted' operators. It's thus unneeded to call restricted_unop()
on them as it will always return '1'.

It's also unneeded to test for TYPE_RESTRICT since it will also bes
tested in unrestrict().

So, simply call unrestrict() unconditionally.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 evaluate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index c39f9ec73da9..3567f702b8ac 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1919,8 +1919,7 @@ static struct symbol *evaluate_postop(struct expression *expr)
 		return NULL;
 	}
 
-	if ((class & TYPE_RESTRICT) && restricted_unop(expr->op, &ctype))
-		unrestrict(expr, class, &ctype);
+	unrestrict(expr, class, &ctype);
 
 	if (class & TYPE_NUM) {
 		multiply = 1;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-18 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 22:46 [PATCH] simplify unrestricted postop Luc Van Oostenryck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.