[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4j09SbPVysrZtQt@smile.fi.intel.com>
Date: Thu, 16 Jan 2025 14:00:53 +0200
From: Andy Shevchenko <andy@...nel.org>
To: Jiri Slaby <jirislaby@...nel.org>
Cc: Andre Werner <andre.werner@...tec-electronic.com>,
gregkh@...uxfoundation.org, hvilleneuve@...onoff.com,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
lech.perczak@...lingroup.com
Subject: Re: [External Email] Re: [PATCH v1] serial: sc16is7xx: Extend IRQ
check for negative valus
On Thu, Jan 16, 2025 at 11:01:30AM +0100, Jiri Slaby wrote:
> On 16. 01. 25, 10:52, Andre Werner wrote:
> > On Thu, 16 Jan 2025, Jiri Slaby wrote:
> > > On 16. 01. 25, 10:32, Andre Werner wrote:
> > > > Fix the IRQ check to treat the negative values as No IRQ.
> > >
> > > Care to describe on what HW that can happen?
> >
> > I have no example on that. In the previous thread it was mentioned that
> > it is not absolutely sure that the API is not called with negative values. Thus,
> > negative values shall also be treated as no IRQ.
>
> SPI:
> if (spi->irq < 0)
> spi->irq = 0;
In all cases of how SPI target device is instantiated? I haven't checked myself
all those (three or four? or even five?) ways.
> I2C:
> if (irq < 0)
> irq = 0;
> So unlikely :).
Yes, but none of them _guarantees_ that (looking at the documentation and
the field type in the respective data structures).
Until there no guarantees, I would consider this patch as robustness increase.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists