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

From: David Laight
Date: Wed Oct 19 2022 - 04:01:27 EST


From: Andy Shevchenko
> Sent: 18 October 2022 22:10
....
> It's not a hot path as far as I understand and keeping data types aligned seems
> to me worth it even if codegen is changed. IS it so awful with short?

(without looking at the generated code)
Why is it even short, what is wrong with int?
It is extremely unlikely that the code requires any
calculation results be masked to 8 (or 16) bits, but
using s8 or s16 requires the compiler emit code to mask
any calculated values.

Remember, all C arithmetic requires promoting the values
to (at least) int.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)