]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
6pack: drop sixpack::mtu
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 8 Aug 2024 10:35:44 +0000 (12:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 06:25:21 +0000 (08:25 +0200)
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
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20240808103549.429349-9-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hamradio/6pack.c

index 29906901a73447e086cd771013862c415af288b9..f8235b1b60e96e9017bcbe2344dfbbfb436cd8c7 100644 (file)
@@ -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;