提交 08ecab13 编写于 作者: I Ivan Safonov 提交者: 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: NIvan Safonov <insafonov@gmail.com>
Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册