From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tharunkumar.Pasumarthi@microchip.com
Cc: Kumaravel.Thiagarajan@microchip.com,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
gregkh@linuxfoundation.org, jirislaby@kernel.org,
ilpo.jarvinen@linux.intel.com, macro@orcam.me.uk,
cang1@live.co.uk, colin.i.king@gmail.com,
phil.edworthy@renesas.com, biju.das.jz@bp.renesas.com,
geert+renesas@glider.be, lukas@wunner.de,
u.kleine-koenig@pengutronix.de, wander@redhat.com,
etremblay@distech-controls.com, jk@ozlabs.org,
UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v8 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for quad-uart support
Date: Mon, 12 Dec 2022 10:29:31 +0200 [thread overview]
Message-ID: <Y5bma3Gp7pr+Ta7U@smile.fi.intel.com> (raw)
In-Reply-To: <PH7PR11MB5958DC96634CFF28AFA8695D9BE29@PH7PR11MB5958.namprd11.prod.outlook.com>
On Mon, Dec 12, 2022 at 07:16:55AM +0000, Tharunkumar.Pasumarthi@microchip.com wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Sunday, December 11, 2022 2:45 AM
> > To: Kumaravel Thiagarajan - I21417
> > <Kumaravel.Thiagarajan@microchip.com>
...
> > > + 4,/* PCI1p3 */
> > > + };
> >
> > If you move this outside of the function you may use static_assert(), see
> > below why.
>
> If you move this outside of the function -> Do you suggest to move the array outside
> the function
Yes.
> and make it global?
I don't get this, sorry.
The array is already global, only name is scoped inside the certain function.
...
> > if (subsys_dev <= ARRAY_SIZE(max_port))
> > return max_port[subsys_dev];
> >
> > (in this case you can make sure it is the same as the above using
> > static_assert(), so it won't compile otherwise)
>
> I am not getting this. You suggest doing something like this:
> static_assert(subsys_dev <= ARRAY_SIZE(max_port)) ?
No, you need to compare ARRAY_SIZE() to the macro that you removed from
the context here.
...
> > > + priv->nr = nr_ports;
> > > + pci_set_master(pdev);
> > > + max_vec_reqd = pci1xxxx_get_max_port(subsys_dev);
> >
> > The above needs a bit of reshuffling and perhaps a blank line or lines.
> > Make it ordered and grouped more logically.
>
> Okay. I will do something like this:
> pci_set_master(pdev);
> <NL>
> priv->pdev = pdev;
> priv->nr = nr_ports;
> <NL>
> subsys_dev = priv->pdev->subsystem_device;
Almost good, but why priv is still here?
> max_vec_reqd = pci1xxxx_get_max_port(subsys_dev);
> <NL>
> num_vectors = pci_alloc_irq_vectors(pdev, 1, max_vec_reqd, PCI_IRQ_ALL_TYPES);
> if (num_vectors < 0)
> return num_vectors;
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-12-12 8:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-11 1:47 [PATCH v8 tty-next 0/4] serial: 8250_pci1xxxx: Add driver for the pci1xxxx's quad-uart function Kumaravel Thiagarajan
2022-12-11 1:47 ` [PATCH v8 tty-next 1/4] serial: 8250_pci: Add serial8250_pci_setup_port definition in 8250_pcilib.c Kumaravel Thiagarajan
2022-12-11 1:47 ` [PATCH v8 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for quad-uart support Kumaravel Thiagarajan
2022-12-10 21:14 ` Andy Shevchenko
2022-12-12 7:16 ` Tharunkumar.Pasumarthi
2022-12-12 8:29 ` Andy Shevchenko [this message]
2022-12-12 7:44 ` Jiri Slaby
2022-12-12 18:24 ` Tharunkumar.Pasumarthi
2022-12-14 10:57 ` Tharunkumar.Pasumarthi
2022-12-11 1:47 ` [PATCH v8 tty-next 3/4] serial: 8250_pci1xxxx: Add RS485 support to quad-uart driver Kumaravel Thiagarajan
2022-12-11 1:47 ` [PATCH v8 tty-next 4/4] serial: 8250_pci1xxxx: Add power management functions " Kumaravel Thiagarajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5bma3Gp7pr+Ta7U@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Kumaravel.Thiagarajan@microchip.com \
--cc=Tharunkumar.Pasumarthi@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=cang1@live.co.uk \
--cc=colin.i.king@gmail.com \
--cc=etremblay@distech-controls.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=jk@ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=macro@orcam.me.uk \
--cc=phil.edworthy@renesas.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wander@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®