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/block.c | |
parent | 1278dba167f01bb3c6626d16450d31129d041087 (diff) | |
download | linux-a61ad2b49bfce94dfddce828cd9222e4b9e7825b.tar.gz linux-a61ad2b49bfce94dfddce828cd9222e4b9e7825b.tar.bz2 linux-a61ad2b49bfce94dfddce828cd9222e4b9e7825b.zip |
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/block.c')
-rw-r--r-- | drivers/mmc/card/block.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 93a7efcbfde9..fb387c803205 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -261,7 +261,7 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) struct mmc_request mrq; struct mmc_command cmd = {0}; - struct mmc_data data; + struct mmc_data data = {0}; unsigned int timeout_us; struct scatterlist sg; @@ -282,8 +282,6 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) cmd.arg = 0; cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; - memset(&data, 0, sizeof(struct mmc_data)); - data.timeout_ns = card->csd.tacc_ns * 100; data.timeout_clks = card->csd.tacc_clks * 100; |