staging: rtl8188eu: unnecessary branching removed
authorIvan Safonov <insafonov@gmail.com>
Tue, 3 Nov 2015 09:48:22 +0000 (16:48 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2015 04:02:47 +0000 (20:02 -0800)
If the 'remain' is zero, the loop is not executed at all.

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

index 39c5a05..44e8078 100644 (file)
@@ -72,11 +72,9 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
                offset += blk_sz;
        }
 
-       if (remain) {
-               buf_ptr += blk_cnt * blk_sz;
-               for (i = 0; i < remain; i++) {
-                       usb_write8(adapt, offset + i, buf_ptr[i]);
-               }
+       buf_ptr += blk_cnt * blk_sz;
+       for (i = 0; i < remain; i++) {
+               usb_write8(adapt, offset + i, buf_ptr[i]);
        }
 }