diff options
author | Chris Ball <cjb@laptop.org> | 2011-04-14 03:46:05 (GMT) |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-25 01:01:56 (GMT) |
commit | a61ad2b49bfce94dfddce828cd9222e4b9e7825b (patch) | |
tree | 36f93e61adc7c7d7523c78c78c3df1e75fae5e33 /drivers/mmc/card/block.c | |
parent | 1278dba167f01bb3c6626d16450d31129d041087 (diff) | |
download | linux-fsl-qoriq-a61ad2b49bfce94dfddce828cd9222e4b9e7825b.tar.xz |
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 93a7efc..fb387c8 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; |