[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250221-light-neat-doberman-1166a5-mkl@pengutronix.de>
Date: Fri, 21 Feb 2025 09:08:51 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Ming Yu <a0282524688@...il.com>
Cc: tmyu0@...oton.com, lee@...nel.org, linus.walleij@...aro.org,
brgl@...ev.pl, andi.shyti@...nel.org, mailhol.vincent@...adoo.fr,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, wim@...ux-watchdog.org, linux@...ck-us.net, jdelvare@...e.com,
alexandre.belloni@...tlin.com, linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-watchdog@...r.kernel.org, linux-hwmon@...r.kernel.org, linux-rtc@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH v7 4/7] can: Add Nuvoton NCT6694 CANFD support
On 21.02.2025 16:01:07, Ming Yu wrote:
> Hi Marc,
>
> Marc Kleine-Budde <mkl@...gutronix.de> 於 2025年2月7日 週五 下午8:15寫道:
> >
> > > +static irqreturn_t nct6694_can_irq(int irq, void *data)
> > > +{
> > > + struct net_device *ndev = data;
> > > + struct nct6694_can_priv *priv = netdev_priv(ndev);
> > > + struct nct6694_can_event *evt = priv->event;
> > > + struct nct6694_cmd_header cmd_hd = {
> > > + .mod = NCT6694_CAN_MOD,
> > > + .cmd = NCT6694_CAN_EVENT,
> > > + .sel = NCT6694_CAN_EVENT_SEL(priv->can_idx, NCT6694_CAN_EVENT_MASK),
> > > + .len = cpu_to_le16(sizeof(priv->event))
> > > + };
> > > + irqreturn_t handled = IRQ_NONE;
> > > + int can_idx = priv->can_idx;
> > > + int ret;
> >
> > it would make sense to have a event pointer here instead of the can_idx?
> >
> > const struct nct6694_can_event *event = &priv->event[priv->can_idx];
> >
> The CAN Event command always returns 16bytes: the first 8 bytes
> correspond to the CAN0 event, and the last 8 bytes correspond to the
> CAN1 event. Therefore, the event pointer here refers to both event
> buffers.
Yes, but in the following code uses "priv->event[can_idx]" several
times, this is why I proposed to have a dedicated "struct
nct6694_can_event *event" variable.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists