diff options
author | Chris Ball <cjb@laptop.org> | 2011-04-13 23:40:30 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-24 21:01:52 -0400 |
commit | 1278dba167f01bb3c6626d16450d31129d041087 (patch) | |
tree | 6fb3af716e5437cb558ae37fd8a58db23b9b173e /drivers/mmc/card/mmc_test.c | |
parent | 62929e4be3fe4cc632b3b03645e083c6548de531 (diff) | |
download | linux-1278dba167f01bb3c6626d16450d31129d041087.tar.gz linux-1278dba167f01bb3c6626d16450d31129d041087.tar.bz2 linux-1278dba167f01bb3c6626d16450d31129d041087.zip |
mmc: initialize struct mmc_command at declaration time
Converts from:
struct mmc_command cmd;
memset(&cmd, 0, sizeof(struct mmc_command));
to:
struct mmc_command cmd = {0};
because it's shorter, as performant, and easier to work out whether
initialization has happened.
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card/mmc_test.c')
-rw-r--r-- | drivers/mmc/card/mmc_test.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index abc1a63bcc5e..95c298faeb48 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -212,7 +212,7 @@ static int mmc_test_busy(struct mmc_command *cmd) static int mmc_test_wait_busy(struct mmc_test_card *test) { int ret, busy; - struct mmc_command cmd; + struct mmc_command cmd = {0}; busy = 0; do { @@ -247,16 +247,14 @@ static int mmc_test_buffer_transfer(struct mmc_test_card *test, int ret; struct mmc_request mrq; - struct mmc_command cmd; - struct mmc_command stop; + struct mmc_command cmd = {0}; + struct mmc_command stop = {0}; struct mmc_data data; struct scatterlist sg; memset(&mrq, 0, sizeof(struct mmc_request)); - memset(&cmd, 0, sizeof(struct mmc_command)); memset(&data, 0, sizeof(struct mmc_data)); - memset(&stop, 0, sizeof(struct mmc_command)); mrq.cmd = &cmd; mrq.data = &data; @@ -732,14 +730,12 @@ static int mmc_test_simple_transfer(struct mmc_test_card *test, unsigned blocks, unsigned blksz, int write) { struct mmc_request mrq; - struct mmc_command cmd; - struct mmc_command stop; + struct mmc_command cmd = {0}; + struct mmc_command stop = {0}; struct mmc_data data; memset(&mrq, 0, sizeof(struct mmc_request)); - memset(&cmd, 0, sizeof(struct mmc_command)); memset(&data, 0, sizeof(struct mmc_data)); - memset(&stop, 0, sizeof(struct mmc_command)); mrq.cmd = &cmd; mrq.data = &data; @@ -762,16 +758,14 @@ static int mmc_test_broken_transfer(struct mmc_test_card *test, unsigned blocks, unsigned blksz, int write) { struct mmc_request mrq; - struct mmc_command cmd; - struct mmc_command stop; + struct mmc_command cmd = {0}; + struct mmc_command stop = {0}; struct mmc_data data; struct scatterlist sg; memset(&mrq, 0, sizeof(struct mmc_request)); - memset(&cmd, 0, sizeof(struct mmc_command)); memset(&data, 0, sizeof(struct mmc_data)); - memset(&stop, 0, sizeof(struct mmc_command)); mrq.cmd = &cmd; mrq.data = &data; |