xen/serial: scif: Rework how the parameters are found
authorJulien Grall <jgrall@amazon.com>
Thu, 24 Dec 2020 16:50:21 +0000 (16:50 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 12 Jan 2021 00:35:13 +0000 (16:35 -0800)
commitedad4c760a1b28abb15836ac4325912203c44905
tree3bc1d710a03ceb0a51217a50ea33b3b466376d1a
parent0e97d99f0e9fc627f29680d20d2619184c894f14
xen/serial: scif: Rework how the parameters are found

clang 11 will throw the following error while build Xen:

scif-uart.c:333:33: error: cast to smaller integer type 'enum port_types' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
    uart->params = &port_params[(enum port_types)match->data];
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The error can be prevented by directly storing a pointer to the port
parameters rather than the a cast of the port type.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/drivers/char/scif-uart.c