Revision 505e428374bc17a2c0bd388c2e8d892e9cd8eef2 authored by Michael S. Tsirkin on 14 December 2014, 16:52:51 UTC, committed by Michael Ellerman on 18 December 2014, 08:11:09 UTC
At the moment, if p and x are both of the same bitwise type
(eg. __le32), get_user(x, p) produces a sparse warning.

This is because *p is loaded into a long then cast back to typeof(*p).

When typeof(*p) is a bitwise type (which is uncommon), such a cast needs
__force, otherwise sparse produces a warning.

For non-bitwise types __force should have no effect, and should not hide
any legitimate errors.

Note that we are casting to typeof(*p) not typeof(x). Even with the
cast, if x and *p are of different types we should get the warning, so I
think we are not loosing the ability to detect any actual errors.

virtio would like to use bitwise types with get_user() so fix these
spurious warnings by adding __force.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
[mpe: Fill in changelog with more details]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent c8742f8
History
File Mode Size
Kconfig -rw-r--r-- 359 bytes
Makefile -rw-r--r-- 298 bytes
dsa.c -rw-r--r-- 15.9 KB
dsa_priv.h -rw-r--r-- 1.8 KB
slave.c -rw-r--r-- 14.3 KB
tag_brcm.c -rw-r--r-- 4.2 KB
tag_dsa.c -rw-r--r-- 4.4 KB
tag_edsa.c -rw-r--r-- 5.0 KB
tag_trailer.c -rw-r--r-- 2.8 KB

back to top