diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-12-19 06:51:18 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-02-13 07:19:54 -0500 |
commit | c7836d1593b87cb813c58cf64e08b052ebbe2a78 (patch) | |
tree | e3eb7869a2b2cee2eecca2157213c896184b7630 | |
parent | 164b50b353908c79b551b3658e37f29182e2c0b3 (diff) |
mmc: use empty initializer list to zero-clear structures
In the MMC subsystem, we see such initializers that only clears the
first member explicitly.
For example,
struct mmc_request mrq = {NULL};
sets the first member (.sbc) to NULL explicitly. However, this is
an unstable form because we may insert a non-pointer member at the
top of the struct mmc_request in the future. (if we do so, the
compiler will spit warnings.)
So, using a designated initializer is preferred coding style. The
expression above is equivalent to:
struct mmc_request mrq = { .sbc = NULL };
Of course, this does not express our intention. We want to fill
all struct members with zeros. Please note struct members are
implicitly zero-cleared unless otherwise specified in the initializer.
After all, the most reasonable (and stable) form is:
struct mmc_request mrq = {};
Do likewise for mmc_command, mmc_data as well.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/core/block.c | 16 | ||||
-rw-r--r-- | drivers/mmc/core/core.c | 10 | ||||
-rw-r--r-- | drivers/mmc/core/mmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 44 | ||||
-rw-r--r-- | drivers/mmc/core/mmc_test.c | 26 | ||||
-rw-r--r-- | drivers/mmc/core/sd_ops.c | 30 | ||||
-rw-r--r-- | drivers/mmc/core/sdio_ops.c | 10 | ||||
-rw-r--r-- | drivers/mmc/host/rtsx_pci_sdmmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/rtsx_usb_sdmmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 4 |
10 files changed, 73 insertions, 73 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 6648a17b96c0..6adc3ce28447 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c | |||
@@ -442,9 +442,9 @@ out: | |||
442 | static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, | 442 | static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, |
443 | struct mmc_blk_ioc_data *idata) | 443 | struct mmc_blk_ioc_data *idata) |
444 | { | 444 | { |
445 | struct mmc_command cmd = {0}; | 445 | struct mmc_command cmd = {}; |
446 | struct mmc_data data = {0}; | 446 | struct mmc_data data = {}; |
447 | struct mmc_request mrq = {NULL}; | 447 | struct mmc_request mrq = {}; |
448 | struct scatterlist sg; | 448 | struct scatterlist sg; |
449 | int err; | 449 | int err; |
450 | int is_rpmb = false; | 450 | int is_rpmb = false; |
@@ -768,9 +768,9 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) | |||
768 | u32 result; | 768 | u32 result; |
769 | __be32 *blocks; | 769 | __be32 *blocks; |
770 | 770 | ||
771 | struct mmc_request mrq = {NULL}; | 771 | struct mmc_request mrq = {}; |
772 | struct mmc_command cmd = {0}; | 772 | struct mmc_command cmd = {}; |
773 | struct mmc_data data = {0}; | 773 | struct mmc_data data = {}; |
774 | 774 | ||
775 | struct scatterlist sg; | 775 | struct scatterlist sg; |
776 | 776 | ||
@@ -819,7 +819,7 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) | |||
819 | 819 | ||
820 | static int get_card_status(struct mmc_card *card, u32 *status, int retries) | 820 | static int get_card_status(struct mmc_card *card, u32 *status, int retries) |
821 | { | 821 | { |
822 | struct mmc_command cmd = {0}; | 822 | struct mmc_command cmd = {}; |
823 | int err; | 823 | int err; |
824 | 824 | ||
825 | cmd.opcode = MMC_SEND_STATUS; | 825 | cmd.opcode = MMC_SEND_STATUS; |
@@ -884,7 +884,7 @@ static int send_stop(struct mmc_card *card, unsigned int timeout_ms, | |||
884 | struct request *req, bool *gen_err, u32 *stop_status) | 884 | struct request *req, bool *gen_err, u32 *stop_status) |
885 | { | 885 | { |
886 | struct mmc_host *host = card->host; | 886 | struct mmc_host *host = card->host; |
887 | struct mmc_command cmd = {0}; | 887 | struct mmc_command cmd = {}; |
888 | int err; | 888 | int err; |
889 | bool use_r1b_resp = rq_data_dir(req) == WRITE; | 889 | bool use_r1b_resp = rq_data_dir(req) == WRITE; |
890 | 890 | ||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 1076b9d89df3..3b34a751eea1 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -807,7 +807,7 @@ EXPORT_SYMBOL(mmc_interrupt_hpi); | |||
807 | */ | 807 | */ |
808 | int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries) | 808 | int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries) |
809 | { | 809 | { |
810 | struct mmc_request mrq = {NULL}; | 810 | struct mmc_request mrq = {}; |
811 | 811 | ||
812 | WARN_ON(!host->claimed); | 812 | WARN_ON(!host->claimed); |
813 | 813 | ||
@@ -1648,7 +1648,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) | |||
1648 | 1648 | ||
1649 | int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) | 1649 | int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, u32 ocr) |
1650 | { | 1650 | { |
1651 | struct mmc_command cmd = {0}; | 1651 | struct mmc_command cmd = {}; |
1652 | int err = 0; | 1652 | int err = 0; |
1653 | u32 clock; | 1653 | u32 clock; |
1654 | 1654 | ||
@@ -2129,7 +2129,7 @@ static unsigned int mmc_erase_timeout(struct mmc_card *card, | |||
2129 | static int mmc_do_erase(struct mmc_card *card, unsigned int from, | 2129 | static int mmc_do_erase(struct mmc_card *card, unsigned int from, |
2130 | unsigned int to, unsigned int arg) | 2130 | unsigned int to, unsigned int arg) |
2131 | { | 2131 | { |
2132 | struct mmc_command cmd = {0}; | 2132 | struct mmc_command cmd = {}; |
2133 | unsigned int qty = 0, busy_timeout = 0; | 2133 | unsigned int qty = 0, busy_timeout = 0; |
2134 | bool use_r1b_resp = false; | 2134 | bool use_r1b_resp = false; |
2135 | unsigned long timeout; | 2135 | unsigned long timeout; |
@@ -2551,7 +2551,7 @@ EXPORT_SYMBOL(mmc_calc_max_discard); | |||
2551 | 2551 | ||
2552 | int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen) | 2552 | int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen) |
2553 | { | 2553 | { |
2554 | struct mmc_command cmd = {0}; | 2554 | struct mmc_command cmd = {}; |
2555 | 2555 | ||
2556 | if (mmc_card_blockaddr(card) || mmc_card_ddr52(card) || | 2556 | if (mmc_card_blockaddr(card) || mmc_card_ddr52(card) || |
2557 | mmc_card_hs400(card) || mmc_card_hs400es(card)) | 2557 | mmc_card_hs400(card) || mmc_card_hs400es(card)) |
@@ -2567,7 +2567,7 @@ EXPORT_SYMBOL(mmc_set_blocklen); | |||
2567 | int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | 2567 | int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, |
2568 | bool is_rel_write) | 2568 | bool is_rel_write) |
2569 | { | 2569 | { |
2570 | struct mmc_command cmd = {0}; | 2570 | struct mmc_command cmd = {}; |
2571 | 2571 | ||
2572 | cmd.opcode = MMC_SET_BLOCK_COUNT; | 2572 | cmd.opcode = MMC_SET_BLOCK_COUNT; |
2573 | cmd.arg = blockcount & 0x0000FFFF; | 2573 | cmd.arg = blockcount & 0x0000FFFF; |
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index c0e250706353..ec2e85c7ae12 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -1817,7 +1817,7 @@ static int mmc_can_sleep(struct mmc_card *card) | |||
1817 | 1817 | ||
1818 | static int mmc_sleep(struct mmc_host *host) | 1818 | static int mmc_sleep(struct mmc_host *host) |
1819 | { | 1819 | { |
1820 | struct mmc_command cmd = {0}; | 1820 | struct mmc_command cmd = {}; |
1821 | struct mmc_card *card = host->card; | 1821 | struct mmc_card *card = host->card; |
1822 | unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); | 1822 | unsigned int timeout_ms = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000); |
1823 | int err; | 1823 | int err; |
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index e6ea8503f40c..fe80f26d6971 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c | |||
@@ -57,7 +57,7 @@ static const u8 tuning_blk_pattern_8bit[] = { | |||
57 | int mmc_send_status(struct mmc_card *card, u32 *status) | 57 | int mmc_send_status(struct mmc_card *card, u32 *status) |
58 | { | 58 | { |
59 | int err; | 59 | int err; |
60 | struct mmc_command cmd = {0}; | 60 | struct mmc_command cmd = {}; |
61 | 61 | ||
62 | cmd.opcode = MMC_SEND_STATUS; | 62 | cmd.opcode = MMC_SEND_STATUS; |
63 | if (!mmc_host_is_spi(card->host)) | 63 | if (!mmc_host_is_spi(card->host)) |
@@ -79,7 +79,7 @@ int mmc_send_status(struct mmc_card *card, u32 *status) | |||
79 | 79 | ||
80 | static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card) | 80 | static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card) |
81 | { | 81 | { |
82 | struct mmc_command cmd = {0}; | 82 | struct mmc_command cmd = {}; |
83 | 83 | ||
84 | cmd.opcode = MMC_SELECT_CARD; | 84 | cmd.opcode = MMC_SELECT_CARD; |
85 | 85 | ||
@@ -115,7 +115,7 @@ int mmc_deselect_cards(struct mmc_host *host) | |||
115 | */ | 115 | */ |
116 | int mmc_set_dsr(struct mmc_host *host) | 116 | int mmc_set_dsr(struct mmc_host *host) |
117 | { | 117 | { |
118 | struct mmc_command cmd = {0}; | 118 | struct mmc_command cmd = {}; |
119 | 119 | ||
120 | cmd.opcode = MMC_SET_DSR; | 120 | cmd.opcode = MMC_SET_DSR; |
121 | 121 | ||
@@ -128,7 +128,7 @@ int mmc_set_dsr(struct mmc_host *host) | |||
128 | int mmc_go_idle(struct mmc_host *host) | 128 | int mmc_go_idle(struct mmc_host *host) |
129 | { | 129 | { |
130 | int err; | 130 | int err; |
131 | struct mmc_command cmd = {0}; | 131 | struct mmc_command cmd = {}; |
132 | 132 | ||
133 | /* | 133 | /* |
134 | * Non-SPI hosts need to prevent chipselect going active during | 134 | * Non-SPI hosts need to prevent chipselect going active during |
@@ -164,7 +164,7 @@ int mmc_go_idle(struct mmc_host *host) | |||
164 | 164 | ||
165 | int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) | 165 | int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) |
166 | { | 166 | { |
167 | struct mmc_command cmd = {0}; | 167 | struct mmc_command cmd = {}; |
168 | int i, err = 0; | 168 | int i, err = 0; |
169 | 169 | ||
170 | cmd.opcode = MMC_SEND_OP_COND; | 170 | cmd.opcode = MMC_SEND_OP_COND; |
@@ -203,7 +203,7 @@ int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) | |||
203 | int mmc_all_send_cid(struct mmc_host *host, u32 *cid) | 203 | int mmc_all_send_cid(struct mmc_host *host, u32 *cid) |
204 | { | 204 | { |
205 | int err; | 205 | int err; |
206 | struct mmc_command cmd = {0}; | 206 | struct mmc_command cmd = {}; |
207 | 207 | ||
208 | cmd.opcode = MMC_ALL_SEND_CID; | 208 | cmd.opcode = MMC_ALL_SEND_CID; |
209 | cmd.arg = 0; | 209 | cmd.arg = 0; |
@@ -220,7 +220,7 @@ int mmc_all_send_cid(struct mmc_host *host, u32 *cid) | |||
220 | 220 | ||
221 | int mmc_set_relative_addr(struct mmc_card *card) | 221 | int mmc_set_relative_addr(struct mmc_card *card) |
222 | { | 222 | { |
223 | struct mmc_command cmd = {0}; | 223 | struct mmc_command cmd = {}; |
224 | 224 | ||
225 | cmd.opcode = MMC_SET_RELATIVE_ADDR; | 225 | cmd.opcode = MMC_SET_RELATIVE_ADDR; |
226 | cmd.arg = card->rca << 16; | 226 | cmd.arg = card->rca << 16; |
@@ -233,7 +233,7 @@ static int | |||
233 | mmc_send_cxd_native(struct mmc_host *host, u32 arg, u32 *cxd, int opcode) | 233 | mmc_send_cxd_native(struct mmc_host *host, u32 arg, u32 *cxd, int opcode) |
234 | { | 234 | { |
235 | int err; | 235 | int err; |
236 | struct mmc_command cmd = {0}; | 236 | struct mmc_command cmd = {}; |
237 | 237 | ||
238 | cmd.opcode = opcode; | 238 | cmd.opcode = opcode; |
239 | cmd.arg = arg; | 239 | cmd.arg = arg; |
@@ -256,9 +256,9 @@ static int | |||
256 | mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, | 256 | mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host, |
257 | u32 opcode, void *buf, unsigned len) | 257 | u32 opcode, void *buf, unsigned len) |
258 | { | 258 | { |
259 | struct mmc_request mrq = {NULL}; | 259 | struct mmc_request mrq = {}; |
260 | struct mmc_command cmd = {0}; | 260 | struct mmc_command cmd = {}; |
261 | struct mmc_data data = {0}; | 261 | struct mmc_data data = {}; |
262 | struct scatterlist sg; | 262 | struct scatterlist sg; |
263 | 263 | ||
264 | mrq.cmd = &cmd; | 264 | mrq.cmd = &cmd; |
@@ -387,7 +387,7 @@ EXPORT_SYMBOL_GPL(mmc_get_ext_csd); | |||
387 | 387 | ||
388 | int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp) | 388 | int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp) |
389 | { | 389 | { |
390 | struct mmc_command cmd = {0}; | 390 | struct mmc_command cmd = {}; |
391 | int err; | 391 | int err; |
392 | 392 | ||
393 | cmd.opcode = MMC_SPI_READ_OCR; | 393 | cmd.opcode = MMC_SPI_READ_OCR; |
@@ -402,7 +402,7 @@ int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp) | |||
402 | 402 | ||
403 | int mmc_spi_set_crc(struct mmc_host *host, int use_crc) | 403 | int mmc_spi_set_crc(struct mmc_host *host, int use_crc) |
404 | { | 404 | { |
405 | struct mmc_command cmd = {0}; | 405 | struct mmc_command cmd = {}; |
406 | int err; | 406 | int err; |
407 | 407 | ||
408 | cmd.opcode = MMC_SPI_CRC_ON_OFF; | 408 | cmd.opcode = MMC_SPI_CRC_ON_OFF; |
@@ -530,7 +530,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, | |||
530 | { | 530 | { |
531 | struct mmc_host *host = card->host; | 531 | struct mmc_host *host = card->host; |
532 | int err; | 532 | int err; |
533 | struct mmc_command cmd = {0}; | 533 | struct mmc_command cmd = {}; |
534 | bool use_r1b_resp = use_busy_signal; | 534 | bool use_r1b_resp = use_busy_signal; |
535 | unsigned char old_timing = host->ios.timing; | 535 | unsigned char old_timing = host->ios.timing; |
536 | 536 | ||
@@ -610,9 +610,9 @@ EXPORT_SYMBOL_GPL(mmc_switch); | |||
610 | 610 | ||
611 | int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error) | 611 | int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error) |
612 | { | 612 | { |
613 | struct mmc_request mrq = {NULL}; | 613 | struct mmc_request mrq = {}; |
614 | struct mmc_command cmd = {0}; | 614 | struct mmc_command cmd = {}; |
615 | struct mmc_data data = {0}; | 615 | struct mmc_data data = {}; |
616 | struct scatterlist sg; | 616 | struct scatterlist sg; |
617 | struct mmc_ios *ios = &host->ios; | 617 | struct mmc_ios *ios = &host->ios; |
618 | const u8 *tuning_block_pattern; | 618 | const u8 *tuning_block_pattern; |
@@ -679,7 +679,7 @@ EXPORT_SYMBOL_GPL(mmc_send_tuning); | |||
679 | 679 | ||
680 | int mmc_abort_tuning(struct mmc_host *host, u32 opcode) | 680 | int mmc_abort_tuning(struct mmc_host *host, u32 opcode) |
681 | { | 681 | { |
682 | struct mmc_command cmd = {0}; | 682 | struct mmc_command cmd = {}; |
683 | 683 | ||
684 | /* | 684 | /* |
685 | * eMMC specification specifies that CMD12 can be used to stop a tuning | 685 | * eMMC specification specifies that CMD12 can be used to stop a tuning |
@@ -706,9 +706,9 @@ static int | |||
706 | mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode, | 706 | mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode, |
707 | u8 len) | 707 | u8 len) |
708 | { | 708 | { |
709 | struct mmc_request mrq = {NULL}; | 709 | struct mmc_request mrq = {}; |
710 | struct mmc_command cmd = {0}; | 710 | struct mmc_command cmd = {}; |
711 | struct mmc_data data = {0}; | 711 | struct mmc_data data = {}; |
712 | struct scatterlist sg; | 712 | struct scatterlist sg; |
713 | u8 *data_buf; | 713 | u8 *data_buf; |
714 | u8 *test_buf; | 714 | u8 *test_buf; |
@@ -802,7 +802,7 @@ int mmc_bus_test(struct mmc_card *card, u8 bus_width) | |||
802 | 802 | ||
803 | int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) | 803 | int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status) |
804 | { | 804 | { |
805 | struct mmc_command cmd = {0}; | 805 | struct mmc_command cmd = {}; |
806 | unsigned int opcode; | 806 | unsigned int opcode; |
807 | int err; | 807 | int err; |
808 | 808 | ||
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index 3ab6e52d106c..bd8eb9bfc153 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c | |||
@@ -260,7 +260,7 @@ static int mmc_test_busy(struct mmc_command *cmd) | |||
260 | static int mmc_test_wait_busy(struct mmc_test_card *test) | 260 | static int mmc_test_wait_busy(struct mmc_test_card *test) |
261 | { | 261 | { |
262 | int ret, busy; | 262 | int ret, busy; |
263 | struct mmc_command cmd = {0}; | 263 | struct mmc_command cmd = {}; |
264 | 264 | ||
265 | busy = 0; | 265 | busy = 0; |
266 | do { | 266 | do { |
@@ -292,10 +292,10 @@ static int mmc_test_wait_busy(struct mmc_test_card *test) | |||
292 | static int mmc_test_buffer_transfer(struct mmc_test_card *test, | 292 | static int mmc_test_buffer_transfer(struct mmc_test_card *test, |
293 | u8 *buffer, unsigned addr, unsigned blksz, int write) | 293 | u8 *buffer, unsigned addr, unsigned blksz, int write) |
294 | { | 294 | { |
295 | struct mmc_request mrq = {0}; | 295 | struct mmc_request mrq = {}; |
296 | struct mmc_command cmd = {0}; | 296 | struct mmc_command cmd = {}; |
297 | struct mmc_command stop = {0}; | 297 | struct mmc_command stop = {}; |
298 | struct mmc_data data = {0}; | 298 | struct mmc_data data = {}; |
299 | 299 | ||
300 | struct scatterlist sg; | 300 | struct scatterlist sg; |
301 | 301 | ||
@@ -885,10 +885,10 @@ static int mmc_test_simple_transfer(struct mmc_test_card *test, | |||
885 | struct scatterlist *sg, unsigned sg_len, unsigned dev_addr, | 885 | struct scatterlist *sg, unsigned sg_len, unsigned dev_addr, |
886 | unsigned blocks, unsigned blksz, int write) | 886 | unsigned blocks, unsigned blksz, int write) |
887 | { | 887 | { |
888 | struct mmc_request mrq = {0}; | 888 | struct mmc_request mrq = {}; |
889 | struct mmc_command cmd = {0}; | 889 | struct mmc_command cmd = {}; |
890 | struct mmc_command stop = {0}; | 890 | struct mmc_command stop = {}; |
891 | struct mmc_data data = {0}; | 891 | struct mmc_data data = {}; |
892 | 892 | ||
893 | mrq.cmd = &cmd; | 893 | mrq.cmd = &cmd; |
894 | mrq.data = &data; | 894 | mrq.data = &data; |
@@ -910,10 +910,10 @@ static int mmc_test_simple_transfer(struct mmc_test_card *test, | |||
910 | static int mmc_test_broken_transfer(struct mmc_test_card *test, | 910 | static int mmc_test_broken_transfer(struct mmc_test_card *test, |
911 | unsigned blocks, unsigned blksz, int write) | 911 | unsigned blocks, unsigned blksz, int write) |
912 | { | 912 | { |
913 | struct mmc_request mrq = {0}; | 913 | struct mmc_request mrq = {}; |
914 | struct mmc_command cmd = {0}; | 914 | struct mmc_command cmd = {}; |
915 | struct mmc_command stop = {0}; | 915 | struct mmc_command stop = {}; |
916 | struct mmc_data data = {0}; | 916 | struct mmc_data data = {}; |
917 | 917 | ||
918 | struct scatterlist sg; | 918 | struct scatterlist sg; |
919 | 919 | ||
diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index de125a41aa7a..9d5824a37586 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c | |||
@@ -25,7 +25,7 @@ | |||
25 | int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card) | 25 | int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card) |
26 | { | 26 | { |
27 | int err; | 27 | int err; |
28 | struct mmc_command cmd = {0}; | 28 | struct mmc_command cmd = {}; |
29 | 29 | ||
30 | if (WARN_ON(card && card->host != host)) | 30 | if (WARN_ON(card && card->host != host)) |
31 | return -EINVAL; | 31 | return -EINVAL; |
@@ -68,7 +68,7 @@ EXPORT_SYMBOL_GPL(mmc_app_cmd); | |||
68 | int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card, | 68 | int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card, |
69 | struct mmc_command *cmd, int retries) | 69 | struct mmc_command *cmd, int retries) |
70 | { | 70 | { |
71 | struct mmc_request mrq = {NULL}; | 71 | struct mmc_request mrq = {}; |
72 | 72 | ||
73 | int i, err; | 73 | int i, err; |
74 | 74 | ||
@@ -120,7 +120,7 @@ EXPORT_SYMBOL(mmc_wait_for_app_cmd); | |||
120 | 120 | ||
121 | int mmc_app_set_bus_width(struct mmc_card *card, int width) | 121 | int mmc_app_set_bus_width(struct mmc_card *card, int width) |
122 | { | 122 | { |
123 | struct mmc_command cmd = {0}; | 123 | struct mmc_command cmd = {}; |
124 | 124 | ||
125 | cmd.opcode = SD_APP_SET_BUS_WIDTH; | 125 | cmd.opcode = SD_APP_SET_BUS_WIDTH; |
126 | cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; | 126 | cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; |
@@ -141,7 +141,7 @@ int mmc_app_set_bus_width(struct mmc_card *card, int width) | |||
141 | 141 | ||
142 | int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) | 142 | int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) |
143 | { | 143 | { |
144 | struct mmc_command cmd = {0}; | 144 | struct mmc_command cmd = {}; |
145 | int i, err = 0; | 145 | int i, err = 0; |
146 | 146 | ||
147 | cmd.opcode = SD_APP_OP_COND; | 147 | cmd.opcode = SD_APP_OP_COND; |
@@ -185,7 +185,7 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) | |||
185 | 185 | ||
186 | int mmc_send_if_cond(struct mmc_host *host, u32 ocr) | 186 | int mmc_send_if_cond(struct mmc_host *host, u32 ocr) |
187 | { | 187 | { |
188 | struct mmc_command cmd = {0}; | 188 | struct mmc_command cmd = {}; |
189 | int err; | 189 | int err; |
190 | static const u8 test_pattern = 0xAA; | 190 | static const u8 test_pattern = 0xAA; |
191 | u8 result_pattern; | 191 | u8 result_pattern; |
@@ -217,7 +217,7 @@ int mmc_send_if_cond(struct mmc_host *host, u32 ocr) | |||
217 | int mmc_send_relative_addr(struct mmc_host *host, unsigned int *rca) | 217 | int mmc_send_relative_addr(struct mmc_host *host, unsigned int *rca) |
218 | { | 218 | { |
219 | int err; | 219 | int err; |
220 | struct mmc_command cmd = {0}; | 220 | struct mmc_command cmd = {}; |
221 | 221 | ||
222 | cmd.opcode = SD_SEND_RELATIVE_ADDR; | 222 | cmd.opcode = SD_SEND_RELATIVE_ADDR; |
223 | cmd.arg = 0; | 223 | cmd.arg = 0; |
@@ -235,9 +235,9 @@ int mmc_send_relative_addr(struct mmc_host *host, unsigned int *rca) | |||
235 | int mmc_app_send_scr(struct mmc_card *card, u32 *scr) | 235 | int mmc_app_send_scr(struct mmc_card *card, u32 *scr) |
236 | { | 236 | { |
237 | int err; | 237 | int err; |
238 | struct mmc_request mrq = {NULL}; | 238 | struct mmc_request mrq = {}; |
239 | struct mmc_command cmd = {0}; | 239 | struct mmc_command cmd = {}; |
240 | struct mmc_data data = {0}; | 240 | struct mmc_data data = {}; |
241 | struct scatterlist sg; | 241 | struct scatterlist sg; |
242 | void *data_buf; | 242 | void *data_buf; |
243 | 243 | ||
@@ -290,9 +290,9 @@ int mmc_app_send_scr(struct mmc_card *card, u32 *scr) | |||
290 | int mmc_sd_switch(struct mmc_card *card, int mode, int group, | 290 | int mmc_sd_switch(struct mmc_card *card, int mode, int group, |
291 | u8 value, u8 *resp) | 291 | u8 value, u8 *resp) |
292 | { | 292 | { |
293 | struct mmc_request mrq = {NULL}; | 293 | struct mmc_request mrq = {}; |
294 | struct mmc_command cmd = {0}; | 294 | struct mmc_command cmd = {}; |
295 | struct mmc_data data = {0}; | 295 | struct mmc_data data = {}; |
296 | struct scatterlist sg; | 296 | struct scatterlist sg; |
297 | 297 | ||
298 | /* NOTE: caller guarantees resp is heap-allocated */ | 298 | /* NOTE: caller guarantees resp is heap-allocated */ |
@@ -332,9 +332,9 @@ int mmc_sd_switch(struct mmc_card *card, int mode, int group, | |||
332 | int mmc_app_sd_status(struct mmc_card *card, void *ssr) | 332 | int mmc_app_sd_status(struct mmc_card *card, void *ssr) |
333 | { | 333 | { |
334 | int err; | 334 | int err; |
335 | struct mmc_request mrq = {NULL}; | 335 | struct mmc_request mrq = {}; |
336 | struct mmc_command cmd = {0}; | 336 | struct mmc_command cmd = {}; |
337 | struct mmc_data data = {0}; | 337 | struct mmc_data data = {}; |
338 | struct scatterlist sg; | 338 | struct scatterlist sg; |
339 | 339 | ||
340 | /* NOTE: caller guarantees ssr is heap-allocated */ | 340 | /* NOTE: caller guarantees ssr is heap-allocated */ |
diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c index 90fe5545c677..3c0d3ab4324c 100644 --- a/drivers/mmc/core/sdio_ops.c +++ b/drivers/mmc/core/sdio_ops.c | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) | 22 | int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) |
23 | { | 23 | { |
24 | struct mmc_command cmd = {0}; | 24 | struct mmc_command cmd = {}; |
25 | int i, err = 0; | 25 | int i, err = 0; |
26 | 26 | ||
27 | cmd.opcode = SD_IO_SEND_OP_COND; | 27 | cmd.opcode = SD_IO_SEND_OP_COND; |
@@ -66,7 +66,7 @@ int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) | |||
66 | static int mmc_io_rw_direct_host(struct mmc_host *host, int write, unsigned fn, | 66 | static int mmc_io_rw_direct_host(struct mmc_host *host, int write, unsigned fn, |
67 | unsigned addr, u8 in, u8 *out) | 67 | unsigned addr, u8 in, u8 *out) |
68 | { | 68 | { |
69 | struct mmc_command cmd = {0}; | 69 | struct mmc_command cmd = {}; |
70 | int err; | 70 | int err; |
71 | 71 | ||
72 | if (fn > 7) | 72 | if (fn > 7) |
@@ -118,9 +118,9 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, | |||
118 | int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, | 118 | int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, |
119 | unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz) | 119 | unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz) |
120 | { | 120 | { |
121 | struct mmc_request mrq = {NULL}; | 121 | struct mmc_request mrq = {}; |
122 | struct mmc_command cmd = {0}; | 122 | struct mmc_command cmd = {}; |
123 | struct mmc_data data = {0}; | 123 | struct mmc_data data = {}; |
124 | struct scatterlist sg, *sg_ptr; | 124 | struct scatterlist sg, *sg_ptr; |
125 | struct sg_table sgtable; | 125 | struct sg_table sgtable; |
126 | unsigned int nents, left_size, i; | 126 | unsigned int nents, left_size, i; |
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index ecb99a8d2fa2..41b57713b620 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c | |||
@@ -707,7 +707,7 @@ static int sd_tuning_rx_cmd(struct realtek_pci_sdmmc *host, | |||
707 | u8 opcode, u8 sample_point) | 707 | u8 opcode, u8 sample_point) |
708 | { | 708 | { |
709 | int err; | 709 | int err; |
710 | struct mmc_command cmd = {0}; | 710 | struct mmc_command cmd = {}; |
711 | 711 | ||
712 | err = sd_change_phase(host, sample_point, true); | 712 | err = sd_change_phase(host, sample_point, true); |
713 | if (err < 0) | 713 | if (err < 0) |
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index dc1abd14acbc..12d2fbe9c520 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c | |||
@@ -682,7 +682,7 @@ static int sd_tuning_rx_cmd(struct rtsx_usb_sdmmc *host, | |||
682 | u8 opcode, u8 sample_point) | 682 | u8 opcode, u8 sample_point) |
683 | { | 683 | { |
684 | int err; | 684 | int err; |
685 | struct mmc_command cmd = {0}; | 685 | struct mmc_command cmd = {}; |
686 | 686 | ||
687 | err = sd_change_phase(host, sample_point, 0); | 687 | err = sd_change_phase(host, sample_point, 0); |
688 | if (err) | 688 | if (err) |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 0def99590d16..a2efa25c7f3b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -2021,8 +2021,8 @@ static void sdhci_send_tuning(struct sdhci_host *host, u32 opcode, | |||
2021 | unsigned long flags) | 2021 | unsigned long flags) |
2022 | { | 2022 | { |
2023 | struct mmc_host *mmc = host->mmc; | 2023 | struct mmc_host *mmc = host->mmc; |
2024 | struct mmc_command cmd = {0}; | 2024 | struct mmc_command cmd = {}; |
2025 | struct mmc_request mrq = {NULL}; | 2025 | struct mmc_request mrq = {}; |
2026 | 2026 | ||
2027 | cmd.opcode = opcode; | 2027 | cmd.opcode = opcode; |
2028 | cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; | 2028 | cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; |