lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b86df0e0-ba54-232-1854-bf3d1cbbe479@linux.intel.com>
Date:   Thu, 26 Oct 2023 12:24:04 +0300 (EEST)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Jiri Slaby <jirislaby@...nel.org>,
        Vamshi Gajjela <vamshigajjela@...gle.com>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-serial <linux-serial@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>, manugautam@...gle.com,
        Subhash Jadavani <sjadavani@...gle.com>,
        Channa Kadabi <kadabi@...gle.com>
Subject: Re: [PATCH v2 3/3] serial: core: Update uart_poll_timeout() function
 to return unsigned long

On Thu, 26 Oct 2023, Jiri Slaby wrote:

> On 25. 10. 23, 16:26, Vamshi Gajjela wrote:
> > From: VAMSHI GAJJELA <vamshigajjela@...gle.com>
> > 
> > The function uart_fifo_timeout() returns an unsigned long value, which is
> > the number of jiffies. Therefore, the function uart_poll_timeout() has been
> > modified to use an unsigned long type for timeout values instead of an int
> > and to avoid truncation.
> 
> Hi,
> 
> there is no truncation possible, right?

That's very likely true (I didn't run the calculations), thus it's correct 
to not have Fixes tag. It's more about having consistent typing since 
we're talking about jiffies, so unsigned long as usual.

> > The return type of the function uart_poll_timeout() has also been changed
> > from int to unsigned long to be consistent with the type of timeout values.

Don't write changes you make in the patch in the past tense. Just say:

Change the return type of uart_poll_timeout() from ...

The comment also applies to the other sentence above this one.

-- 
 i.

> > Signed-off-by: VAMSHI GAJJELA <vamshigajjela@...gle.com>
> > ---
> > v2:
> > - unsigned long instead of unsigned int
> > - added () after function name in short log
> > - updated description
> >   include/linux/serial_core.h | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> > index bb6f073bc159..6916a1d7e477 100644
> > --- a/include/linux/serial_core.h
> > +++ b/include/linux/serial_core.h
> > @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(struct
> > uart_port *port)
> >   }
> >     /* Base timer interval for polling */
> > -static inline int uart_poll_timeout(struct uart_port *port)
> > +static inline unsigned long uart_poll_timeout(struct uart_port *port)
> >   {
> > -	int timeout = uart_fifo_timeout(port);
> > +	unsigned long timeout = uart_fifo_timeout(port);
> >     	return timeout > 6 ? (timeout / 2 - 2) : 1;
> >   }
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