diff mbox

[1/3] usb: phy: msm: cast to unsigned long int

Message ID 1398875916-14461-1-git-send-email-balbi@ti.com
State New
Headers show

Commit Message

Felipe Balbi April 30, 2014, 4:38 p.m. UTC
this solves the following build warning found when
running compile tests.

drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
	to integer of different size [-Wpointer-to-int-cast]
  pdata->phy_type = (int) id->data;
                    ^
Signed-off-by: Felipe Balbi <balbi@ti.com>
---

all patches are on top of Ivan's 20 patch series.

 drivers/usb/phy/phy-msm-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ivan T. Ivanov May 3, 2014, 6:56 a.m. UTC | #1
On Wed, 2014-04-30 at 11:38 -0500, Felipe Balbi wrote:
> this solves the following build warning found when
> running compile tests.
> 
> drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
> drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
> 	to integer of different size [-Wpointer-to-int-cast]
>   pdata->phy_type = (int) id->data;
>                     ^
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
> 
> all patches are on top of Ivan's 20 patch series.
> 
>  drivers/usb/phy/phy-msm-usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index 9dc7918..c9963c8 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
>  	motg->pdata = pdata;
>  
>  	id = of_match_device(msm_otg_dt_match, &pdev->dev);
> -	pdata->phy_type = (int) id->data;
> +	pdata->phy_type = (unsigned long int) id->data;

Probably cast to enum msm_usb_phy_type will be better.

Regards,
Ivan

>  
>  	motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
>  	if (IS_ERR(motg->link_rst))


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi May 5, 2014, 3:03 p.m. UTC | #2
On Sat, May 03, 2014 at 09:56:32AM +0300, Ivan T. Ivanov wrote:
> On Wed, 2014-04-30 at 11:38 -0500, Felipe Balbi wrote:
> > this solves the following build warning found when
> > running compile tests.
> > 
> > drivers/usb/phy/phy-msm-usb.c: In function ‘msm_otg_read_dt’:
> > drivers/usb/phy/phy-msm-usb.c:1459:20: warning: cast from pointer \
> > 	to integer of different size [-Wpointer-to-int-cast]
> >   pdata->phy_type = (int) id->data;
> >                     ^
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> > 
> > all patches are on top of Ivan's 20 patch series.
> > 
> >  drivers/usb/phy/phy-msm-usb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> > index 9dc7918..c9963c8 100644
> > --- a/drivers/usb/phy/phy-msm-usb.c
> > +++ b/drivers/usb/phy/phy-msm-usb.c
> > @@ -1456,7 +1456,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
> >  	motg->pdata = pdata;
> >  
> >  	id = of_match_device(msm_otg_dt_match, &pdev->dev);
> > -	pdata->phy_type = (int) id->data;
> > +	pdata->phy_type = (unsigned long int) id->data;
> 
> Probably cast to enum msm_usb_phy_type will be better.

will do.
diff mbox

Patch

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 9dc7918..c9963c8 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1456,7 +1456,7 @@  static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 	motg->pdata = pdata;
 
 	id = of_match_device(msm_otg_dt_match, &pdev->dev);
-	pdata->phy_type = (int) id->data;
+	pdata->phy_type = (unsigned long int) id->data;
 
 	motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
 	if (IS_ERR(motg->link_rst))