All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function
@ 2015-11-08  7:08 Ivan Safonov
  0 siblings, 0 replies; only message in thread
From: Ivan Safonov @ 2015-11-08  7:08 UTC (permalink / raw)
  To: devel
  Cc: Greg Kroah-Hartman, Vaishali Thakkar, Jakub Sitnicki,
	Anish Bhatt, Joe Perches, Ivan Safonov, Nicholas Mc Guire,
	Alexey Khoroshilov, Rémy Oudompheng, Sudip Mukherjee,
	Shraddha Barke, linux-kernel

Ideally the function should not change the variables outside of its body.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/hal/fw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c
index 4d72537..5b569ef 100644
--- a/drivers/staging/rtl8188eu/hal/fw.c
+++ b/drivers/staging/rtl8188eu/hal/fw.c
@@ -75,14 +75,14 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
 		usb_write8(adapt, write_address, byte_buffer[i]);
 }
 
-static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
+static u32 _rtl88e_fill_dummy(u8 *pfwbuf, u32 pfwlen)
 {
 	u32 i;
 
-	for (i = *pfwlen; i < roundup(*pfwlen, 4); i++)
+	for (i = pfwlen; i < roundup(pfwlen, 4); i++)
 		pfwbuf[i] = 0;
 
-	*pfwlen = i;
+	return i;
 }
 
 static void _rtl88e_fw_page_write(struct adapter *adapt,
@@ -103,7 +103,7 @@ static void _rtl88e_write_fw(struct adapter *adapt, u8 *buffer, u32 size)
 	u32 page_no, remain;
 	u32 page, offset;
 
-	_rtl88e_fill_dummy(buf_ptr, &size);
+	size = _rtl88e_fill_dummy(buf_ptr, size);
 
 	page_no = size / FW_8192C_PAGE_SIZE;
 	remain = size % FW_8192C_PAGE_SIZE;
-- 
2.4.10


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-08  7:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-08  7:08 [PATCH v2 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function Ivan Safonov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.