diff mbox

[1/3] video: fbdev: vt8623fb: suppress build warning

Message ID 1417039645-5313-1-git-send-email-prabhakar.csengg@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Prabhakar Nov. 26, 2014, 10:07 p.m. UTC
this patch fixes following build warning:
drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  par->state.vgabase = (void __iomem *) vga_res.start;
                       ^
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/video/fbdev/vt8623fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomi Valkeinen Dec. 3, 2014, 11:49 a.m. UTC | #1
On 27/11/14 00:07, Lad, Prabhakar wrote:
> this patch fixes following build warning:
> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>   par->state.vgabase = (void __iomem *) vga_res.start;
>                        ^
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> ---
>  drivers/video/fbdev/vt8623fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
> index 5c7cbc6..ea7f056 100644
> --- a/drivers/video/fbdev/vt8623fb.c
> +++ b/drivers/video/fbdev/vt8623fb.c
> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  
>  	pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
>  
> -	par->state.vgabase = (void __iomem *) vga_res.start;
> +	par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;

This does look quite ugly... Where does the warning come from in the
first place. Isn't vga_res.start (resource_size_t) the size of a pointer?

 Tomi
Prabhakar Dec. 3, 2014, 6:29 p.m. UTC | #2
On Wed, Dec 3, 2014 at 11:49 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 27/11/14 00:07, Lad, Prabhakar wrote:
>> this patch fixes following build warning:
>> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
>> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>>   par->state.vgabase = (void __iomem *) vga_res.start;
>>                        ^
>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>> ---
>>  drivers/video/fbdev/vt8623fb.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
>> index 5c7cbc6..ea7f056 100644
>> --- a/drivers/video/fbdev/vt8623fb.c
>> +++ b/drivers/video/fbdev/vt8623fb.c
>> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>
>>       pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
>>
>> -     par->state.vgabase = (void __iomem *) vga_res.start;
>> +     par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
>
> This does look quite ugly... Where does the warning come from in the
> first place. Isn't vga_res.start (resource_size_t) the size of a pointer?
>
Yes looks ugly, I am not sure what you meant from 'where does this warning
come from' its in the commit message.

Thanks,
--Prabhakar Lad
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Dec. 4, 2014, 7:05 a.m. UTC | #3
On 03/12/14 20:29, Prabhakar Lad wrote:
> On Wed, Dec 3, 2014 at 11:49 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 27/11/14 00:07, Lad, Prabhakar wrote:
>>> this patch fixes following build warning:
>>> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
>>> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>>>   par->state.vgabase = (void __iomem *) vga_res.start;
>>>                        ^
>>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>> ---
>>>  drivers/video/fbdev/vt8623fb.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
>>> index 5c7cbc6..ea7f056 100644
>>> --- a/drivers/video/fbdev/vt8623fb.c
>>> +++ b/drivers/video/fbdev/vt8623fb.c
>>> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>>
>>>       pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
>>>
>>> -     par->state.vgabase = (void __iomem *) vga_res.start;
>>> +     par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
>>
>> This does look quite ugly... Where does the warning come from in the
>> first place. Isn't vga_res.start (resource_size_t) the size of a pointer?
>>
> Yes looks ugly, I am not sure what you meant from 'where does this warning
> come from' its in the commit message.

I meant why is there a warning at all. With a quick glance,
vga_res.start is the size of a pointer. So the sizes of the integer and
the pointer should be the same. But the warning still says "of different
size".

 Tomi
Sudip Mukherjee Dec. 4, 2014, 7:46 a.m. UTC | #4
On Thu, Dec 04, 2014 at 09:05:46AM +0200, Tomi Valkeinen wrote:
> On 03/12/14 20:29, Prabhakar Lad wrote:
> > On Wed, Dec 3, 2014 at 11:49 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> >> On 27/11/14 00:07, Lad, Prabhakar wrote:
> >>> this patch fixes following build warning:
> >>> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
> >>> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> >>>   par->state.vgabase = (void __iomem *) vga_res.start;
> >>>                        ^
> >>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >>> ---
> >>>  drivers/video/fbdev/vt8623fb.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
> >>> index 5c7cbc6..ea7f056 100644
> >>> --- a/drivers/video/fbdev/vt8623fb.c
> >>> +++ b/drivers/video/fbdev/vt8623fb.c
> >>> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
> >>>
> >>>       pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
> >>>
> >>> -     par->state.vgabase = (void __iomem *) vga_res.start;
> >>> +     par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
> >>
> >> This does look quite ugly... Where does the warning come from in the
> >> first place. Isn't vga_res.start (resource_size_t) the size of a pointer?
> >>
> > Yes looks ugly, I am not sure what you meant from 'where does this warning
> > come from' its in the commit message.
> 
> I meant why is there a warning at all. With a quick glance,
> vga_res.start is the size of a pointer. So the sizes of the integer and
> the pointer should be the same. But the warning still says "of different
> size".

