Skip to contentSkip to conversation

usb: storage: sddr09: initialize variables directly

PATCH New Emilio López 1 participant 2 messages May 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 usb: storage: sddr09: initialize variables directly

Clean up the code a bit to initialize the variables directly when defining them.

---

Please note that this patch is untested.

 drivers/usb/storage/sddr09.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/usb/storage/sddr09.c +1 -5
index 732027f..073a2c3 100644
@@ -219,11 +219,7 @@ static void nand_init_ecc(void) {
 /* compute 3-byte ecc on 256 bytes */
 static void nand_compute_ecc(unsigned char *data, unsigned char *ecc) {
 	int i, j, a;
-	unsigned char par, bit, bits[8];
-
-	par = 0;
-	for (j = 0; j < 8; j++)
-		bits[j] = 0;
+	unsigned char par = 0, bit, bits[8] = {0};
 
 	/* collect 16 checksum bits */
 	for (i = 0; i < 256; i++) {
Signature · 1 line
1.8.2.3
#1 lore raw

PATCH 2/2 usb: storage: alauda: initialize variables directly

Clean up the code a bit to initialize the variables directly when defining them.

---

Please note that this patch is untested.

 drivers/usb/storage/alauda.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/usb/storage/alauda.c +1 -5
index 77a2ddf..6636a58 100644
@@ -249,11 +249,7 @@ static void nand_init_ecc(void) {
 /* compute 3-byte ecc on 256 bytes */
 static void nand_compute_ecc(unsigned char *data, unsigned char *ecc) {
 	int i, j, a;
-	unsigned char par, bit, bits[8];
-
-	par = 0;
-	for (j = 0; j < 8; j++)
-		bits[j] = 0;
+	unsigned char par = 0, bit, bits[8] = {0};
 
 	/* collect 16 checksum bits */
 	for (i = 0; i < 256; i++) {
Signature · 1 line
1.8.2.3