Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a133f8b6 authored by Lee Jones's avatar Lee Jones Committed by Jassi Brar
Browse files

mailbox: mailbox-test: Correctly repair Sparse warnings



Kbuild test robot reported some Sparse warnings to the tune of:

  sparse: incorrect type in argument 6 (different address spaces)
    expected void const *buf
    got void [noderef] <asn:2>*mmio

This was due to passing variables tagged with the Sparse cookie
'__iomem' through into memcpy() and print_hex_dump() without
adequate protection or casting.  These issues were fixed in a
previous patch suppressing the warnings, but the issue is indeed
still present.

This patch fixes the warnings in the correct way, i.e. by using
the purposely authored memcpy_{from,to}io() derivatives in the
memcpy() case and casting the memory address to (void *) and
forcing Sparse to ignore to ignore it in the print_hex_dump()
case [NB: This is also what the memcpy() derivatives do].

Reported-by: default avatarPeter Griffin <peter.griffin@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 6c03663f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment