3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-04 02:18:49 +02:00

mpdu: Simplify checks

This commit is contained in:
Denis Kenzior 2014-12-16 14:22:13 -06:00
parent 002290998e
commit 6a011f0d92

View File

@ -43,7 +43,7 @@ static inline bool next_byte(const unsigned char *mpdu, int len,
static inline bool next_2bytes(const unsigned char *mpdu, int len,
int *offset, uint16_t *holder)
{
if (len == *offset || len < *offset + 2)
if (len < *offset + 2)
return false;
*holder = L_LE16_TO_CPU(*((uint16_t *) mpdu+*offset));
@ -57,7 +57,7 @@ static inline bool next_data(const unsigned char *mpdu, int len,
{
int i;
if (len == *offset || len < *offset + t_len)
if (len < *offset + t_len)
return false;
for (i = 0; i < t_len; i++)