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/core/mmc_ops.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/core/mmc_ops.c')
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index de4e1855b8ed..1ed3866e990f 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c | |||
@@ -235,7 +235,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, | |||
235 | { | 235 | { |
236 | struct mmc_request mrq; | 236 | struct mmc_request mrq; |
237 | struct mmc_command cmd = {0}; | 237 | struct mmc_command cmd = {0}; |
238 | struct mmc_data data; | 238 | struct mmc_data data = {0}; |
239 | struct scatterlist sg; | 239 | struct scatterlist sg; |
240 | void *data_buf; | 240 | void *data_buf; |
241 | 241 | ||
@@ -247,7 +247,6 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, | |||
247 | return -ENOMEM; | 247 | return -ENOMEM; |
248 | 248 | ||
249 | memset(&mrq, 0, sizeof(struct mmc_request)); | 249 | memset(&mrq, 0, sizeof(struct mmc_request)); |
250 | memset(&data, 0, sizeof(struct mmc_data)); | ||
251 | 250 | ||
252 | mrq.cmd = &cmd; | 251 | mrq.cmd = &cmd; |
253 | mrq.data = &data; | 252 | mrq.data = &data; |
@@ -459,7 +458,7 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode, | |||
459 | { | 458 | { |
460 | struct mmc_request mrq; | 459 | struct mmc_request mrq; |
461 | struct mmc_command cmd = {0}; | 460 | struct mmc_command cmd = {0}; |
462 | struct mmc_data data; | 461 | struct mmc_data data = {0}; |
463 | struct scatterlist sg; | 462 | struct scatterlist sg; |
464 | u8 *data_buf; | 463 | u8 *data_buf; |
465 | u8 *test_buf; | 464 | u8 *test_buf; |
@@ -489,7 +488,6 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode, | |||
489 | memcpy(data_buf, test_buf, len); | 488 | memcpy(data_buf, test_buf, len); |
490 | 489 | ||
491 | memset(&mrq, 0, sizeof(struct mmc_request)); | 490 | memset(&mrq, 0, sizeof(struct mmc_request)); |
492 | memset(&data, 0, sizeof(struct mmc_data)); | ||
493 | 491 | ||
494 | mrq.cmd = &cmd; | 492 | mrq.cmd = &cmd; |
495 | mrq.data = &data; | 493 | mrq.data = &data; |