RE: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems
From: David Laight <hidden>
Date: 2021-04-17 21:19:04
Also in:
linux-mips, linux-mm, linuxppc-dev, lkml, netdev
From: David Laight <hidden>
Date: 2021-04-17 21:19:04
Also in:
linux-mips, linux-mm, linuxppc-dev, lkml, netdev
From: Matthew Wilcox <willy@infradead.org>
Sent: 17 April 2021 03:45 Replacement patch to fix compiler warning.
...
static inline dma_addr_t page_pool_get_dma_addr(struct page *page)
{
- return page->dma_addr;
+ dma_addr_t ret = page->dma_addr[0];
+ if (sizeof(dma_addr_t) > sizeof(unsigned long))
+ ret |= (dma_addr_t)page->dma_addr[1] << 16 << 16;Ugly as well. Why not just replace the (dma_addr_t) cast with a (u64) one? Looks better than the double shift. Same could be done for the '>> 32'. Is there an upper_32_bits() that could be used?? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel