linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: assign initial value to a static variable in r8712_efuse_pg_packet_write()
@ 2019-02-27  3:33 Mao Wenan
  2019-02-28  8:04 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Mao Wenan @ 2019-02-27  3:33 UTC (permalink / raw)
  To: Larry.Finger, florian.c.schilhabel, straube.linux,
	kernel-janitors, devel, linux-kernel

repeat_times is a static variable, but each time when it enters
r8712_efuse_pg_packet_write(), it is set to zero,
this value is not consistent with last calling, so next behavior
is not our expect.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/staging/rtl8712/rtl8712_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rtl8712/rtl8712_efuse.c
index 8bc45ffd3029..3e8421255170 100644
--- a/drivers/staging/rtl8712/rtl8712_efuse.c
+++ b/drivers/staging/rtl8712/rtl8712_efuse.c
@@ -358,7 +358,7 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
 	u8 pg_header = 0;
 	u16 efuse_addr = 0, curr_size = 0;
 	u8 efuse_data, target_word_cnts = 0;
-	static int repeat_times;
+	static int repeat_times = 0;
 	int sub_repeat;
 	u8 bResult = true;
 
@@ -368,7 +368,6 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
 		return false;
 	pg_header = MAKE_EFUSE_HEADER(offset, word_en);
 	target_word_cnts = calculate_word_cnts(word_en);
-	repeat_times = 0;
 	efuse_addr = 0;
 	while (efuse_addr < efuse_available_max_size) {
 		curr_size = r8712_efuse_get_current_size(padapter);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-28  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27  3:33 [PATCH] staging: rtl8712: assign initial value to a static variable in r8712_efuse_pg_packet_write() Mao Wenan
2019-02-28  8:04 ` Greg KH
2019-02-28  9:26   ` maowenan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).