Skip to contentSkip to conversation

staging: rtl8712: assign initial value to a static variable in r8712_efuse_pg_packet_write()

PATCH In review Mao Wenan 2 participants 3 messages Feb 27, 2019 – Feb 28, 2019

Subsystems (2)
lore
Share & tools
lore

Mao Wenan

author
#0 lore raw

PATCH 1/1 staging: rtl8712: assign initial value to a static variable in r8712_efuse_pg_packet_write()

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.

---
 drivers/staging/rtl8712/rtl8712_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/rtl8712_efuse.c +1 -2
index 8bc45ffd3029..3e8421255170 100644
@@ -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);
Signature · 1 line
2.20.1
#1 lore raw
Quoted 24 lines · Mao Wenan

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.

---
 drivers/staging/rtl8712/rtl8712_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/rtl8712_efuse.c +1 -1
index 8bc45ffd3029..3e8421255170 100644
@@ -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;
 

drivers/staging/rtl8712/rtl8712_efuse.c u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset, · line 373

Quoted 7 lines
drivers/staging/rtl8712/rtl8712_efuse.c +0 -1
@@ -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);

This patch does not apply to my tree at all.

And are you sure this is correct?

greg k-h

author
#2 lore raw
Quoted 35 lines · Greg KH
Quoted 24 lines · Mao Wenan

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.

---
 drivers/staging/rtl8712/rtl8712_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8712/rtl8712_efuse.c +1 -1
index 8bc45ffd3029..3e8421255170 100644
@@ -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;
 

drivers/staging/rtl8712/rtl8712_efuse.c u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset, · line 373

Quoted 7 lines
drivers/staging/rtl8712/rtl8712_efuse.c +0 -1
@@ -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);

This patch does not apply to my tree at all.

Quoted 1 line

And are you sure this is correct?

sorry, my base tree is wrong, this fix is invalid.

Quoted 5 lines

greg k-h

.