Commit 08ecab13 authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging: rtl8188eu: for loop instead of while loop used

The range of elements to fill with zeros is determined by using a roundup macro
Signed-off-by: default avatarIvan Safonov <insafonov@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 13cab3d4
...@@ -77,18 +77,12 @@ static void _rtl88e_fw_block_write(struct adapter *adapt, ...@@ -77,18 +77,12 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen) static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
{ {
u32 fwlen = *pfwlen; u32 i;
u8 remain = (u8)(fwlen % 4);
remain = (remain == 0) ? 0 : (4 - remain); for (i = *pfwlen; i < roundup(*pfwlen, 4); i++)
pfwbuf[i] = 0;
while (remain > 0) { *pfwlen = i;
pfwbuf[fwlen] = 0;
fwlen++;
remain--;
}
*pfwlen = fwlen;
} }
static void _rtl88e_fw_page_write(struct adapter *adapt, static void _rtl88e_fw_page_write(struct adapter *adapt,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment