Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp309418rdb; Sat, 19 Aug 2023 02:40:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExIifcFLPWv4zH2j0h5btAJ88EHz8bn+6q/PuADqOtWImnyrVJenYld+Nnr7WZPDFUpyAb X-Received: by 2002:a17:902:f68f:b0:1b8:aded:524c with SMTP id l15-20020a170902f68f00b001b8aded524cmr1871772plg.1.1692438054817; Sat, 19 Aug 2023 02:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692438054; cv=none; d=google.com; s=arc-20160816; b=jJzMmZCy5HcC4C8W2Sy2ydd50+zw6kFjpcGa2IDQ8jPv31PxsTsjZzlw2MgaKfSsJj 3lHO1NPwYz0IYBAhYeRGliW11YXkKI6sbH1ASli18lluD8rmkeDhmBO7Oo1nmFZV5Ru8 I6uuj0ezptzWWkObQJqsMd1Uzbw2/VG758/DyhmT92apLPYPSl3h3txSAVKefcXE6cx8 rXas/LSn/q7IPYJTI/uvMppt9N6OcXt0Ks1+aUlno9QT8/JibhvfSbE2AoLJjLRsR/MG IitiPVRIAeFqes2vTtbse27I4uertrsqKF53fPfMLEZlMl3PtmbK5bSuihyyOXA4M/a8 gmkQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PD6Sq+PilhBLx65QDKJednzMgvHHCi8nDHLjh/dBRDw=; fh=4Ai9/2BAialGQtU2QTIcPIDoJyfwfu/ZlFKEiYcUTfg=; b=CH8Qe6ROLkzO13h0HBmw45zCMtnxRI9LNVdLy7WnwUGzifSy8af64c8sYuuv60sVrm 6rAE+ccY3MNceH28jFRHkur7ppnB8gOcb423vswV/CyYnLeCzR1/VxYbhQf/XA4DSTa3 4IlxjOfFjckDaWLMRZRAHwnbfBGhR9zPJazQ3ttzUCSDvKck67/SBQk7bfkiTh+pVIvr Pbwi4j49Ke8c3hokkVnMAglveSgYoYjprHfnEDj0woxg05MLD6poXVJ/GcjHz3//s3ML a3Mt1zSSQ6eDYXOHir5B4mv6kZAv4f5v4/vExr0z4rnD9KQa6Vy1ND6TMoG44IAPwy44 rpIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1ZhxIhk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m1-20020a170902d18100b001bb8c4279f5si2994444plb.148.2023.08.19.02.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 02:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1ZhxIhk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D58AA2C6E0; Sat, 19 Aug 2023 01:28:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348306AbjHQG46 (ORCPT + 99 others); Thu, 17 Aug 2023 02:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348333AbjHQG4x (ORCPT ); Thu, 17 Aug 2023 02:56:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23F8F1FF3; Wed, 16 Aug 2023 23:56:52 -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 940F563CF6; Thu, 17 Aug 2023 06:56:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B884AC433C8; Thu, 17 Aug 2023 06:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692255411; bh=JKi+meRqZX/8UsgXnMaQA/rgBXUj+9Xf7F21WE4jfi8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O1ZhxIhknpoHs6tOzMIpy2RDgtvvJBEtxMeyo4St7zs/Czf1JiK6YxyKSg97SlklO oDKoEA588mGo8RWAatxMxA9KqFgIbLCaFCEjrw8987r01ydVlVf9dVdfO56j/2IhZe gkkXT2H6PKRwMJ4+V+O9smk8R5TGauGe/fIX4l3cgNxdthZhtNNrjjDRyUsFIVG44v 4mPJwn6LikDx07xBBe9O9tNvgmSBor2w2rIOYKzdQmeT4QDVLwqPKPlUq3H83fm6p6 6LON+TZNSWhOQ27g2LeCkjeRUkpGWwDApGg8uGVm+EHa2Ufo7FujZUoafi10xqr1qG M9XEhYlrt4MUg== Date: Thu, 17 Aug 2023 12:26:41 +0530 From: Manivannan Sadhasivam To: Justin Stitt Cc: Vinod Koul , Andreas =?iso-8859-1?Q?F=E4rber?= , Nathan Chancellor , Nick Desaulniers , Tom Rix , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] dmaengine: owl-dma: fix clang -Wvoid-pointer-to-enum-cast warning Message-ID: <20230817065641.GA4864@thinkpad> References: <20230816-void-drivers-dma-owl-dma-v1-1-a0a5e085e937@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230816-void-drivers-dma-owl-dma-v1-1-a0a5e085e937@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Wed, Aug 16, 2023 at 08:12:50PM +0000, Justin Stitt wrote: > When building with clang 18 I see the following warning: > | drivers/dma/owl-dma.c:1119:14: warning: cast to smaller integer type > | 'enum owl_dma_id' from 'const void *' [-Wvoid-pointer-to-enum-cast] > | 1119 | od->devid = (enum owl_dma_id)of_device_get_match_data(&pdev->dev); > > This is due to the fact that `of_device_get_match_data()` returns a > void* while `enum owl_dma_id` has the size of an int. > > Cast result of `of_device_get_match_data()` to a uintptr_t to silence > the above warning for clang builds using W=1 > > Link: https://github.com/ClangBuiltLinux/linux/issues/1910 > Reported-by: Nathan Chancellor > Signed-off-by: Justin Stitt Acked-by: Manivannan Sadhasivam - Mani > --- > drivers/dma/owl-dma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c > index b6e0ac8314e5..f340a04579f4 100644 > --- a/drivers/dma/owl-dma.c > +++ b/drivers/dma/owl-dma.c > @@ -1116,7 +1116,7 @@ static int owl_dma_probe(struct platform_device *pdev) > dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n", > nr_channels, nr_requests); > > - od->devid = (enum owl_dma_id)of_device_get_match_data(&pdev->dev); > + od->devid = (uintptr_t)of_device_get_match_data(&pdev->dev); > > od->nr_pchans = nr_channels; > od->nr_vchans = nr_requests; > > --- > base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421 > change-id: 20230816-void-drivers-dma-owl-dma-41b95a098275 > > Best regards, > -- > Justin Stitt > -- மணிவண்ணன் சதாசிவம்