Subject: Re: [PATCH] wifi: rt2x00: use explicitly signed type for clamping

From: Stanislaw Gruszka <[email-masked]>
Date: Wed, 19 Oct 2022 10:52:19 +0200

On Tue, Oct 18, 2022 at 02:27:34PM -0600, Jason A. Donenfeld wrote:
> On some platforms, `char` is unsigned, which makes casting -7 to char
> overflow, which in turn makes the clamping operation bogus. Instead,
> deal with an explicit `s8` type, so that the comparison is always
> signed, and return an s8 result from the function as well. Note that
> this function's result is assigned to a `short`, which is always signed.
> 
> Cc: Andrew Morton <[email-masked]>
> Cc: Andy Shevchenko <[email-masked]>
> Cc: Stanislaw Gruszka <[email-masked]>
> Cc: Helmut Schaa <[email-masked]>
> Cc: Kalle Valo <[email-masked]>
> Signed-off-by: Jason A. Donenfeld <[email-masked]>

I prefer s8 just because is shorter name than short :-)

Acked-by: Stanislaw Gruszka <[email-masked]>