diff options
author | Chris Ball <cjb@laptop.org> | 2011-04-13 23:46:05 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-24 21:01:56 -0400 |
commit | a61ad2b49bfce94dfddce828cd9222e4b9e7825b (patch) | |
tree | 36f93e61adc7c7d7523c78c78c3df1e75fae5e33 /drivers/mmc/card/mmc_test.c | |
parent | 1278dba167f01bb3c6626d16450d31129d041087 (diff) |
mmc: initialize struct mmc_data at declaration time
Converts from:
struct mmc_data data;
memset(&data, 0, sizeof(struct mmc_data));
to:
struct mmc_data data = {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 | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index 95c298faeb48..f44762b6e592 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -249,12 +249,11 @@ static int mmc_test_buffer_transfer(struct mmc_test_card *test, struct mmc_request mrq; struct mmc_command cmd = {0}; struct mmc_command stop = {0}; - struct mmc_data data; + struct mmc_data data = {0}; struct scatterlist sg; memset(&mrq, 0, sizeof(struct mmc_request)); - memset(&data, 0, sizeof(struct mmc_data)); mrq.cmd = &cmd; mrq.data = &data; @@ -732,10 +731,9 @@ static int mmc_test_simple_transfer(struct mmc_test_card *test, struct mmc_request mrq; struct mmc_command cmd = {0}; struct mmc_command stop = {0}; - struct mmc_data data; + struct mmc_data data = {0}; memset(&mrq, 0, sizeof(struct mmc_request)); - memset(&data, 0, sizeof(struct mmc_data)); mrq.cmd = &cmd; mrq.data = &data; @@ -760,12 +758,11 @@ static int mmc_test_broken_transfer(struct mmc_test_card *test, struct mmc_request mrq; struct mmc_command cmd = {0}; struct mmc_command stop = {0}; - struct mmc_data data; + struct mmc_data data = {0}; struct scatterlist sg; memset(&mrq, 0, sizeof(struct mmc_request)); - memset(&data, 0, sizeof(struct mmc_data)); mrq.cmd = &cmd; mrq.data = &data; |