Re: [PATCH RESEND 1/1] usb: phy: mxs: declare variable with initialized value

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

 



On Thu, Jan 21, 2016 at 03:51:26PM +0800, Li Jun wrote:
> Initialize vbus_value to be 0 since it's possible not to assign
> any value before judgement.
> 
> Signed-off-by: Li Jun <jun.li@xxxxxxx>
> 
> diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
> index c2936dc..00bfea0 100644
> --- a/drivers/usb/phy/phy-mxs-usb.c
> +++ b/drivers/usb/phy/phy-mxs-usb.c
> @@ -220,7 +220,7 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
>  /* Return true if the vbus is there */
>  static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy)
>  {
> -	unsigned int vbus_value;
> +	unsigned int vbus_value = 0;
>  
>  	if (!mxs_phy->regmap_anatop)
>  		return false;
> -- 
> 1.9.1

Acked-by: Peter Chen <peter.chen@xxxxxxx>

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux