Re: [PATCH 2/3] tools/mm/page-types: Fix ternary operator precedence in sigbus handler

From: SeongJae Park

Date: Wed May 13 2026 - 20:53:59 EST


On Wed, 13 May 2026 10:21:17 +0800 Ye Liu <ye.liu@xxxxxxxxx> wrote:

> From: Ye Liu <liuye@xxxxxxxxxx>
>
> The ternary operator (?:) has lower precedence than addition (+), so
> the expression `off + sigbus_addr ? sigbus_addr - ptr : 0` was parsed
> as `(off + sigbus_addr) ? (sigbus_addr - ptr) : 0` rather than the
> intended `off + (sigbus_addr ? sigbus_addr - ptr : 0)`. Add explicit
> parentheses to ensure the correct evaluation order.
>
> Signed-off-by: Ye Liu <liuye@xxxxxxxxxx>

Acked-by: SeongJae Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]