From: Leon Romanovsky <leon@kernel.org>
To: Xie He <xie.he.0141@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Linux X25 <linux-x25@vger.kernel.org>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Martin Schiller <ms@dev.tdt.de>, Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [PATCH net-next RFC v3] net: hdlc_x25: Queue outgoing LAPB frames
Date: Tue, 16 Feb 2021 08:03:56 +0200 [thread overview]
Message-ID: <YCtgTBvR6TD8sPpe@unreal> (raw)
In-Reply-To: <CAJht_EPy1Us72YGMune2G3s1TLB4TOCBFJpZt+KbVUV8uoFbfA@mail.gmail.com>
On Mon, Feb 15, 2021 at 11:08:02AM -0800, Xie He wrote:
> On Mon, Feb 15, 2021 at 10:54 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Mon, Feb 15, 2021 at 09:23:32AM -0800, Xie He wrote:
> > > On Mon, Feb 15, 2021 at 1:25 AM Leon Romanovsky <leon@kernel.org> wrote:
> > > >
> > > > > + /* When transmitting data:
> > > > > + * first we'll remove a pseudo header of 1 byte,
> > > > > + * then the LAPB module will prepend an LAPB header of at most 3 bytes.
> > > > > + */
> > > > > + dev->needed_headroom = 3 - 1;
> > > >
> > > > 3 - 1 = 2
> > > >
> > > > Thanks
> > >
> > > Actually this is intentional. It makes the numbers more meaningful.
> > >
> > > The compiler should automatically generate the "2" so there would be
> > > no runtime penalty.
> >
> > If you want it intentional, write it in the comment.
> >
> > /* When transmitting data, we will need extra 2 bytes headroom,
> > * which are 3 bytes of LAPB header minus one byte of pseudo header.
> > */
> > dev->needed_headroom = 2;
>
> I think this is unnecessary. The current comment already explains the
> meaning of the "1" and the "3". There's no need for a reader of this
> code to understand what a "2" is. That is the job of the compiler, not
> the human reader.
It is not related to compiler/human format. If you need to write "3 - 1"
to make it easy for users, it means that your comment above is not
full/correct/e.t.c.
Thanks
next prev parent reply other threads:[~2021-02-16 6:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-15 7:27 [PATCH net-next RFC v3] net: hdlc_x25: Queue outgoing LAPB frames Xie He
2021-02-15 9:24 ` Leon Romanovsky
2021-02-15 17:23 ` Xie He
2021-02-15 18:54 ` Leon Romanovsky
2021-02-15 19:08 ` Xie He
2021-02-16 6:03 ` Leon Romanovsky [this message]
2021-02-16 7:30 ` Xie He
2021-02-16 7:39 ` Leon Romanovsky
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=YCtgTBvR6TD8sPpe@unreal \
--to=leon@kernel.org \
--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=ms@dev.tdt.de \
--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 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).