poking my nose into your discussion.
I tried to see the warning, and I re-compiled like make W=1 M=drivers/video/fbdev/ (before that make clean M=drivers/video/fbdev was done)
I can see warning with many other files, but drivers/video/fbdev/vt8623fb.o was quiet and there was no warning.
I tested with next=20141203.
did i miss something in checking the warning ?

thanks
sudip

> 
>  Tomi
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Dec. 4, 2014, 7:56 a.m. UTC | #5
On 04/12/14 09:46, Sudip Mukherjee wrote:
> On Thu, Dec 04, 2014 at 09:05:46AM +0200, Tomi Valkeinen wrote:
>> On 03/12/14 20:29, Prabhakar Lad wrote:
>>> On Wed, Dec 3, 2014 at 11:49 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>>> On 27/11/14 00:07, Lad, Prabhakar wrote:
>>>>> this patch fixes following build warning:
>>>>> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
>>>>> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>>>>>   par->state.vgabase = (void __iomem *) vga_res.start;
>>>>>                        ^
>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>>>> ---
>>>>>  drivers/video/fbdev/vt8623fb.c | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
>>>>> index 5c7cbc6..ea7f056 100644
>>>>> --- a/drivers/video/fbdev/vt8623fb.c
>>>>> +++ b/drivers/video/fbdev/vt8623fb.c
>>>>> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>>>>
>>>>>       pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
>>>>>
>>>>> -     par->state.vgabase = (void __iomem *) vga_res.start;
>>>>> +     par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
>>>>
>>>> This does look quite ugly... Where does the warning come from in the
>>>> first place. Isn't vga_res.start (resource_size_t) the size of a pointer?
>>>>
>>> Yes looks ugly, I am not sure what you meant from 'where does this warning
>>> come from' its in the commit message.
>>
>> I meant why is there a warning at all. With a quick glance,
>> vga_res.start is the size of a pointer. So the sizes of the integer and
>> the pointer should be the same. But the warning still says "of different
>> size".
> 
> poking my nose into your discussion.
> I tried to see the warning, and I re-compiled like make W=1 M=drivers/video/fbdev/ (before that make clean M=drivers/video/fbdev was done)
> I can see warning with many other files, but drivers/video/fbdev/vt8623fb.o was quiet and there was no warning.
> I tested with next=20141203.
> did i miss something in checking the warning ?

I don't see the warning either when compiling for arm or x86_64. On what
architecture do you see the warning?

 Tomi
Geert Uytterhoeven Dec. 4, 2014, 1:29 p.m. UTC | #6
On Thu, Dec 4, 2014 at 8:56 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 04/12/14 09:46, Sudip Mukherjee wrote:
>> On Thu, Dec 04, 2014 at 09:05:46AM +0200, Tomi Valkeinen wrote:
>>> On 03/12/14 20:29, Prabhakar Lad wrote:
>>>> On Wed, Dec 3, 2014 at 11:49 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>>>> On 27/11/14 00:07, Lad, Prabhakar wrote:
>>>>>> this patch fixes following build warning:
>>>>>> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
>>>>>> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>>>>>>   par->state.vgabase = (void __iomem *) vga_res.start;
>>>>>>                        ^
>>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>>>>> ---
>>>>>>  drivers/video/fbdev/vt8623fb.c | 2 +-
>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
>>>>>> index 5c7cbc6..ea7f056 100644
>>>>>> --- a/drivers/video/fbdev/vt8623fb.c
>>>>>> +++ b/drivers/video/fbdev/vt8623fb.c
>>>>>> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>>>>>
>>>>>>       pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
>>>>>>
>>>>>> -     par->state.vgabase = (void __iomem *) vga_res.start;
>>>>>> +     par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
>>>>>
>>>>> This does look quite ugly... Where does the warning come from in the
>>>>> first place. Isn't vga_res.start (resource_size_t) the size of a pointer?
>>>>>
>>>> Yes looks ugly, I am not sure what you meant from 'where does this warning
>>>> come from' its in the commit message.
>>>
>>> I meant why is there a warning at all. With a quick glance,
>>> vga_res.start is the size of a pointer. So the sizes of the integer and
>>> the pointer should be the same. But the warning still says "of different
>>> size".
>>
>> poking my nose into your discussion.
>> I tried to see the warning, and I re-compiled like make W=1 M=drivers/video/fbdev/ (before that make clean M=drivers/video/fbdev was done)
>> I can see warning with many other files, but drivers/video/fbdev/vt8623fb.o was quiet and there was no warning.
>> I tested with next=20141203.
>> did i miss something in checking the warning ?
>
> I don't see the warning either when compiling for arm or x86_64. On what
> architecture do you see the warning?

