netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "'Marcelo Ricardo Leitner'" <marcelo.leitner@gmail.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-sctp@vger.kernel.org" <linux-sctp@vger.kernel.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Vlad Yasevich <vyasevich@gmail.com>
Subject: Re: [PATCH next] sctp: make use of WORD_TRUNC macro
Date: Fri, 16 Sep 2016 08:35:57 -0300	[thread overview]
Message-ID: <20160916113557.GC3200@localhost.localdomain> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB00FF62C@AcuExch.aculab.com>

On Fri, Sep 16, 2016 at 09:51:56AM +0000, David Laight wrote:
> From: Marcelo Ricardo Leitner
> > Sent: 15 September 2016 19:13
> > No functional change. Just to avoid the usage of '&~3'.
> ...
> > -	max_data = (asoc->pathmtu -
> > -		sctp_sk(asoc->base.sk)->pf->af->net_header_len -
> > -		sizeof(struct sctphdr) - sizeof(struct sctp_data_chunk)) & ~3;
> > +	max_data = asoc->pathmtu -
> > +		   sctp_sk(asoc->base.sk)->pf->af->net_header_len -
> > +		   sizeof(struct sctphdr) - sizeof(struct sctp_data_chunk);
> > +	max_data = WORD_TRUNC(max_data);
> 
> Hmmm....
> Am I the only person who understands immediately what & ~3 does
> but would have to grovel through the headers to find exactly what
> WORD_TRUNC() does.
> 

ctags & cia can help you with that. :)

> How big is a 'WORD' anyway??

That's pretty much one of the reasons for using the macro, to make sure
it is correctly adapted to some arch if necessary. (even though it's
not necessary in this case)

  Marcelo

  reply	other threads:[~2016-09-16 11:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 18:12 [PATCH next] sctp: make use of WORD_TRUNC macro Marcelo Ricardo Leitner
2016-09-16  9:51 ` David Laight
2016-09-16 11:35   ` 'Marcelo Ricardo Leitner' [this message]
2016-09-19  2:06 ` David Miller
2016-09-19  3:05   ` Marcelo Ricardo Leitner

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=20160916113557.GC3200@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@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).