From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E27BDC001E0 for ; Thu, 10 Aug 2023 15:44:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qHOftckWijovFd2k5k54S50Yix1ujS89CewdyiBfDzo=; b=hPm0rGZVigRNv1 +IIv8qGxsZFgwnj7yXVyYUG38qb2Et6rc51KU8HwuE2Oy8G0hpkHyVrXEOa64pTzl5VsRU2jF36jg O5KQBp+5/zgctMcUW83ihV6zr+EPjTlOlTVz7kNtbPclM9V9DRzvXZlm7sNW1R7tBfZVe68uGsd+X co4EMAJiZHUBKlF3Tdm9ZT/Cv5onlKocaX8IT5//JAIzwM7zS7E2YZaeBKnxEQGVa8uuQTEWTMrNO mx7gk0tkSbAMADgoFKZiXk1nvEPcudkWqAcFkFKkDmxLBS1NeyOWeodr18s8AopeGvo7gsDlM55jT eQnR3IKg42EBIdyITEQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qU7po-0084nI-0f; Thu, 10 Aug 2023 15:44:24 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qU7pl-0084lo-18 for linux-arm-kernel@lists.infradead.org; Thu, 10 Aug 2023 15:44:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4737A660A5; Thu, 10 Aug 2023 15:44:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A15FC433C7; Thu, 10 Aug 2023 15:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691682259; bh=3aiCYQc8vHW8XUu8s7N6C4OIOvqzs2zbImVMJ42Rl2I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I6GGNy1lAQq8UM/9FMHp3yUQBYexHFAaehY5mqxuF4mzQDQ3fek41kZAN6F/anp5w Fj+PM57rxo+Ezn89+EuZSnBuyj3w5g0dfQS2+pTNl6v8KBQ500P4qv9Qfu5hhqpcHQ twQ9zCoVzXSYSQuYV2XJQwX5NnHzXhJ3LxpVZasE= Date: Thu, 10 Aug 2023 17:44:16 +0200 From: Greg Kroah-Hartman To: Krzysztof Kozlowski Cc: Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andi Shyti Subject: Re: [PATCH] serial: mxs-uart: fix Wvoid-pointer-to-enum-cast warning Message-ID: <2023081004-lapped-handbag-0324@gregkh> References: <20230810085042.39252-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230810085042.39252-1-krzysztof.kozlowski@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230810_084421_465021_D1AF8DA7 X-CRM114-Status: GOOD ( 19.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 10, 2023 at 10:50:42AM +0200, Krzysztof Kozlowski wrote: > `devtype` is enum, thus cast of pointer on 64-bit compile test with W=1 > causes: > > mxs-auart.c:1598:15: error: cast to smaller integer type 'enum mxs_auart_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] > > Cc: Andi Shyti > Signed-off-by: Krzysztof Kozlowski > --- > drivers/tty/serial/mxs-auart.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c > index 8eeecf8ad359..a9b32722b049 100644 > --- a/drivers/tty/serial/mxs-auart.c > +++ b/drivers/tty/serial/mxs-auart.c > @@ -1595,7 +1595,7 @@ static int mxs_auart_probe(struct platform_device *pdev) > return -EINVAL; > } > > - s->devtype = (enum mxs_auart_type)of_device_get_match_data(&pdev->dev); > + s->devtype = (uintptr_t)of_device_get_match_data(&pdev->dev); This feels like a compiler issue as devtype is a enum mxs_auart_type variable, so the cast shoudl be correct. And if not, unitptr_t isn't a valid kernel type, so that's not a good solution either. Worst case, it's how big a pointer is, which is not going to be what an enum is if you have a sane compiler :( thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel