linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fbdev/g364fb: Fix a compilation issue
@ 2023-01-05  9:40 xurui
  2023-01-09  8:09 ` Helge Deller
  2023-01-09 10:01 ` Geert Uytterhoeven
  0 siblings, 2 replies; 6+ messages in thread
From: xurui @ 2023-01-05  9:40 UTC (permalink / raw)
  To: deller; +Cc: linux-fbdev, dri-devel, linux-kernel, trivial, xurui

drivers/video/fbdev/g364fb.c:202:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Signed-off-by: xurui <xurui@kylinos.cn>
---
 drivers/video/fbdev/g364fb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c
index 05837a3b985c..beef4bcec3c5 100644
--- a/drivers/video/fbdev/g364fb.c
+++ b/drivers/video/fbdev/g364fb.c
@@ -175,7 +175,8 @@ int __init g364fb_init(void)
 {
 	volatile unsigned int *curs_pal_ptr =
 	    (volatile unsigned int *) CURS_PAL_REG;
-	int mem, i;
+	int mem;
+	uintptr_t i;
 
 	if (fb_get_options("g364fb", NULL))
 		return -ENODEV;
-- 
2.25.1


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

* [PATCH] fbdev/g364fb: Fix a compilation issue
@ 2023-01-05  9:44 xurui
  0 siblings, 0 replies; 6+ messages in thread
From: xurui @ 2023-01-05  9:44 UTC (permalink / raw)
  To: deller; +Cc: linux-fbdev, dri-devel, linux-kernel, trivial, xurui

drivers/video/fbdev/g364fb.c:202:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Signed-off-by: xurui <xurui@kylinos.cn>
---
 drivers/video/fbdev/g364fb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c
index 05837a3b985c..beef4bcec3c5 100644
--- a/drivers/video/fbdev/g364fb.c
+++ b/drivers/video/fbdev/g364fb.c
@@ -175,7 +175,8 @@ int __init g364fb_init(void)
 {
 	volatile unsigned int *curs_pal_ptr =
 	    (volatile unsigned int *) CURS_PAL_REG;
-	int mem, i;
+	int mem;
+	uintptr_t i;
 
 	if (fb_get_options("g364fb", NULL))
 		return -ENODEV;
-- 
2.25.1


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

* Re: [PATCH] fbdev/g364fb: Fix a compilation issue
  2023-01-05  9:40 [PATCH] fbdev/g364fb: Fix a compilation issue xurui
@ 2023-01-09  8:09 ` Helge Deller
  2023-01-09 10:01 ` Geert Uytterhoeven
  1 sibling, 0 replies; 6+ messages in thread
From: Helge Deller @ 2023-01-09  8:09 UTC (permalink / raw)
  To: xurui; +Cc: linux-fbdev, dri-devel, linux-kernel, trivial

On 1/5/23 10:40, xurui wrote:
> drivers/video/fbdev/g364fb.c:202:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>
> Signed-off-by: xurui <xurui@kylinos.cn>

applied.

Thanks!
Helge

> ---
>   drivers/video/fbdev/g364fb.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/g364fb.c b/drivers/video/fbdev/g364fb.c
> index 05837a3b985c..beef4bcec3c5 100644
> --- a/drivers/video/fbdev/g364fb.c
> +++ b/drivers/video/fbdev/g364fb.c
> @@ -175,7 +175,8 @@ int __init g364fb_init(void)
>   {
>   	volatile unsigned int *curs_pal_ptr =
>   	    (volatile unsigned int *) CURS_PAL_REG;
> -	int mem, i;
> +	int mem;
> +	uintptr_t i;
>
>   	if (fb_get_options("g364fb", NULL))
>   		return -ENODEV;


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

* Re: [PATCH] fbdev/g364fb: Fix a compilation issue
  2023-01-05  9:40 [PATCH] fbdev/g364fb: Fix a compilation issue xurui
  2023-01-09  8:09 ` Helge Deller
@ 2023-01-09 10:01 ` Geert Uytterhoeven
  2023-01-09 10:04   ` Geert Uytterhoeven
  1 sibling, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2023-01-09 10:01 UTC (permalink / raw)
  To: xurui
  Cc: deller, linux-fbdev, dri-devel, linux-kernel, trivial,
	Linux MIPS Mailing List

Hi Xurui,

On Thu, Jan 5, 2023 at 10:45 AM xurui <xurui@kylinos.cn> wrote:
> drivers/video/fbdev/g364fb.c:202:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>
> Signed-off-by: xurui <xurui@kylinos.cn>

Thanks for your patch!

> --- a/drivers/video/fbdev/g364fb.c
> +++ b/drivers/video/fbdev/g364fb.c
> @@ -175,7 +175,8 @@ int __init g364fb_init(void)
>  {
>         volatile unsigned int *curs_pal_ptr =
>             (volatile unsigned int *) CURS_PAL_REG;
> -       int mem, i;
> +       int mem;
> +       uintptr_t i;

This doesn't look like the right fix to me.

The line the compiler[1] complains about is:

                *(unsigned short *) (CURS_PAT_REG + i * 8) = 0;

Interestingly, it doesn't complain about:

        *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;

This driver uses raw memory writes to write to hardware registers.
Probably it should use writel() instead.

[1] mips64-linux-gnuabi64-gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)
    jazz_defconfig + CONFIG_64BIT=y

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

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

* Re: [PATCH] fbdev/g364fb: Fix a compilation issue
  2023-01-09 10:01 ` Geert Uytterhoeven
@ 2023-01-09 10:04   ` Geert Uytterhoeven
  2023-01-15 20:46     ` Helge Deller
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2023-01-09 10:04 UTC (permalink / raw)
  To: xurui; +Cc: deller, linux-fbdev, dri-devel, linux-kernel, trivial, linux-mips

This time with the new linux-mips mailing list address...

On Mon, Jan 9, 2023 at 11:01 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Xurui,
>
> On Thu, Jan 5, 2023 at 10:45 AM xurui <xurui@kylinos.cn> wrote:
> > drivers/video/fbdev/g364fb.c:202:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> >
> > Signed-off-by: xurui <xurui@kylinos.cn>
>
> Thanks for your patch!
>
> > --- a/drivers/video/fbdev/g364fb.c
> > +++ b/drivers/video/fbdev/g364fb.c
> > @@ -175,7 +175,8 @@ int __init g364fb_init(void)
> >  {
> >         volatile unsigned int *curs_pal_ptr =
> >             (volatile unsigned int *) CURS_PAL_REG;
> > -       int mem, i;
> > +       int mem;
> > +       uintptr_t i;
>
> This doesn't look like the right fix to me.
>
> The line the compiler[1] complains about is:
>
>                 *(unsigned short *) (CURS_PAT_REG + i * 8) = 0;
>
> Interestingly, it doesn't complain about:
>
>         *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;
>
> This driver uses raw memory writes to write to hardware registers.
> Probably it should use writel() instead.
>
> [1] mips64-linux-gnuabi64-gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)
>     jazz_defconfig + CONFIG_64BIT=y
>
> 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

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

* Re: [PATCH] fbdev/g364fb: Fix a compilation issue
  2023-01-09 10:04   ` Geert Uytterhoeven
@ 2023-01-15 20:46     ` Helge Deller
  0 siblings, 0 replies; 6+ messages in thread
From: Helge Deller @ 2023-01-15 20:46 UTC (permalink / raw)
  To: Geert Uytterhoeven, xurui
  Cc: linux-fbdev, dri-devel, linux-kernel, trivial, linux-mips

Hi Xurui,

On 1/9/23 11:04, Geert Uytterhoeven wrote:
> This time with the new linux-mips mailing list address...
>
> On Mon, Jan 9, 2023 at 11:01 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>
>> Hi Xurui,
>>
>> On Thu, Jan 5, 2023 at 10:45 AM xurui <xurui@kylinos.cn> wrote:
>>> drivers/video/fbdev/g364fb.c:202:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>>
>>> Signed-off-by: xurui <xurui@kylinos.cn>
>>
>> Thanks for your patch!
>>
>>> --- a/drivers/video/fbdev/g364fb.c
>>> +++ b/drivers/video/fbdev/g364fb.c
>>> @@ -175,7 +175,8 @@ int __init g364fb_init(void)
>>>   {
>>>          volatile unsigned int *curs_pal_ptr =
>>>              (volatile unsigned int *) CURS_PAL_REG;
>>> -       int mem, i;
>>> +       int mem;
>>> +       uintptr_t i;
>>
>> This doesn't look like the right fix to me.
>>
>> The line the compiler[1] complains about is:
>>
>>                  *(unsigned short *) (CURS_PAT_REG + i * 8) = 0;
>>
>> Interestingly, it doesn't complain about:
>>
>>          *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;
>>
>> This driver uses raw memory writes to write to hardware registers.
>> Probably it should use writel() instead.

Xurui, I'll drop this patch from fbdev git tree for now.

Please check if the driver can be converted to writel() or similiar.

Thanks,
Helge

>> [1] mips64-linux-gnuabi64-gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)
>>      jazz_defconfig + CONFIG_64BIT=y


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

end of thread, other threads:[~2023-01-15 20:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05  9:40 [PATCH] fbdev/g364fb: Fix a compilation issue xurui
2023-01-09  8:09 ` Helge Deller
2023-01-09 10:01 ` Geert Uytterhoeven
2023-01-09 10:04   ` Geert Uytterhoeven
2023-01-15 20:46     ` Helge Deller
  -- strict thread matches above, loose matches on Subject: below --
2023-01-05  9:44 xurui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).