From nobody Sun May 5 00:07:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1608828639; cv=none; d=zohomail.com; s=zohoarc; b=Xe2vMsN5RJG/9CXucwEwUpBCq/EO2pqghGukdutGKhDv1XhlODphcRjlj7k0bSq73tZICHj3QB+3WGh25C82Zvb5mJnFdwUl9oSssGYq4aTroYawWhBwquxnq5BAWcnOtZ7WEE11aFaY0SXIi03E9HrcpqbhLEZ8WwlkA2AgcM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608828639; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=T5b8OXlmfA5c+LhCQAD6AHBhLsAIyHkQ9Ac1BK65xNI=; b=DdXbkaMvCPbLuhwd/zJxOFlfCIs0a0zVBnP5b1iOlfrKoYOQgKk7xh8iINb+1N5b+Mx8sbEJorXsaUn7D5wpl+4RZJi9AW6lRbI3H5NgISZQ5ZQGBX/KcyXFcBjmLbGT22qTwrezRsLNcv82wZajG3Rt0Ke1nJL/CyLw73iIm2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1608828639224377.08069500977444; Thu, 24 Dec 2020 08:50:39 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.58759.103535 (Exim 4.92) (envelope-from ) id 1ksTon-0004eG-Or; Thu, 24 Dec 2020 16:50:25 +0000 Received: by outflank-mailman (output) from mailman id 58759.103535; Thu, 24 Dec 2020 16:50:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ksTon-0004e8-LQ; Thu, 24 Dec 2020 16:50:25 +0000 Received: by outflank-mailman (input) for mailman id 58759; Thu, 24 Dec 2020 16:50:24 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ksTom-0004e0-UI for xen-devel@lists.xenproject.org; Thu, 24 Dec 2020 16:50:24 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ksTom-0001Wf-Ic; Thu, 24 Dec 2020 16:50:24 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ksTom-00016r-9j; Thu, 24 Dec 2020 16:50:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From; bh=T5b8OXlmfA5c+LhCQAD6AHBhLsAIyHkQ9Ac1BK65xNI=; b=TiV7G3Jl0V1eQ1WKDcJEnubYDB cb+jjyRJOxssl1pmdki/otdmJDBL3jzXPeDLqVrkGGaeu3N3RTWFxXZ47guTCgQoWxgaZQmJJuqqZ l9RiyyCdZCtFxFpoVL36MhvpAC9o/2aOcNNKNzWzRJQgXe4LdrtDmGa/FW+k8WZ8g/s8=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: bertrand.marquis@arm.com, Rahul.Singh@arm.com, Julien Grall , Stefano Stabellini , Julien Grall , Volodymyr Babchuk Subject: [PATCH] xen/serial: scif: Rework how the parameters are found Date: Thu, 24 Dec 2020 16:50:21 +0000 Message-Id: <20201224165021.449-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 X-ZohoMail-DKIM: pass (identity @xen.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall clang 11 will throw the following error while build Xen: scif-uart.c:333:33: error: cast to smaller integer type 'enum port_types' f= rom 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] uart->params =3D &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 Reviewed-by: Stefano Stabellini --- Only build tested as I don't have the HW. --- 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 9d3f66b55b67..ee204a11a471 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_drive= r =3D { =20 static const struct dt_device_match scif_uart_dt_match[] __initconst =3D { - { .compatible =3D "renesas,scif", .data =3D (void *)SCIF_PORT }, - { .compatible =3D "renesas,scifa", .data =3D (void *)SCIFA_PORT }, + { .compatible =3D "renesas,scif", .data =3D &port_params[SCIF_PORT] }, + { .compatible =3D "renesas,scifa", .data =3D &port_params[SCIFA_PORT] = }, { /* sentinel */ }, }; =20 @@ -330,7 +330,7 @@ static int __init scif_uart_init(struct dt_device_node = *dev, =20 match =3D dt_match_node(scif_uart_dt_match, dev); ASSERT( match ); - uart->params =3D &port_params[(enum port_types)match->data]; + uart->params =3D match->data; =20 uart->vuart.base_addr =3D addr; uart->vuart.size =3D size; --=20 2.17.1