Re: [PATCH next] sctp: make use of WORD_TRUNC macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux