lkml.org 
[lkml]   [2021]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 0/4] serial: 8250: Fixes for Oxford Semiconductor 950 UARTs
Date
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)
\
 
 \ /
  Last update: 2021-06-15 23:46    [W:0.358 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site