From: Martin Schiller <ms@dev.tdt.de>
To: Xie He <xie.he.0141@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-x25@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [PATCH net] net: hdlc_x25: Return meaningful error code in x25_open
Date: Thu, 04 Feb 2021 07:20:23 +0100 [thread overview]
Message-ID: <352fd651d4fd98e46f7c58fc05eea4e7@dev.tdt.de> (raw)
In-Reply-To: <20210203071541.86138-1-xie.he.0141@gmail.com>
On 2021-02-03 08:15, Xie He wrote:
> It's not meaningful to pass on LAPB error codes to HDLC code or other
> parts of the system, because they will not understand the error codes.
>
> Instead, use system-wide recognizable error codes.
>
> Fixes: f362e5fe0f1f ("wan/hdlc_x25: make lapb params configurable")
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: Martin Schiller <ms@dev.tdt.de>
> Signed-off-by: Xie He <xie.he.0141@gmail.com>
> ---
> drivers/net/wan/hdlc_x25.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
> index bb164805804e..4aaa6388b9ee 100644
> --- a/drivers/net/wan/hdlc_x25.c
> +++ b/drivers/net/wan/hdlc_x25.c
> @@ -169,11 +169,11 @@ static int x25_open(struct net_device *dev)
>
> result = lapb_register(dev, &cb);
> if (result != LAPB_OK)
> - return result;
> + return -ENOMEM;
>
> result = lapb_getparms(dev, ¶ms);
> if (result != LAPB_OK)
> - return result;
> + return -EINVAL;
>
> if (state(hdlc)->settings.dce)
> params.mode = params.mode | LAPB_DCE;
> @@ -188,7 +188,7 @@ static int x25_open(struct net_device *dev)
>
> result = lapb_setparms(dev, ¶ms);
> if (result != LAPB_OK)
> - return result;
> + return -EINVAL;
>
> return 0;
> }
Thanks for fixing this.
Acked-by: Martin Schiller <ms@dev.tdt.de>
next prev parent reply other threads:[~2021-02-04 6:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 7:15 [PATCH net] net: hdlc_x25: Return meaningful error code in x25_open Xie He
2021-02-04 6:20 ` Martin Schiller [this message]
2021-02-05 2:20 ` patchwork-bot+netdevbpf
2021-02-05 2:20 ` patchwork-bot+netdevbpf
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=352fd651d4fd98e46f7c58fc05eea4e7@dev.tdt.de \
--to=ms@dev.tdt.de \
--cc=davem@davemloft.net \
--cc=khc@pm.waw.pl \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xie.he.0141@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.