Re: [PATCH (mmc-next) 3/3] mmc: fix a warning when compile the sdhci d.d.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 23, 2010 at 11:14:26AM +0200, Giuseppe CAVALLARO wrote:
> This patch fixes a warning when compile the sdhci:
>   pwr may be used uninitialized in sdhci_set_power
> Also removes some include files that live in sdhci.h
> header file.
> 
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@xxxxxx>

Okay for the set_power-part (what compiler are you using? Newer one
should detect that BUG never returns). The include-removal could be in a
seperate patch, not sure if it is worth, though.

> ---
>  drivers/mmc/host/sdhci.c |   11 ++---------
>  1 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 5928b0a..058dacd 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -18,13 +18,8 @@
>  #include <linux/io.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/slab.h>
> -#include <linux/scatterlist.h>
>  #include <linux/regulator/consumer.h>
>  
> -#include <linux/leds.h>
> -
> -#include <linux/mmc/host.h>
> -
>  #include "sdhci.h"
>  
>  #define DRIVER_NAME "sdhci"
> @@ -1050,11 +1045,9 @@ out:
>  
>  static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
>  {
> -	u8 pwr;
> +	u8 pwr = 0;
>  
> -	if (power == (unsigned short)-1)
> -		pwr = 0;
> -	else {
> +	if (power != (unsigned short)-1) {
>  		switch (1 << power) {
>  		case MMC_VDD_165_195:
>  			pwr = SDHCI_POWER_180;
> -- 
> 1.5.5.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux