lkml.org 
[lkml]   [2014]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi: core: Validate lenght of the transfers in message
On Thu, Feb 13, 2014 at 04:46:46PM +0200, Ivan T. Ivanov wrote:

> + /* No partial transfers accepted */
> + if (!n_words || xfer->len & (w_size - 1))
> + return -EINVAL;

Please write this using % rather than the & - it's a lot clearer what
it's checking for, I had to think what the above meant. Hopefully the
compiler will make it equally fast either way.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-02-14 20:21    [W:0.745 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site