[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5tc8mjvxdphtgzj@smile.fi.intel.com>
Date: Thu, 15 Dec 2022 19:44:18 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Kumaravel Thiagarajan <kumaravel.thiagarajan@...rochip.com>
Cc: linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
gregkh@...uxfoundation.org, jirislaby@...nel.org,
ilpo.jarvinen@...ux.intel.com, macro@...am.me.uk, cang1@...e.co.uk,
colin.i.king@...il.com, phil.edworthy@...esas.com,
biju.das.jz@...renesas.com, geert+renesas@...der.be,
lukas@...ner.de, u.kleine-koenig@...gutronix.de, wander@...hat.com,
etremblay@...tech-controls.com, jk@...abs.org,
UNGLinuxDriver@...rochip.com,
Tharun Kumar P <tharunkumar.pasumarthi@...rochip.com>
Subject: Re: [PATCH v9 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for
quad-uart support
On Thu, Dec 15, 2022 at 07:42:32PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 16, 2022 at 10:56:54AM +0530, Kumaravel Thiagarajan wrote:
...
> > +static unsigned int pci1xxxx_get_max_port(int subsys_dev)
> > +{
> > + int i = 0;
>
> What the point to assign this one?
>
> Actually, better is
>
> unsigned int = MAX_PORTS;
>
> > + if (subsys_dev < ARRAY_SIZE(logical_to_physical_port_idx))
>
> > + for (i = MAX_PORTS - 1; i >= 0; i--)
>
> while (i--) {
>
> > + if (logical_to_physical_port_idx[subsys_dev][i] != -1)
> > + return logical_to_physical_port_idx[subsys_dev][i] + 1;
>
> }
>
> (Note missinng {} in the above code. Does checkpatch complain on this?)
>
> > + if (subsys_dev != PCI_SUBDEVICE_ID_EFAR_PCI11414)
> > + return 1;
> > +
> > + return 4;
Also you can consider the positive check here:
if (subsys_dev == PCI_SUBDEVICE_ID_EFAR_PCI11414)
return 4;
return 1;
> > +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists