mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 04:32:37 +01:00
mpdu: Simplify checks
This commit is contained in:
parent
002290998e
commit
6a011f0d92
@ -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,
|
static inline bool next_2bytes(const unsigned char *mpdu, int len,
|
||||||
int *offset, uint16_t *holder)
|
int *offset, uint16_t *holder)
|
||||||
{
|
{
|
||||||
if (len == *offset || len < *offset + 2)
|
if (len < *offset + 2)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*holder = L_LE16_TO_CPU(*((uint16_t *) mpdu+*offset));
|
*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;
|
int i;
|
||||||
|
|
||||||
if (len == *offset || len < *offset + t_len)
|
if (len < *offset + t_len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (i = 0; i < t_len; i++)
|
for (i = 0; i < t_len; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user