From 6f417f47165ec6c7f0b5bf1982ff829efacfcdfa Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Tue, 17 Feb 2026 19:06:56 -0600 Subject: [PATCH] ethosu: Fix padding calculation The subtractions in MAX2() can end up negative in which case we want to return 0 rather than the negative value as unsigned. Signed-off-by: Rob Herring (Arm) Part-of: --- src/gallium/drivers/ethosu/ethosu_lower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/ethosu/ethosu_lower.c b/src/gallium/drivers/ethosu/ethosu_lower.c index a6286ba0d05..86111a191bc 100644 --- a/src/gallium/drivers/ethosu/ethosu_lower.c +++ b/src/gallium/drivers/ethosu/ethosu_lower.c @@ -18,7 +18,7 @@ is_depthwise(const struct pipe_ml_operation *poperation) } static unsigned -needed_total_padding(unsigned input_size, unsigned stride, unsigned filter_size) +needed_total_padding(int input_size, int stride, int filter_size) { if (input_size % stride == 0) return MAX2(filter_size - stride, 0);