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/sdio_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/sdio_ops.c')
-rw-r--r-- | drivers/mmc/core/sdio_ops.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c index f77b1bc318ed..147dfc1879b3 100644 --- a/drivers/mmc/core/sdio_ops.c +++ b/drivers/mmc/core/sdio_ops.c | |||
@@ -123,7 +123,7 @@ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, | |||
123 | { | 123 | { |
124 | struct mmc_request mrq; | 124 | struct mmc_request mrq; |
125 | struct mmc_command cmd = {0}; | 125 | struct mmc_command cmd = {0}; |
126 | struct mmc_data data; | 126 | struct mmc_data data = {0}; |
127 | struct scatterlist sg; | 127 | struct scatterlist sg; |
128 | 128 | ||
129 | BUG_ON(!card); | 129 | BUG_ON(!card); |
@@ -137,7 +137,6 @@ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, | |||
137 | return -EINVAL; | 137 | return -EINVAL; |
138 | 138 | ||
139 | memset(&mrq, 0, sizeof(struct mmc_request)); | 139 | memset(&mrq, 0, sizeof(struct mmc_request)); |
140 | memset(&data, 0, sizeof(struct mmc_data)); | ||
141 | 140 | ||
142 | mrq.cmd = &cmd; | 141 | mrq.cmd = &cmd; |
143 | mrq.data = &data; | 142 | mrq.data = &data; |