[PATCH V1] mmc: sdhci-uhs2: remove unnecessary variables

Victor Shih posted 1 patch 3 weeks, 4 days ago
drivers/mmc/host/sdhci-uhs2.c | 25 -------------------------
1 file changed, 25 deletions(-)
[PATCH V1] mmc: sdhci-uhs2: remove unnecessary variables
Posted by Victor Shih 3 weeks, 4 days ago
From: Victor Shih <victor.shih@genesyslogic.com.tw>

There are unnecessary variables in the sdhci_uhs2_send_command()
that will generate a warning when building the kernel.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410252107.y9EgrTbA-lkp@intel.com/
Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>
---
 drivers/mmc/host/sdhci-uhs2.c | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
index c488c6d56015..43820eb5a7ea 100644
--- a/drivers/mmc/host/sdhci-uhs2.c
+++ b/drivers/mmc/host/sdhci-uhs2.c
@@ -684,7 +684,6 @@ static void __sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_comman
 
 static bool sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 {
-	int flags;
 	u32 mask;
 	unsigned long timeout;
 
@@ -714,30 +713,6 @@ static bool sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_command
 
 	sdhci_uhs2_set_transfer_mode(host, cmd);
 
-	if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) {
-		WARN_ONCE(1, "Unsupported response type!\n");
-		/*
-		 * This does not happen in practice because 136-bit response
-		 * commands never have busy waiting, so rather than complicate
-		 * the error path, just remove busy waiting and continue.
-		 */
-		cmd->flags &= ~MMC_RSP_BUSY;
-	}
-
-	if (!(cmd->flags & MMC_RSP_PRESENT))
-		flags = SDHCI_CMD_RESP_NONE;
-	else if (cmd->flags & MMC_RSP_136)
-		flags = SDHCI_CMD_RESP_LONG;
-	else if (cmd->flags & MMC_RSP_BUSY)
-		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-	else
-		flags = SDHCI_CMD_RESP_SHORT;
-
-	if (cmd->flags & MMC_RSP_CRC)
-		flags |= SDHCI_CMD_CRC;
-	if (cmd->flags & MMC_RSP_OPCODE)
-		flags |= SDHCI_CMD_INDEX;
-
 	timeout = jiffies;
 	if (host->data_timeout)
 		timeout += nsecs_to_jiffies(host->data_timeout);
-- 
2.25.1
Re: [PATCH V1] mmc: sdhci-uhs2: remove unnecessary variables
Posted by Ulf Hansson 3 weeks, 3 days ago
On Wed, 30 Oct 2024 at 12:22, Victor Shih <victorshihgli@gmail.com> wrote:
>
> From: Victor Shih <victor.shih@genesyslogic.com.tw>
>
> There are unnecessary variables in the sdhci_uhs2_send_command()
> that will generate a warning when building the kernel.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202410252107.y9EgrTbA-lkp@intel.com/
> Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
> Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-uhs2.c | 25 -------------------------
>  1 file changed, 25 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
> index c488c6d56015..43820eb5a7ea 100644
> --- a/drivers/mmc/host/sdhci-uhs2.c
> +++ b/drivers/mmc/host/sdhci-uhs2.c
> @@ -684,7 +684,6 @@ static void __sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_comman
>
>  static bool sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>  {
> -       int flags;
>         u32 mask;
>         unsigned long timeout;
>
> @@ -714,30 +713,6 @@ static bool sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_command
>
>         sdhci_uhs2_set_transfer_mode(host, cmd);
>
> -       if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) {
> -               WARN_ONCE(1, "Unsupported response type!\n");
> -               /*
> -                * This does not happen in practice because 136-bit response
> -                * commands never have busy waiting, so rather than complicate
> -                * the error path, just remove busy waiting and continue.
> -                */
> -               cmd->flags &= ~MMC_RSP_BUSY;
> -       }
> -
> -       if (!(cmd->flags & MMC_RSP_PRESENT))
> -               flags = SDHCI_CMD_RESP_NONE;
> -       else if (cmd->flags & MMC_RSP_136)
> -               flags = SDHCI_CMD_RESP_LONG;
> -       else if (cmd->flags & MMC_RSP_BUSY)
> -               flags = SDHCI_CMD_RESP_SHORT_BUSY;
> -       else
> -               flags = SDHCI_CMD_RESP_SHORT;
> -
> -       if (cmd->flags & MMC_RSP_CRC)
> -               flags |= SDHCI_CMD_CRC;
> -       if (cmd->flags & MMC_RSP_OPCODE)
> -               flags |= SDHCI_CMD_INDEX;
> -
>         timeout = jiffies;
>         if (host->data_timeout)
>                 timeout += nsecs_to_jiffies(host->data_timeout);
> --
> 2.25.1
>
Re: [PATCH V1] mmc: sdhci-uhs2: remove unnecessary variables
Posted by Adrian Hunter 3 weeks, 4 days ago
On 30/10/24 13:22, Victor Shih wrote:
> From: Victor Shih <victor.shih@genesyslogic.com.tw>
> 
> There are unnecessary variables in the sdhci_uhs2_send_command()
> that will generate a warning when building the kernel.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202410252107.y9EgrTbA-lkp@intel.com/
> Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>
> Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-uhs2.c | 25 -------------------------
>  1 file changed, 25 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
> index c488c6d56015..43820eb5a7ea 100644
> --- a/drivers/mmc/host/sdhci-uhs2.c
> +++ b/drivers/mmc/host/sdhci-uhs2.c
> @@ -684,7 +684,6 @@ static void __sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_comman
>  
>  static bool sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_command *cmd)
>  {
> -	int flags;
>  	u32 mask;
>  	unsigned long timeout;
>  
> @@ -714,30 +713,6 @@ static bool sdhci_uhs2_send_command(struct sdhci_host *host, struct mmc_command
>  
>  	sdhci_uhs2_set_transfer_mode(host, cmd);
>  
> -	if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) {
> -		WARN_ONCE(1, "Unsupported response type!\n");
> -		/*
> -		 * This does not happen in practice because 136-bit response
> -		 * commands never have busy waiting, so rather than complicate
> -		 * the error path, just remove busy waiting and continue.
> -		 */
> -		cmd->flags &= ~MMC_RSP_BUSY;
> -	}
> -
> -	if (!(cmd->flags & MMC_RSP_PRESENT))
> -		flags = SDHCI_CMD_RESP_NONE;
> -	else if (cmd->flags & MMC_RSP_136)
> -		flags = SDHCI_CMD_RESP_LONG;
> -	else if (cmd->flags & MMC_RSP_BUSY)
> -		flags = SDHCI_CMD_RESP_SHORT_BUSY;
> -	else
> -		flags = SDHCI_CMD_RESP_SHORT;
> -
> -	if (cmd->flags & MMC_RSP_CRC)
> -		flags |= SDHCI_CMD_CRC;
> -	if (cmd->flags & MMC_RSP_OPCODE)
> -		flags |= SDHCI_CMD_INDEX;
> -
>  	timeout = jiffies;
>  	if (host->data_timeout)
>  		timeout += nsecs_to_jiffies(host->data_timeout);