aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc_ops.c
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2011-04-13 23:49:45 -0400
committerChris Ball <cjb@laptop.org>2011-05-24 21:02:01 -0400
commit24f5b53ba076e983bc64fa48534ca795d7813d51 (patch)
tree6ae546b6443ec6f28694a9688fdd79da633c57b7 /drivers/mmc/core/mmc_ops.c
parenta61ad2b49bfce94dfddce828cd9222e4b9e7825b (diff)
mmc: initialize struct mmc_request at declaration time
Converts from: struct mmc_request mrq; memset(&mrq, 0, sizeof(struct mmc_request)); to: struct mmc_request mrq = {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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 1ed3866e990f..845ce7c533b9 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -233,7 +233,7 @@ static int
233mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, 233mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
234 u32 opcode, void *buf, unsigned len) 234 u32 opcode, void *buf, unsigned len)
235{ 235{
236 struct mmc_request mrq; 236 struct mmc_request mrq = {0};
237 struct mmc_command cmd = {0}; 237 struct mmc_command cmd = {0};
238 struct mmc_data data = {0}; 238 struct mmc_data data = {0};
239 struct scatterlist sg; 239 struct scatterlist sg;
@@ -246,8 +246,6 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
246 if (data_buf == NULL) 246 if (data_buf == NULL)
247 return -ENOMEM; 247 return -ENOMEM;
248 248
249 memset(&mrq, 0, sizeof(struct mmc_request));
250
251 mrq.cmd = &cmd; 249 mrq.cmd = &cmd;
252 mrq.data = &data; 250 mrq.data = &data;
253 251
@@ -456,7 +454,7 @@ static int
456mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode, 454mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode,
457 u8 len) 455 u8 len)
458{ 456{
459 struct mmc_request mrq; 457 struct mmc_request mrq = {0};
460 struct mmc_command cmd = {0}; 458 struct mmc_command cmd = {0};
461 struct mmc_data data = {0}; 459 struct mmc_data data = {0};
462 struct scatterlist sg; 460 struct scatterlist sg;
@@ -487,8 +485,6 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode,
487 if (opcode == MMC_BUS_TEST_W) 485 if (opcode == MMC_BUS_TEST_W)
488 memcpy(data_buf, test_buf, len); 486 memcpy(data_buf, test_buf, len);
489 487
490 memset(&mrq, 0, sizeof(struct mmc_request));
491
492 mrq.cmd = &cmd; 488 mrq.cmd = &cmd;
493 mrq.data = &data; 489 mrq.data = &data;
494 cmd.opcode = opcode; 490 cmd.opcode = opcode;