mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: storage: sddr09: initialize variables directly
@ 2013-05-12 14:43 Emilio López
  2013-05-12 14:43 ` [PATCH 2/2] usb: storage: alauda: " Emilio López
  0 siblings, 1 reply; 2+ messages in thread
From: Emilio López @ 2013-05-12 14:43 UTC (permalink / raw)
  To: Matthew Dharm, Greg Kroah-Hartman
  Cc: linux-usb, usb-storage, linux-kernel, Emilio López

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

Signed-off-by: Emilio López <emilio@elopez.com.ar>
---

Please note that this patch is untested.

 drivers/usb/storage/sddr09.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index 732027f..073a2c3 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -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++) {
-- 
1.8.2.3


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

end of thread, other threads:[~2013-05-12 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-12 14:43 [PATCH 1/2] usb: storage: sddr09: initialize variables directly Emilio López
2013-05-12 14:43 ` [PATCH 2/2] usb: storage: alauda: " Emilio López

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®