Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1284613rwl; Thu, 10 Aug 2023 08:59:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeb0kTgTI1Fs9/FuNvMnDVCmxypUNAO45rB37QwAi3qnMQvbf291mvytoidRO7d41TLLV3 X-Received: by 2002:a05:6a20:9712:b0:10f:52e2:49ec with SMTP id hr18-20020a056a20971200b0010f52e249ecmr2534391pzc.53.1691683180616; Thu, 10 Aug 2023 08:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691683180; cv=none; d=google.com; s=arc-20160816; b=CfUSHFh+4+vCnmKH8TaQD+5ZNojKl3gAqVUUfh1z3cs+GkhxkEjunkpJrQWb0Eiqpw VY1N8nx5rKhdFKBiBhqoyCH4eH+bBU+OjQabs4zxXDviYS5sjhp3LBwgcn4Surtf5GE5 mm+z/hQTmq2+G1W4hW2cemLK2ttoqHm6iJtvGeW2RfAu3zLUF9IB1uzXHegGb7Xd4x6m urhH9EsNJeQH08mgBxmLbDILBfnaXmmChLvBuHhZccEZtD6QSxWICWVr23sw2FbdNRFP eqIXCbpf6BpfUV2QYHHDhchlD4NCmxLussDJBPb9ua87Nwu89nKeLuVyCpQTvh3Gctjy gC2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3X/6tIJIYVzpkBL3liOsBlGJ9gQh7XzFzVQYyAx5LE0=; fh=vTU6S/1jvXcxSDYUoFXJDrhOxWK4aiznRZvmwGrzHqo=; b=VFWtIE30YepjHzz2stMdExjOp3CRrOqxqDHR6rphBfW8f9jnZETK5PuInEhSgm9j0L 2ikzC9eiKdnw9MkpWbMFJP/Q57C+3LN7jE44/X8F7Wze32rPgh2h04SVhGsSq3+tE0vj LF7QRLzWwBAf5K6RtQjMOhll6g3CCVh+tudlW57olGWTVrb0uygNITsA8B835Iv8OsRX TgaBHQmg6+zf98LOx9jf86Rh12SKgK167Of9rbZQvTlQMsQiDye6679SFZEfTuMmW1XO Co7VT8zmlYjPaYb1Bpfg15uqPWVQK327iOAsTb4Zpox87xFhFaWIqTuUyhqKXjzBSErQ gfNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I6GGNy1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a056a00198a00b00687080bf78dsi1788833pfl.284.2023.08.10.08.59.28; Thu, 10 Aug 2023 08:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I6GGNy1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236203AbjHJPoX (ORCPT + 99 others); Thu, 10 Aug 2023 11:44:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232835AbjHJPoU (ORCPT ); Thu, 10 Aug 2023 11:44:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE5DF26A9; Thu, 10 Aug 2023 08:44:20 -0700 (PDT) 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 4A6C3660A8; 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230810085042.39252-1-krzysztof.kozlowski@linaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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