Skip to contentSkip to conversation

staging: rtl8712: rtl871x_security.c: remove unnecessary variable initialization

PATCH In review Sunil Shahu 3 participants 5 messages Jun 26, 2015 – Jul 3, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8712: rtl871x_security.c: remove unnecessary variable initialization

Variable "u32 c" always re-initialize in for loop. Initialized value of "u32 c" is not used in function and is redundant, hence removed.

---
 drivers/staging/rtl8712/rtl871x_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl871x_security.c +1 -1
index 21465c9..8627928 100644
@@ -125,7 +125,7 @@ static u8 crc32_reverseBit(u8 data)
 static void crc32_init(void)
 {
 	sint i, j;
-	u32 c = 0x12340000;
+	u32 c;
 	u8 *p = (u8 *)&c, *p1;
 	u8 k;
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 25 lines · Sunil Shahu

Variable "u32 c" always re-initialize in for loop. Initialized value of "u32 c" is not used in function and is redundant, hence removed.

---
 drivers/staging/rtl8712/rtl871x_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl871x_security.c +1 -1
index 21465c9..8627928 100644
@@ -125,7 +125,7 @@ static u8 crc32_reverseBit(u8 data)
 static void crc32_init(void)
 {
 	sint i, j;
-	u32 c = 0x12340000;
+	u32 c;
 	u8 *p = (u8 *)&c, *p1;
 	u8 k;
 
Signature · 1 line
1.9.1

The patch is good, the value assigned to c is immediately overwritten.

Unfortunately the patch fails to apply in staging-testing and linux-next. Could you please rebase?

Thanks,
Luis

#2 lore raw
Quoted 24 lines · Luis de Bethencourt
Quoted 23 lines · Sunil Shahu

Variable "u32 c" always re-initialize in for loop. Initialized value of "u32 c" is not used in function and is redundant, hence removed.

---
 drivers/staging/rtl8712/rtl871x_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl871x_security.c +1 -1
index 21465c9..8627928 100644
@@ -125,7 +125,7 @@ static u8 crc32_reverseBit(u8 data)
 static void crc32_init(void)
 {
 	sint i, j;
-	u32 c = 0x12340000;
+	u32 c;
 	u8 *p = (u8 *)&c, *p1;
 	u8 k;
 
Quoted 7 lines
Quoted 2 lines
Signature · 1 line
1.9.1

The patch is good, the value assigned to c is immediately overwritten.

Unfortunately the patch fails to apply in staging-testing and linux-next. Could you please rebase?

It's based on earlier patches on the list.

Normally only Greg tests that patches apply and it will for him because he applies them as the order they arrive. But we should probably start putting notes on the patches which earlier patches are required...

regards,
dan carpenter

#3 lore raw
Quoted 33 lines · Dan Carpenter
Quoted 24 lines · Luis de Bethencourt
Quoted 23 lines · Sunil Shahu

Variable "u32 c" always re-initialize in for loop. Initialized value of "u32 c" is not used in function and is redundant, hence removed.

---
 drivers/staging/rtl8712/rtl871x_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl871x_security.c +1 -1
index 21465c9..8627928 100644
@@ -125,7 +125,7 @@ static u8 crc32_reverseBit(u8 data)
 static void crc32_init(void)
 {
 	sint i, j;
-	u32 c = 0x12340000;
+	u32 c;
 	u8 *p = (u8 *)&c, *p1;
 	u8 k;
 
Quoted 7 lines
Quoted 2 lines
Signature · 1 line
1.9.1

The patch is good, the value assigned to c is immediately overwritten.

Unfortunately the patch fails to apply in staging-testing and linux-next. Could you please rebase?

Quoted 9 lines

It's based on earlier patches on the list.

Normally only Greg tests that patches apply and it will for him because he applies them as the order they arrive. But we should probably start putting notes on the patches which earlier patches are required...

regards,
dan carpenter

I see. Thanks for the explanation.

Then the patch is good, but it doesn't need a Reviewed-by line since it you pre-approved it.

Regards,
Luis

#4 lore raw
In reply to Dan Carpenter
Quoted 7 lines · Dan Carpenter

It's based on earlier patches on the list.

Normally only Greg tests that patches apply and it will for him because
he applies them as the order they arrive. But we should probably start
putting notes on the patches which earlier patches are required...

This patch is built on top of following patch.
[PATCH v2] drivers: staging: rtl8712: remove unnecessary else statement
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-June/071797.html

Regards,
Sunil