dma-mapping: fix ia64 and m32r build error and warnings
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 of 2 patches 2 repliesIn review
1 of 2 patches is in this archive. The cover letter announces 2.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 2/2 | dma-mapping: fix m32r build warninginclude/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] dma-mapping: fix ia64 and m32r build error and warnings
From: Niklas Söderlund <[email protected]>
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':
Quoted 1 line
Quoted 1 line
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(-)
Signature · 1 line
2.9.3