staging: mt7621-mmc: Fix ret.cooci warnings
authorBhanusree Pola <bhanusreemahesh@gmail.com>
Sun, 17 Mar 2019 11:01:33 +0000 (16:31 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Mar 2019 06:47:53 +0000 (07:47 +0100)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-mmc/sd.c

index 4b26ec896a96f77f1ffef78c0922342027a3e3dd..8857cdb9dafd0ee604323f24ca91b9d07579c590 100644 (file)
@@ -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)