staging: rtl8188eu: offset increment placed into for loop header
authorIvan Safonov <insafonov@gmail.com>
Tue, 3 Nov 2015 09:49:13 +0000 (16:49 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2015 04:02:47 +0000 (20:02 -0800)
It makes the code little easier.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/fw.c

index 44e807803a363c4426633f415a0188db581ba632..3cfd2b2bc868128fdf9417ea2814c1b87e190695 100644 (file)
@@ -67,14 +67,13 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
 
        offset = FW_8192C_START_ADDRESS;
 
-       for (i = 0; i < blk_cnt; i++) {
+       for (i = 0; i < blk_cnt; i++, offset += blk_sz) {
                usb_write32(adapt, offset, pu4BytePtr[i]);
-               offset += blk_sz;
        }
 
        buf_ptr += blk_cnt * blk_sz;
-       for (i = 0; i < remain; i++) {
-               usb_write8(adapt, offset + i, buf_ptr[i]);
+       for (i = 0; i < remain; i++, offset++) {
+               usb_write8(adapt, offset, buf_ptr[i]);
        }
 }