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) <robh@kernel.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40081>
This commit is contained in:
Rob Herring (Arm) 2026-02-17 19:06:56 -06:00 committed by Marge Bot
parent 7c6dbb099a
commit 6f417f4716

View file

@ -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);