public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uio_hv_generic: fix type mismatch warnings
@ 2018-01-10 16:42 Arnd Bergmann
  2018-01-10 16:57 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-10 16:42 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Greg Kroah-Hartman
  Cc: Arnd Bergmann, devel, linux-kernel

I moved the virt_to_phys() conversion into hv_uio_probe() as part of
a warning fix. Stephen's cleanup to remove the private mmap() function
seems reasonable, but part of it reverted the change that I did to
hide the warnings, so they are back now:

drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe':
drivers/uio/uio_hv_generic.c:123:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
drivers/uio/uio_hv_generic.c:130:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
drivers/uio/uio_hv_generic.c:136:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

The type mismatch is now the result of the uio_mmap() definition, and
the best way I see from here is to shut them up with a uintptr_t cast.

Fixes: 9c40546c012c ("uio_hv_generic: use standard mmap for resources")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/uio/uio_hv_generic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index a0c4c07a907f..c740984506f7 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -120,20 +120,20 @@ hv_uio_probe(struct hv_device *dev,
 	/* mem resources */
 	pdata->info.mem[TXRX_RING_MAP].name = "txrx_rings";
 	pdata->info.mem[TXRX_RING_MAP].addr
-		= (phys_addr_t)dev->channel->ringbuffer_pages;
+		= (uintptr_t)dev->channel->ringbuffer_pages;
 	pdata->info.mem[TXRX_RING_MAP].size
 		= dev->channel->ringbuffer_pagecount << PAGE_SHIFT;
 	pdata->info.mem[TXRX_RING_MAP].memtype = UIO_MEM_LOGICAL;
 
 	pdata->info.mem[INT_PAGE_MAP].name = "int_page";
 	pdata->info.mem[INT_PAGE_MAP].addr
-		= (phys_addr_t)vmbus_connection.int_page;
+		= (uintptr_t)vmbus_connection.int_page;
 	pdata->info.mem[INT_PAGE_MAP].size = PAGE_SIZE;
 	pdata->info.mem[INT_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
 	pdata->info.mem[MON_PAGE_MAP].name = "monitor_page";
 	pdata->info.mem[MON_PAGE_MAP].addr
-		= (phys_addr_t)vmbus_connection.monitor_pages[1];
+		= (uintptr_t)vmbus_connection.monitor_pages[1];
 	pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
 	pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
-- 
2.9.0

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

* Re: [PATCH] uio_hv_generic: fix type mismatch warnings
  2018-01-10 16:42 [PATCH] uio_hv_generic: fix type mismatch warnings Arnd Bergmann
@ 2018-01-10 16:57 ` Stephen Hemminger
  2018-01-10 17:14   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2018-01-10 16:57 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Greg Kroah-Hartman, devel, linux-kernel

On Wed, 10 Jan 2018 17:42:38 +0100
Arnd Bergmann <arnd@arndb.de> wrote:

> I moved the virt_to_phys() conversion into hv_uio_probe() as part of
> a warning fix. Stephen's cleanup to remove the private mmap() function
> seems reasonable, but part of it reverted the change that I did to
> hide the warnings, so they are back now:
> 
> drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe':
> drivers/uio/uio_hv_generic.c:123:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> drivers/uio/uio_hv_generic.c:130:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> drivers/uio/uio_hv_generic.c:136:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> 
> The type mismatch is now the result of the uio_mmap() definition, and
> the best way I see from here is to shut them up with a uintptr_t cast.
> 
> Fixes: 9c40546c012c ("uio_hv_generic: use standard mmap for resources")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks. Not sure why I don't see these.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

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

* Re: [PATCH] uio_hv_generic: fix type mismatch warnings
  2018-01-10 16:57 ` Stephen Hemminger
@ 2018-01-10 17:14   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-10 17:14 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Greg Kroah-Hartman, devel, Linux Kernel Mailing List

On Wed, Jan 10, 2018 at 5:57 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Wed, 10 Jan 2018 17:42:38 +0100
> Arnd Bergmann <arnd@arndb.de> wrote:
>
>> I moved the virt_to_phys() conversion into hv_uio_probe() as part of
>> a warning fix. Stephen's cleanup to remove the private mmap() function
>> seems reasonable, but part of it reverted the change that I did to
>> hide the warnings, so they are back now:
>>
>> drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe':
>> drivers/uio/uio_hv_generic.c:123:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>> drivers/uio/uio_hv_generic.c:130:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>> drivers/uio/uio_hv_generic.c:136:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
>>
>> The type mismatch is now the result of the uio_mmap() definition, and
>> the best way I see from here is to shut them up with a uintptr_t cast.
>>
>> Fixes: 9c40546c012c ("uio_hv_generic: use standard mmap for resources")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Thanks. Not sure why I don't see these.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

This is only on 32-bit targets with 64-bit phys_addr_t, which you don't normally
have on x86 in regular configurations, but it can happen in randconfig builds.

        Arnd

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

end of thread, other threads:[~2018-01-10 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 16:42 [PATCH] uio_hv_generic: fix type mismatch warnings Arnd Bergmann
2018-01-10 16:57 ` Stephen Hemminger
2018-01-10 17:14   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox