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 1B765C04E69 for ; Thu, 10 Aug 2023 14:45:21 +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=T4ZmJX5v4k/3uMfrNWY4zfbDf8/0L4H93E29leCfivs=; b=fTfO5ro20vgOqH X7OUhNQy5tKgoxTTynJXBePZb6mKdnKU+7LdCxw7ftopGJ7mqH0OyN6moJtzK59LW2FULVxOaF/wI oTK8sQrH76GlDXo1u9+/EhShb+GAps9ld/XvD3gZDK4uN6/6xj/mi7ISQ2XMwvYitlBVfqdh9/w9J emsnX6SG/BKRVWVN/ynlzRDyC/MH+PUqQuwubkjlF8JILfFR3xrI3zxs90v7Rnrmihmrgecy+jHLt TL7EhGG2ir4TKSo7Sx4UCHNKCuoIuCLQXTVDPZhklpKfUuoBs7njNkG8+1boTrGEjEcARU8W+q45o scdujPCuFblHSJGhuglg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qU6uI-007u0Y-29; Thu, 10 Aug 2023 14:44:58 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qU6uF-007tzd-1o for linux-arm-kernel@lists.infradead.org; Thu, 10 Aug 2023 14:44:56 +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 D8BB365EA5; Thu, 10 Aug 2023 14:44:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B7D5C433C9; Thu, 10 Aug 2023 14:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691678694; bh=U7AHW5DtWbmAG9Eg70mB7kcvRN4oEw4Uh2afJWCAUTI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VyaKpQ2+7cui0XWCAAhqdAd+VGbWec7bzimuAwAjPgzEFN63rEAeDsZZdIWCS8pJo pBDMGxn7/3SG9+wcDy3QkA77PM5h4+w+nhNNV/DdvUebflEYS0/G+zPZmoVrMDW7ID b0oEIcFtoHFOVY4ileOspjUBbzcxg0iMxQlGtv1CQV1FH8rs9Ph3vOpPR8n9ph22Pa EG1ybYbPodLdCB9lKN+8vsxuslM5fAaPiCIJ47zgIU2T8sZZt5KQEQdrnT5uj1fTmZ o/8PoBnNCHWAT1nBClRKzpSy7HRaKEzjTGZJnf2EGH9DfTSP0e78b/F1+/V7Al6Bpn G5Y9257lvrD1w== Date: Thu, 10 Aug 2023 07:44:52 -0700 From: Nathan Chancellor To: Andi Shyti Cc: Justin Stitt , Ray Jui , Scott Branden , Broadcom internal kernel review list , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 1/2] i2c: i2c-bcm-iproc: fix -Wvoid-pointer-to-enum-cast warning Message-ID: <20230810144452.GD1549244@dev-arch.thelio-3990X> References: <20230809-cbl-1903-v1-0-df9d66a3ba3e@google.com> <20230809-cbl-1903-v1-1-df9d66a3ba3e@google.com> <20230810085632.xzonkmse27mu4yew@intel.intel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230810085632.xzonkmse27mu4yew@intel.intel> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230810_074455_636329_22DE2FCF X-CRM114-Status: GOOD ( 16.64 ) 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 Hi Andi, On Thu, Aug 10, 2023 at 10:56:32AM +0200, Andi Shyti wrote: > Hi Justin, > > > @@ -1036,7 +1036,7 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev) > > platform_set_drvdata(pdev, iproc_i2c); > > iproc_i2c->device = &pdev->dev; > > iproc_i2c->type = > > - (enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev); > > + (unsigned long) of_device_get_match_data(&pdev->dev); > > I think this should be uintptr_t, as defined in types.h: > > typedef unsigned long uintptr_t; Yes, that is a valid comment, although I will say that I have seen some developers/maintainers prefer 'unsigned long' over 'uintptr_t', so it is really a crapshoot which one to pick :) > (I'm a bit puzzled to see a void *data cast to a 0/1 value.) It is an odd pattern but as far as I understand it, the kernel uses it a lot to pass platform specific data around (just grepping for '.data = (void *)' shows a lot of instances. Cheers, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel