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>
This commit is contained in:
Chris Ball
2011-04-13 23:46:05 -04:00
parent 1278dba167
commit a61ad2b49b
5 changed files with 10 additions and 21 deletions

View File

@@ -235,7 +235,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
{
struct mmc_request mrq;
struct mmc_command cmd = {0};
struct mmc_data data;
struct mmc_data data = {0};
struct scatterlist sg;
void *data_buf;
@@ -247,7 +247,6 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
return -ENOMEM;
memset(&mrq, 0, sizeof(struct mmc_request));
memset(&data, 0, sizeof(struct mmc_data));
mrq.cmd = &cmd;
mrq.data = &data;
@@ -459,7 +458,7 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode,
{
struct mmc_request mrq;
struct mmc_command cmd = {0};
struct mmc_data data;
struct mmc_data data = {0};
struct scatterlist sg;
u8 *data_buf;
u8 *test_buf;
@@ -489,7 +488,6 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode,
memcpy(data_buf, test_buf, len);
memset(&mrq, 0, sizeof(struct mmc_request));
memset(&data, 0, sizeof(struct mmc_data));
mrq.cmd = &cmd;
mrq.data = &data;