From: Lukasz Majewski <lukma@denx.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
Eric Dumazet <edumazet@google.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Tristram.Ha@microchip.com,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Paolo Abeni <pabeni@redhat.com>,
Ravi Gunasekaran <r-gunasekaran@ti.com>,
Simon Horman <horms@kernel.org>,
Wojciech Drewek <wojciech.drewek@intel.com>,
Nikita Zhandarovich <n.zhandarovich@fintech.ru>,
Murali Karicheri <m-karicheri2@ti.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
Ziyang Xuan <william.xuanziyang@huawei.com>,
Kristian Overskeid <koverskeid@gmail.com>,
Matthieu Baerts <matttbe@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] net: hsr: Provide RedBox support
Date: Thu, 29 Feb 2024 10:30:48 +0100 [thread overview]
Message-ID: <20240229103048.45ecc1de@wsk> (raw)
In-Reply-To: <608850a9-966e-420b-8d16-1ab6baa65025@lunn.ch>
[-- Attachment #1: Type: text/plain, Size: 2941 bytes --]
Hi Andrew,
> > void hsr_debugfs_rename(struct net_device *dev)
> > {
> > @@ -95,6 +114,19 @@ void hsr_debugfs_init(struct hsr_priv *priv,
> > struct net_device *hsr_dev) priv->node_tbl_root = NULL;
> > return;
> > }
> > +
> > + if (!priv->redbox)
> > + return;
> > +
> > + de = debugfs_create_file("proxy_node_table", S_IFREG |
> > 0444,
> > + priv->node_tbl_root, priv,
> > + &hsr_proxy_node_table_fops);
> > + if (IS_ERR(de)) {
> > + pr_err("Cannot create hsr proxy node_table
> > file\n");
> > + debugfs_remove(priv->node_tbl_root);
> > + priv->node_tbl_root = NULL;
> > + return;
>
> You should not be checking return values from debugfs and not printing
> error messages etc. debugfs is totally option, so you should just keep
> going. The debugfs API should not explode because of a previous
> failure.
>
> > --- a/net/hsr/hsr_device.c
> > +++ b/net/hsr/hsr_device.c
> > @@ -142,30 +142,32 @@ static int hsr_dev_open(struct net_device
> > *dev) {
> > struct hsr_priv *hsr;
> > struct hsr_port *port;
> > - char designation;
> > + char *designation = NULL;
>
> Revere christmas tree place. When you go from RFC to a real
> submission, issues like this need fixing. For an RFC its not so bad.
>
Ok.
> > hsr = netdev_priv(dev);
> > - designation = '\0';
> >
> > hsr_for_each_port(hsr, port) {
> > if (port->type == HSR_PT_MASTER)
> > continue;
> > switch (port->type) {
> > case HSR_PT_SLAVE_A:
> > - designation = 'A';
> > + designation = "Slave A";
> > break;
> > case HSR_PT_SLAVE_B:
> > - designation = 'B';
> > + designation = "Slave B";
> > + break;
> > + case HSR_PT_INTERLINK:
> > + designation = "Interlink";
> > break;
> > default:
> > - designation = '?';
> > + designation = "Unknown";
> > }
> > if (!is_slave_up(port->dev))
> > - netdev_warn(dev, "Slave %c (%s) is not up;
> > please bring it up to get a fully working HSR network\n",
> > + netdev_warn(dev, "%s (%s) is not up;
> > please bring it up to get a fully working HSR network\n",
> > designation, port->dev->name); }
> >
> > - if (designation == '\0')
> > + if (designation == NULL)
> > netdev_warn(dev, "No slave devices configured\n");
> >
>
> It would be good to split this into multiple patches. Do the A to
> Slave A, B to Slave B, etc as one patch. Then add Interlink.
>
Ok. This is particular one can be extracted to separate patch.
> Ideally you want lots of simple patches which are obviously correct,
> each with a good commit message explaining why the change is being
> made.
+1
>
> Andrew
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2024-02-29 9:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 15:07 [RFC] net: hsr: Provide RedBox support Lukasz Majewski
2024-02-28 16:31 ` Stephen Hemminger
2024-02-28 17:03 ` Andrew Lunn
2024-02-29 9:25 ` Lukasz Majewski
2024-02-29 14:59 ` Andrew Lunn
2024-03-01 9:37 ` Lukasz Majewski
2024-02-28 17:13 ` Andrew Lunn
2024-02-29 9:30 ` Lukasz Majewski [this message]
2024-02-28 17:58 ` Dan Carpenter
2024-03-01 7:38 ` Ziyang Xuan (William)
2024-03-01 9:55 ` Lukasz Majewski
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=20240229103048.45ecc1de@wsk \
--to=lukma@denx.de \
--cc=Tristram.Ha@microchip.com \
--cc=andrew@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=horms@kernel.org \
--cc=koverskeid@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=matttbe@kernel.org \
--cc=n.zhandarovich@fintech.ru \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=william.xuanziyang@huawei.com \
--cc=wojciech.drewek@intel.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).