On 32-bit systems with PHYS_ADDR_T_64BIT=y, resource_size_t is u64,
while pointers are still 32-bit.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Dec. 4, 2014, 1:40 p.m. UTC | #7
On 04/12/14 15:29, Geert Uytterhoeven wrote:
> On Thu, Dec 4, 2014 at 8:56 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 04/12/14 09:46, Sudip Mukherjee wrote:
>>> On Thu, Dec 04, 2014 at 09:05:46AM +0200, Tomi Valkeinen wrote:
>>>> On 03/12/14 20:29, Prabhakar Lad wrote:
>>>>> On Wed, Dec 3, 2014 at 11:49 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>>>>>> On 27/11/14 00:07, Lad, Prabhakar wrote:
>>>>>>> this patch fixes following build warning:
>>>>>>> drivers/video/fbdev/vt8623fb.c: In function ‘vt8623_pci_probe’:
>>>>>>> drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>>>>>>>   par->state.vgabase = (void __iomem *) vga_res.start;
>>>>>>>                        ^
>>>>>>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>>>>>> ---
>>>>>>>  drivers/video/fbdev/vt8623fb.c | 2 +-
>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
>>>>>>> index 5c7cbc6..ea7f056 100644
>>>>>>> --- a/drivers/video/fbdev/vt8623fb.c
>>>>>>> +++ b/drivers/video/fbdev/vt8623fb.c
>>>>>>> @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>>>>>>
>>>>>>>       pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
>>>>>>>
>>>>>>> -     par->state.vgabase = (void __iomem *) vga_res.start;
>>>>>>> +     par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
>>>>>>
>>>>>> This does look quite ugly... Where does the warning come from in the
>>>>>> first place. Isn't vga_res.start (resource_size_t) the size of a pointer?
>>>>>>
>>>>> Yes looks ugly, I am not sure what you meant from 'where does this warning
>>>>> come from' its in the commit message.
>>>>
>>>> I meant why is there a warning at all. With a quick glance,
>>>> vga_res.start is the size of a pointer. So the sizes of the integer and
>>>> the pointer should be the same. But the warning still says "of different
>>>> size".
>>>
>>> poking my nose into your discussion.
>>> I tried to see the warning, and I re-compiled like make W=1 M=drivers/video/fbdev/ (before that make clean M=drivers/video/fbdev was done)
>>> I can see warning with many other files, but drivers/video/fbdev/vt8623fb.o was quiet and there was no warning.
>>> I tested with next=20141203.
>>> did i miss something in checking the warning ?
>>
>> I don't see the warning either when compiling for arm or x86_64. On what
>> architecture do you see the warning?
> 
> On 32-bit systems with PHYS_ADDR_T_64BIT=y, resource_size_t is u64,
> while pointers are still 32-bit.

Ah, I see. Yes, I can reproduce the warning with that config.

So, still rather ugly, but looks correct to me, so I'll apply the series.

 Tomi
diff mbox

Patch

diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
index 5c7cbc6..ea7f056 100644
--- a/drivers/video/fbdev/vt8623fb.c
+++ b/drivers/video/fbdev/vt8623fb.c
@@ -731,7 +731,7 @@  static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
 
-	par->state.vgabase = (void __iomem *) vga_res.start;
+	par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
 
 	/* Find how many physical memory there is on card */
 	memsize1 = (vga_rseq(par->state.vgabase, 0x34) + 1) >> 1;