[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/serial: scif: Rework how the parameters are found



commit edad4c760a1b28abb15836ac4325912203c44905
Author:     Julien Grall <jgrall@xxxxxxxxxx>
AuthorDate: Thu Dec 24 16:50:21 2020 +0000
Commit:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
CommitDate: Mon Jan 11 16:35:13 2021 -0800

    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@xxxxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/drivers/char/scif-uart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
index 9d3f66b55b..ee204a11a4 100644
--- a/xen/drivers/char/scif-uart.c
+++ b/xen/drivers/char/scif-uart.c
@@ -286,8 +286,8 @@ static struct uart_driver __read_mostly scif_uart_driver = {
 
 static const struct dt_device_match scif_uart_dt_match[] __initconst =
 {
-    { .compatible = "renesas,scif",  .data = (void *)SCIF_PORT },
-    { .compatible = "renesas,scifa", .data = (void *)SCIFA_PORT },
+    { .compatible = "renesas,scif",  .data = &port_params[SCIF_PORT] },
+    { .compatible = "renesas,scifa", .data = &port_params[SCIFA_PORT] },
     { /* sentinel */ },
 };
 
@@ -330,7 +330,7 @@ static int __init scif_uart_init(struct dt_device_node *dev,
 
     match = dt_match_node(scif_uart_dt_match, dev);
     ASSERT( match );
-    uart->params = &port_params[(enum port_types)match->data];
+    uart->params = match->data;
 
     uart->vuart.base_addr  = addr;
     uart->vuart.size       = size;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.