Skip to contentSkip to conversation

mmc: sd: Cleanup redundant memset

PATCH In review Mark Asselstine 2 participants 4 messages Apr 8, 2010 – Apr 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sd: Cleanup redundant memset

The clearing of mrq via a memset at the top of the for loop in mmc_wait_for_app_cmd() is not required as mrq is not used and there is another clearing of mrq just below. We remove the first memset since if the initial tests in the for loop fail the memset is not required.

---
 drivers/mmc/core/sd_ops.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/mmc/core/sd_ops.c +0 -2
index 0d96080..63772e7 100644
@@ -79,8 +79,6 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
 	 * we cannot use the retries field in mmc_command.
 	 */
 	for (i = 0;i <= retries;i++) {
-		memset(&mrq, 0, sizeof(struct mmc_request));
-
 		err = mmc_app_cmd(host, card);
 		if (err) {
 			/* no point in retrying; no APP commands allowed */
Signature · 1 line
1.7.0
#1 lore raw

PATCH 1/1 mmc: sd: Cleanup redundant memset

The clearing of mrq via a memset at the top of the for loop in mmc_wait_for_app_cmd() is not required as mrq is not used and there is another clearing of mrq just below. We remove the first memset since if the initial tests in the for loop fail the memset is not required.

---
Resending to [email protected] and [email protected] since MMC/SD is an orphan so hopefully including these folks will allow someone to pick this patch up.

 drivers/mmc/core/sd_ops.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/mmc/core/sd_ops.c +0 -2
index 0d96080..63772e7 100644
@@ -79,8 +79,6 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
 	 * we cannot use the retries field in mmc_command.
 	 */
 	for (i = 0;i <= retries;i++) {
-		memset(&mrq, 0, sizeof(struct mmc_request));
-
 		err = mmc_app_cmd(host, card);
 		if (err) {
 			/* no point in retrying; no APP commands allowed */
Signature · 1 line
1.7.0
#2 lore raw
In reply to Mark Asselstine
Quoted 6 lines · Mark Asselstine

The clearing of mrq via a memset at the top of the for loop in mmc_wait_for_app_cmd() is not required as mrq is not used and there is another clearing of mrq just below. We remove the first memset since if the initial tests in the for loop fail the memset is not required.

This patch is good.

MMC is orphan, but there is a mailing list.

Does anyone on kernel-janitors actually collect patches? Otherwise if you send this to lkml Andrew Morton quite often picks these up.

regards,
dan carpenter

Quoted 25 lines
---
 drivers/mmc/core/sd_ops.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/mmc/core/sd_ops.c +0 -2
index 0d96080..63772e7 100644
@@ -79,8 +79,6 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
 	 * we cannot use the retries field in mmc_command.
 	 */
 	for (i = 0;i <= retries;i++) {
-		memset(&mrq, 0, sizeof(struct mmc_request));
-
 		err = mmc_app_cmd(host, card);
 		if (err) {
 			/* no point in retrying; no APP commands allowed */
Signature · 6 lines
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
In reply to Mark Asselstine
Quoted 8 lines · Dan Carpenter
Quoted 6 lines · Mark Asselstine

The clearing of mrq via a memset at the top of the for loop in mmc_wait_for_app_cmd() is not required as mrq is not used and there is another clearing of mrq just below. We remove the first memset since if the initial tests in the for loop fail the memset is not required.

Quoted 6 lines

This patch is good.

MMC is orphan, but there is a mailing list.

Does anyone on kernel-janitors actually collect patches?  Otherwise if you send this to lkml Andrew Morton quite often picks these up.

Done already. Andrew picked it up and it should be in his -mm tree now.

Mark

Quoted 25 lines

regards,
dan carpenter

Quoted 21 lines

---
 drivers/mmc/core/sd_ops.c |    2 --

 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/mmc/core/sd_ops.c +0 -3
index 0d96080..63772e7 100644
@@ -79,8 +79,6 @@ int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
        * we cannot use the retries field in mmc_command.
        */
       for (i = 0;i <= retries;i++) {
-             memset(&mrq, 0, sizeof(struct mmc_request));
-
               err = mmc_app_cmd(host, card);
               if (err) {
                       /* no point in retrying; no APP commands allowed */
--

1.7.0

Quoted 5 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html