All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Staging: mt7621-mmc: Remove ret.cocci warnings
@ 2019-03-17  3:13 Bhanusree Pola
  2019-03-17  3:13 ` [PATCH v4 1/2] Staging: mt7621-mmc: Fix ret.cooci warnings Bhanusree Pola
  2019-03-17  3:13 ` [PATCH v4 2/2] Staging: mt7621-mmc: Modify the return type for all possible values Bhanusree Pola
  0 siblings, 2 replies; 4+ messages in thread
From: Bhanusree Pola @ 2019-03-17  3:13 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman, Matthias Brugger

This patch series does the following:
[PATCH 1/2]:clears the ret.cocci warnings and removes unused locl
variables.
[PATCH 2/2]:Modifies the data type of the function for all possible
values.

v2:
 -dropped patch series and did all the changes in same patch as the
first patch introduced the problem.
-Commit log modified.

v3:
 PATCH[1/2] Commit log modified.
 PATCH[2/2] included to modify the data type of the function for all possible
values by maintaing the alignment of parenthesis.

v4:
 PATCH[2/2] commit log modified.

Bhanusree Pola (2):
  Staging: mt7621-mmc: Fix ret.cooci warnings
  Staging: mt7621-mmc: Modify the return type for all possible values

 drivers/staging/mt7621-mmc/sd.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v4 1/2] Staging: mt7621-mmc: Fix ret.cooci warnings
  2019-03-17  3:13 [PATCH v4 0/2] Staging: mt7621-mmc: Remove ret.cocci warnings Bhanusree Pola
@ 2019-03-17  3:13 ` Bhanusree Pola
  2019-03-17  3:13 ` [PATCH v4 2/2] Staging: mt7621-mmc: Modify the return type for all possible values Bhanusree Pola
  1 sibling, 0 replies; 4+ messages in thread
From: Bhanusree Pola @ 2019-03-17  3:13 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman, Matthias Brugger

Return the value directly instead of storing it in local variable err.
Remove the unused local variable err.
The semantic patch that fixes the first part of the problem is as follows

// <smpl>
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;
// </smpl>

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 4b26ec896a96..8857cdb9dafd 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -752,7 +752,6 @@ static int msdc_app_cmd(struct mmc_host *mmc, struct msdc_host *host)
 {
 	struct mmc_command cmd;
 	struct mmc_request mrq;
-	u32 err;
 
 	memset(&cmd, 0, sizeof(struct mmc_command));
 	cmd.opcode = MMC_APP_CMD;
@@ -763,8 +762,7 @@ static int msdc_app_cmd(struct mmc_host *mmc, struct msdc_host *host)
 	mrq.cmd = &cmd; cmd.mrq = &mrq;
 	cmd.data = NULL;
 
-	err = msdc_do_command(host, &cmd, 0, CMD_TIMEOUT);
-	return err;
+	return msdc_do_command(host, &cmd, 0, CMD_TIMEOUT);
 }
 
 static int msdc_tune_cmdrsp(struct msdc_host *host, struct mmc_command *cmd)
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v4 2/2] Staging: mt7621-mmc: Modify the return type for all possible values
  2019-03-17  3:13 [PATCH v4 0/2] Staging: mt7621-mmc: Remove ret.cocci warnings Bhanusree Pola
  2019-03-17  3:13 ` [PATCH v4 1/2] Staging: mt7621-mmc: Fix ret.cooci warnings Bhanusree Pola
@ 2019-03-17  3:13 ` Bhanusree Pola
  2019-03-17 10:19   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Bhanusree Pola @ 2019-03-17  3:13 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman, Matthias Brugger

Modify the return type of the function msdc_do_command to static int
as the member error of the structure struct mmc_command is of type int.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 drivers/staging/mt7621-mmc/sd.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 8857cdb9dafd..049b312131a9 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -168,10 +168,10 @@ static u32 hclks[] = {50000000}; /* +/- by chhung */
 #define PHYSADDR(a)             ((a) & 0x1fffffff)
 #endif
 /* end of +++ */
-static unsigned int msdc_do_command(struct msdc_host   *host,
-				    struct mmc_command *cmd,
-				    int                 tune,
-				    unsigned long       timeout);
+static int msdc_do_command(struct msdc_host   *host,
+		           struct mmc_command *cmd,
+			   int                 tune,
+		           unsigned long       timeout);
 
 static int msdc_tune_cmdrsp(struct msdc_host *host, struct mmc_command *cmd);
 
@@ -535,10 +535,10 @@ static unsigned int msdc_command_resp(struct msdc_host   *host,
 	return cmd->error;
 }
 
-static unsigned int msdc_do_command(struct msdc_host   *host,
-				    struct mmc_command *cmd,
-				    int                 tune,
-				    unsigned long       timeout)
+static int msdc_do_command(struct msdc_host   *host,
+			   struct mmc_command *cmd,
+			   int                 tune,
+		           unsigned long       timeout)
 {
 	if (msdc_command_start(host, cmd, timeout))
 		goto end;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4 2/2] Staging: mt7621-mmc: Modify the return type for all possible values
  2019-03-17  3:13 ` [PATCH v4 2/2] Staging: mt7621-mmc: Modify the return type for all possible values Bhanusree Pola
@ 2019-03-17 10:19   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-03-17 10:19 UTC (permalink / raw)
  To: Bhanusree Pola; +Cc: outreachy-kernel, Matthias Brugger

On Sun, Mar 17, 2019 at 08:43:31AM +0530, Bhanusree Pola wrote:
> Modify the return type of the function msdc_do_command to static int
> as the member error of the structure struct mmc_command is of type int.

This looks good, but I do not understand the subject line.  What does
"for all possible values" have to do with the change you made here?

Please fix it up to match the changelog text here.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-17 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-17  3:13 [PATCH v4 0/2] Staging: mt7621-mmc: Remove ret.cocci warnings Bhanusree Pola
2019-03-17  3:13 ` [PATCH v4 1/2] Staging: mt7621-mmc: Fix ret.cooci warnings Bhanusree Pola
2019-03-17  3:13 ` [PATCH v4 2/2] Staging: mt7621-mmc: Modify the return type for all possible values Bhanusree Pola
2019-03-17 10:19   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.