Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH 0/4] serial: 8250: Fixes for Oxford Semiconductor 950 UARTs | Date | Tue, 15 Jun 2021 21:45:31 +0000 |
| |
From: Maciej W. Rozycki > Sent: 15 June 2021 18:13 ... > As I have noted above there is a data type signedness difference between > `mcr_mask' and UART_MCR_CLKSEL. So we have the value of 0x80 (128). > Once bitwise-complemented it becomes 0xffffff7f (-129). Once assigned to > `mcr_mask' however it becomes 0x7f (127), which is considered an unsafe > conversion between signed and unsigned integers by GCC, which is why the > compiler complains about it.
Blame the iso C standards committee for making integer promotions 'value preserving' instead of 'sign preserving' as they were in K&R C.
Try using ^ 0xffu instead of ~.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |