Re: [PATCH v7 1/7] fbdev/hitfb: Cast I/O offset to address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: David Laight <David.Laight@xxxxxxxxxx>, "deller@xxxxxx" <deller@xxxxxx>, "geert@xxxxxxxxxxxxxx" <geert@xxxxxxxxxxxxxx>, "javierm@xxxxxxxxxx" <javierm@xxxxxxxxxx>, "daniel@xxxxxxxx" <daniel@xxxxxxxx>, "vgupta@xxxxxxxxxx" <vgupta@xxxxxxxxxx>, "chenhuacai@xxxxxxxxxx" <chenhuacai@xxxxxxxxxx>, "kernel@xxxxxxxxxx" <kernel@xxxxxxxxxx>, "davem@xxxxxxxxxxxxx" <davem@xxxxxxxxxxxxx>, "James.Bottomley@xxxxxxxxxxxxxxxxxxxxx" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, "arnd@xxxxxxxx" <arnd@xxxxxxxx>, "sam@xxxxxxxxxxxx" <sam@xxxxxxxxxxxx>, "suijingfeng@xxxxxxxxxxx" <suijingfeng@xxxxxxxxxxx>
- Subject: Re: [PATCH v7 1/7] fbdev/hitfb: Cast I/O offset to address
- From: Thomas Zimmermann <tzimmermann@xxxxxxx>
- Date: Fri, 12 May 2023 13:45:22 +0200
- Cc: "linux-arch@xxxxxxxxxxxxxxx" <linux-arch@xxxxxxxxxxxxxxx>, "linux-fbdev@xxxxxxxxxxxxxxx" <linux-fbdev@xxxxxxxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>, kernel test robot <lkp@xxxxxxxxx>, "linux-parisc@xxxxxxxxxxxxxxx" <linux-parisc@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "dri-devel@xxxxxxxxxxxxxxxxxxxxx" <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, "linux-m68k@xxxxxxxxxxxxxxxxxxxx" <linux-m68k@xxxxxxxxxxxxxxx>, "loongarch@xxxxxxxxxxxxxxx" <loongarch@xxxxxxxxxxxxxxx>, "sparclinux@xxxxxxxxxxxxxxx" <sparclinux@xxxxxxxxxxxxxxx>, "linux-snps-arc@xxxxxxxxxxxxxxxxxxx" <linux-snps-arc@xxxxxxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, Artur Rojek <contact@xxxxxxxxxxxxxx>
- In-reply-to: <c25758dd7b4a4563b0d33c751da8cf6d@AcuMS.aculab.com>
- References: <20230512102444.5438-1-tzimmermann@suse.de> <20230512102444.5438-2-tzimmermann@suse.de> <c25758dd7b4a4563b0d33c751da8cf6d@AcuMS.aculab.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1
Hi
Am 12.05.23 um 13:16 schrieb David Laight:
From: Thomas Zimmermann
Sent: 12 May 2023 11:25
Cast I/O offsets to pointers to use them with I/O functions. The I/O
functions expect pointers of type 'volatile void __iomem *', but the
offsets are plain integers. Build warnings are
../drivers/video/fbdev/hitfb.c: In function 'hitfb_accel_wait':
../arch/x86/include/asm/hd64461.h:18:33: warning: passing argument 1 of 'fb_readw' makes pointer
from integer without a cast [-Wint-conversion]
18 | #define HD64461_IO_OFFSET(x) (HD64461_IOBASE + (x))
| ^~~~~~~~~~~~~~~~~~~~~~
...
52 | static inline u16 fb_readw(const volatile void __iomem *addr)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
This patch only fixes the build warnings. It's not clear if the I/O
offsets can legally be passed to the I/O helpers. It was apparently
broken in 2007 when custom inw()/outw() helpers got removed by
commit 34a780a0afeb ("sh: hp6xx pata_platform support."). Fixing the
driver would require setting the I/O base address.
Did you try changing the definition of HD64461_IOBASE to include
a (volatile void __iomem *) cast?
I thought about it, but didn't try it. I didn't want bend the meaning of
OFFSET and IOBASE too much. They sound like integer constants to me.
A lot less churn...
I'm guessing that 'sh' deosn't have in/out instructions so this
is something that is always mapped at a fixed kernel virtual address?
No idea. I cannot try the driver and was only able to build it by
hacking up something that makes COMPILE_TEST work.
The current patch seemed like the safest bet, even with the churn.
Best regards
Thomas
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]