All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: fix the wrong type of curr
@ 2014-08-01  6:00 Chuanxiao Dong
  2014-08-13  2:18 ` Dong, Chuanxiao
  2014-08-13 14:44 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Chuanxiao Dong @ 2014-08-01  6:00 UTC (permalink / raw)
  To: linux-mmc, cjb, ulf.hansson

curr should use signed type since it will contain the returned
value which is possible to be a negative value. Using u32 will
make the returned value to be true even there is a negative result.
Change to use int instead of u32

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
 drivers/mmc/host/sdhci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 47055f3..c026ec8 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3078,7 +3078,7 @@ int sdhci_add_host(struct sdhci_host *host)
 	 */
 	max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
 	if (!max_current_caps && host->vmmc) {
-		u32 curr = regulator_get_current_limit(host->vmmc);
+		int curr = regulator_get_current_limit(host->vmmc);
 		if (curr > 0) {
 
 			/* convert to SDHCI_MAX_CURRENT format */
-- 
1.7.10.4

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

* RE: [PATCH] mmc: sdhci: fix the wrong type of curr
  2014-08-01  6:00 [PATCH] mmc: sdhci: fix the wrong type of curr Chuanxiao Dong
@ 2014-08-13  2:18 ` Dong, Chuanxiao
  2014-08-13 14:44 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Dong, Chuanxiao @ 2014-08-13  2:18 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson, Chris Ball

Hello,

Any feedback on this fix?

Thanks
Chuanxiao

> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org
> [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Chuanxiao Dong
> Sent: Friday, August 01, 2014 2:00 PM
> To: linux-mmc@vger.kernel.org; cjb@laptop.org; ulf.hansson@linaro.org
> Subject: [PATCH] mmc: sdhci: fix the wrong type of curr
> 
> curr should use signed type since it will contain the returned value which is
> possible to be a negative value. Using u32 will make the returned value to be
> true even there is a negative result.
> Change to use int instead of u32
> 
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> ---
>  drivers/mmc/host/sdhci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
> 47055f3..c026ec8 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3078,7 +3078,7 @@ int sdhci_add_host(struct sdhci_host *host)
>  	 */
>  	max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
>  	if (!max_current_caps && host->vmmc) {
> -		u32 curr = regulator_get_current_limit(host->vmmc);
> +		int curr = regulator_get_current_limit(host->vmmc);
>  		if (curr > 0) {
> 
>  			/* convert to SDHCI_MAX_CURRENT format */
> --
> 1.7.10.4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body
> of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] mmc: sdhci: fix the wrong type of curr
  2014-08-01  6:00 [PATCH] mmc: sdhci: fix the wrong type of curr Chuanxiao Dong
  2014-08-13  2:18 ` Dong, Chuanxiao
@ 2014-08-13 14:44 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2014-08-13 14:44 UTC (permalink / raw)
  To: Chuanxiao Dong; +Cc: linux-mmc, Chris Ball

On 1 August 2014 08:00, Chuanxiao Dong <chuanxiao.dong@intel.com> wrote:
> curr should use signed type since it will contain the returned
> value which is possible to be a negative value. Using u32 will
> make the returned value to be true even there is a negative result.
> Change to use int instead of u32
>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>

Thanks! Queued for 3.18.

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 47055f3..c026ec8 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3078,7 +3078,7 @@ int sdhci_add_host(struct sdhci_host *host)
>          */
>         max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
>         if (!max_current_caps && host->vmmc) {
> -               u32 curr = regulator_get_current_limit(host->vmmc);
> +               int curr = regulator_get_current_limit(host->vmmc);
>                 if (curr > 0) {
>
>                         /* convert to SDHCI_MAX_CURRENT format */
> --
> 1.7.10.4

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

end of thread, other threads:[~2014-08-13 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01  6:00 [PATCH] mmc: sdhci: fix the wrong type of curr Chuanxiao Dong
2014-08-13  2:18 ` Dong, Chuanxiao
2014-08-13 14:44 ` Ulf Hansson

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.