All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] dma-mapping: fix ia64 and m32r build error and warnings
@ 2016-09-29 10:02 Niklas Söderlund
  2016-09-29 10:02   ` Niklas Söderlund
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Niklas Söderlund @ 2016-09-29 10:02 UTC (permalink / raw)
  To: vinod.koul, linux-renesas-soc, dmaengine, iommu
  Cc: robin.murphy, arnd, Niklas Söderlund

From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Hi Vindo,

This small series fixes the build error and warnings for ia64 and m32r 
which kbuild test robot found and where introduced in the series 
'[PATCHv9 0/6] dmaengine: rcar-dmac: add iommu support for slave 
transfers'.

It is based ontop of:

git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma.git next

The fixes are only compile tested for the ia64 and m32r architecture to 
show that the error and warnings are fixed. It is tested on ARM to prove 
that the intended functionality still works.

Kbuild test robot found one more class of warnings for the patch series 
mentioned above for the balackfin arch.

   include/linux/dma-mapping.h: In function 'dma_map_resource':
>> include/asm-generic/page.h:90:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
    #define pfn_valid(pfn)  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
                                   ^

These warnings are not addressed in this series since they are not new 
or unique to original patch. They come from how pfn_valid() is 
implemented in include/asm-generic/page.h, if ARCH_PFN_OFFSET is 0 the 
warning is triggered. On the kbuild blackfin build it is defined as 
'(0x0 >> 12)' so any invocation of pfn_valid() will trigger it.

I tried to fix it but was unable to find a good solution. There is a 
MIPS specific fix for this in commit 95486e4 (MIPS: Fix flood of 
warnings about comparsion being always true.), but a similar fix for 
asm-generic seems to tricky for me to attempt since the macro needs to 
be turned into a static inline function and that might be harmful.  I 
also toyed with the solution of '#if ARCH_PFN_OFFSET == 0' to provided 
an alternative pfn_valid() macro, but since ARCH_PFN_OFFSET is defined 
as an expression and not a constant that wont work. If you can think of 
another way I be happy to try that out and see if I can make it work.

Niklas Söderlund (2):
  dma-mapping: fix ia64 build, use PHYS_PFN
  dma-mapping: fix m32r build warning

 include/linux/dma-mapping.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.9.3

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

end of thread, other threads:[~2016-09-29 12:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-29 10:02 [PATCH 0/2] dma-mapping: fix ia64 and m32r build error and warnings Niklas Söderlund
2016-09-29 10:02 ` [PATCH 1/2] dma-mapping: fix ia64 build, use PHYS_PFN Niklas Söderlund
2016-09-29 10:02   ` Niklas Söderlund
2016-09-29 10:02 ` [PATCH 2/2] dma-mapping: fix m32r build warning Niklas Söderlund
2016-09-29 12:10 ` [PATCH 0/2] dma-mapping: fix ia64 and m32r build error and warnings Vinod Koul
2016-09-29 12:10   ` Vinod Koul
2016-09-29 12:42   ` Niklas Söderlund
2016-09-29 12:42     ` Niklas Söderlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.