From: Andrew Lunn <andrew@lunn.ch>
To: Hal Feng <hal.feng@starfivetech.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Emil Renner Berthing <emil.renner.berthing@canonical.com>,
William Qiu <william.qiu@starfivetech.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/4] can: Add driver for CAST CAN Bus Controller
Date: Mon, 23 Sep 2024 14:12:39 +0200 [thread overview]
Message-ID: <9cf40a68-a07f-46d5-bc2c-302ae0e99ab0@lunn.ch> (raw)
In-Reply-To: <ZQ2PR01MB13071A093EB33F48340F753EE66F2@ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn>
> > > + reset_test = ccan_read_reg_8bit(priv, CCAN_CFG_STAT);
> > > +
> > > + if (!(reset_test & CCAN_RST_MASK)) {
> > > + netdev_alert(ndev, "Not in reset mode, cannot set bit
> > timing\n");
> > > + return -EPERM;
> > > + }
> >
> >
> > You don't see nedev_alert() used very often. If this is fatal then netdev_err().
> >
> > Also, EPERM? man 3 errno say:
> >
> > EPERM Operation not permitted (POSIX.1-2001).
> >
> > Why is this a permission issue?
>
> Will use netdev_err() and return -EWOULDBLOCK instead.
I'm not sure that is any better.
EAGAIN Resource temporarily unavailable (may be the same value
as EWOULDBLOCK) (POSIX.1-2001).
This is generally used when the kernel expects user space to try a
system call again, and it might then work. Is that what you expect
here?
> > > +static irqreturn_t ccan_interrupt(int irq, void *dev_id) {
> > > + struct net_device *ndev = (struct net_device *)dev_id;
> >
> > dev_id is a void *, so you don't need the cast.
>
> OK, drop it.
Please look at the whole patch. There might be other instances where a
void * is used with a cast, which can be removed. This was just the
first i spotted.
Andrew
next prev parent reply other threads:[~2024-09-23 12:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-22 14:51 [PATCH v2 0/4] CAST Controller Area Network driver support Hal Feng
2024-09-22 14:51 ` [PATCH v2 1/4] dt-bindings: vendor-prefixes: Add cast vendor prefix Hal Feng
2024-09-22 14:51 ` [PATCH v2 2/4] dt-bindings: can: Add CAST CAN Bus Controller Hal Feng
2024-09-24 18:01 ` Rob Herring (Arm)
2024-09-24 20:03 ` Rob Herring
2024-09-22 14:51 ` [PATCH v2 3/4] can: Add driver for " Hal Feng
2024-09-22 16:33 ` Andrew Lunn
2024-09-23 7:53 ` Hal Feng
2024-09-23 12:12 ` Andrew Lunn [this message]
2024-10-28 14:18 ` Marc Kleine-Budde
2024-09-22 21:13 ` Marc Kleine-Budde
2024-10-25 1:45 ` Hal Feng
2024-10-28 15:28 ` Marc Kleine-Budde
2024-09-23 3:41 ` Vincent MAILHOL
2024-10-15 9:30 ` Hal Feng
2024-10-16 5:05 ` Vincent MAILHOL
2024-10-16 14:16 ` Vincent MAILHOL
2024-09-22 14:51 ` [PATCH v2 4/4] riscv: dts: starfive: jh7110: Add CAN nodes Hal Feng
-- strict thread matches above, loose matches on Subject: below --
2024-10-25 2:11 [PATCH v2 3/4] can: Add driver for CAST CAN Bus Controller Hal Feng
2024-10-25 2:49 Hal Feng
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=9cf40a68-a07f-46d5-bc2c-302ae0e99ab0@lunn.ch \
--to=andrew@lunn.ch \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=emil.renner.berthing@canonical.com \
--cc=hal.feng@starfivetech.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=william.qiu@starfivetech.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;
as well as URLs for NNTP newsgroup(s).