From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
Andreas Koensgen <ajk@comnets.uni-bremen.de>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-hams@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v2 08/11] 6pack: drop sixpack::mtu
Date: Thu, 8 Aug 2024 12:35:44 +0200 [thread overview]
Message-ID: <20240808103549.429349-9-jirislaby@kernel.org> (raw)
In-Reply-To: <20240808103549.429349-1-jirislaby@kernel.org>
It holds a constant (AX25_MTU + 73), so use that constant in place of
the single use directly.
And remove the stale comment.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: linux-hams@vger.kernel.org
Cc: netdev@vger.kernel.org
---
drivers/net/hamradio/6pack.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 29906901a734..f8235b1b60e9 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -100,7 +100,6 @@ struct sixpack {
unsigned int rx_count_cooked;
spinlock_t rxlock;
- int mtu; /* Our mtu (to spot changes!) */
int buffsize; /* Max buffers sizes */
unsigned long flags; /* Flag values/ mode etc */
@@ -166,7 +165,7 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len)
unsigned char *msg, *p = icp;
int actual, count;
- if (len > sp->mtu) { /* sp->mtu = AX25_MTU = max. PACLEN = 256 */
+ if (len > AX25_MTU + 73) {
msg = "oversized transmit packet!";
goto out_drop;
}
@@ -585,7 +584,6 @@ static int sixpack_open(struct tty_struct *tty)
sp->xbuff = xbuff;
- sp->mtu = AX25_MTU + 73;
sp->buffsize = len;
sp->rcount = 0;
sp->rx_count = 0;
--
2.46.0
next prev parent reply other threads:[~2024-08-08 10:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 10:35 [PATCH v2 00/11] tty: random fixes and cleanups Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 01/11] serial: use guards for simple mutex locks Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 02/11] mxser: remove stale comment Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 03/11] mxser: remove doubled sets of close times Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 04/11] xhci: dbgtty: remove kfifo_out() wrapper Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 05/11] xhci: dbgtty: use kfifo from tty_port struct Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 06/11] mctp: serial: propagage new tty types Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 07/11] 6pack: remove sixpack::rbuff Jiri Slaby (SUSE)
2024-08-08 10:35 ` Jiri Slaby (SUSE) [this message]
2024-08-08 10:35 ` [PATCH v2 09/11] 6pack: drop sixpack::buffsize Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 10/11] 6pack: remove global strings Jiri Slaby (SUSE)
2024-08-08 10:35 ` [PATCH v2 11/11] 6pack: propagage new tty types Jiri Slaby (SUSE)
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=20240808103549.429349-9-jirislaby@kernel.org \
--to=jirislaby@kernel.org \
--cc=ajk@comnets.uni-bremen.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@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