[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ea689ace38d47f285efe026772efcae@AcuMS.aculab.com>
Date: Mon, 29 Apr 2024 09:14:06 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Jiri Slaby' <jirislaby@...nel.org>, Hugo Villeneuve <hugo@...ovil.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jon Ringle
<jringle@...dpoint.com>
CC: "ria.freelander@...il.com" <ria.freelander@...il.com>, Hugo Villeneuve
<hvilleneuve@...onoff.com>, "stable@...r.kernel.org"
<stable@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-serial@...r.kernel.org"
<linux-serial@...r.kernel.org>
Subject: RE: [PATCH] serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when
using prescaler
From: Jiri Slaby
> Sent: 29 April 2024 07:39
...
> > - u8 prescaler = 0;
> > + int prescaler = 1;
>
> Ugh, why do you move to signed arithmetics?
Any arithmetic would always have been signed.
u8 is promoted to 'signed int' before being used for pretty much anything.
'unsigned int prescaler' might have changed arithmetic to be unsigned.
OTOH you probably don't want a u8 - that might require the compiler
mask an arithmetic result to 8 bits.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists