diff options
author | Joshua Oreman <oremanj@rwcr.net> | 2009-06-30 21:55:10 -0700 |
---|---|---|
committer | Marty Connor <mdc@etherboot.org> | 2010-01-05 09:02:59 -0500 |
commit | ff4d61de962a11517fd9958d0a40fbd8bcbd92ec (patch) | |
tree | 058b8866f896278092b02e5a3bcda94482c1386d /src | |
parent | 59b7d00c068249aba617384dcb2df2441fd878c2 (diff) | |
download | ipxe-ff4d61de962a11517fd9958d0a40fbd8bcbd92ec.zip ipxe-ff4d61de962a11517fd9958d0a40fbd8bcbd92ec.tar.gz ipxe-ff4d61de962a11517fd9958d0a40fbd8bcbd92ec.tar.bz2 |
[crypto] Add parentheses around len argument in blocksize assert
This fixes an issue where passing a length as a compound expression
(e.g. using `hdrlen + datalen') would trigger compiler warnings and
potentially precedence-related errors.
Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gpxe/crypto.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/gpxe/crypto.h b/src/include/gpxe/crypto.h index 3831b79..751ca05 100644 --- a/src/include/gpxe/crypto.h +++ b/src/include/gpxe/crypto.h @@ -129,7 +129,7 @@ static inline void cipher_encrypt ( struct cipher_algorithm *cipher, cipher->encrypt ( ctx, src, dst, len ); } #define cipher_encrypt( cipher, ctx, src, dst, len ) do { \ - assert ( ( len & ( (cipher)->blocksize - 1 ) ) == 0 ); \ + assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \ cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \ } while ( 0 ) @@ -139,7 +139,7 @@ static inline void cipher_decrypt ( struct cipher_algorithm *cipher, cipher->decrypt ( ctx, src, dst, len ); } #define cipher_decrypt( cipher, ctx, src, dst, len ) do { \ - assert ( ( len & ( (cipher)->blocksize - 1 ) ) == 0 ); \ + assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \ cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \ } while ( 0 ) |