Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1236072rwl; Thu, 10 Aug 2023 08:17:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDn1MpRKsPY+EIEBiYk7OvTliKm2jFFU82M6ruTZIWtND4q5aX2l4s4qOV9kwEPPL4JwvQ X-Received: by 2002:a05:6a00:23c6:b0:686:5f73:4eac with SMTP id g6-20020a056a0023c600b006865f734eacmr3959879pfc.13.1691680650063; Thu, 10 Aug 2023 08:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691680650; cv=none; d=google.com; s=arc-20160816; b=PvTrKfcFfKGuJPIBIbGFxQMKMEoFKEJyAwF1J5+o6j/2TOvmSLDbLBKZkOnTKi28c9 2SaZ9ueOug8UPvUiSEafPeMsK7bCEcfcqarPWCOKVMTSaYcKjmysdS3YmGs1M3B7gQKa 6/mv/sZkTPcCPn7jxjKgUC2r77MmR/UJ+qZRZpct6iKwy1iHz1hHj6Az/s8YEMi1B654 yb2jR4XItCv/MNtPzMtGpQwcI/5ygjd+hgFFt94CJBV/9fqMCsQK9ZOU4B/9ZBDVbRrw uoUVEM2v6HkhVGtuYaTNVIYN+di1lrw5bm8cPl+GVMCx0Dwf4CYCFiSww2XEU3/m35Cj Ivlw== 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=0C09Uf8k63e/ih72JRz+n7oNLURrSJjtvLnZ7Ya/pco=; fh=D4b3i1jgfGh86omOS4/xuxHz4Q+L/NGqL3bflvb12sg=; b=uADzmLTgpFoX7lliEy7M6rcEKiJwvMMi6EL79K2h9KhTzlLT081k8QkTxszcCDLAsW sy1BHbUseQuyXFkZX3SGLzUIyNzYl3cfEjJEd0z1LGuTBJSNf2QPK7liZCQ3dqCr5JHE CMVdD7btnfkzqSTNvR/TOsWh0dk50lIJcXNJDDBhPpq/Z/uL2BJ+F6NXFpwU8VJm/o6l 6E/G9jvTKD2noIC1tVzfLkycBsJSsA6aufXtyaTEJJKuUaAdAcX6TSRko9oETzsrMTBk 9qNLo4viX4QJvgBFR5veBkpFzOhh0UD7KpOh8O3452Lfrc2IGUUkA3g5pkNjDM8YHRaW zUMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VyaKpQ2+; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg26-20020a056a02011a00b0051b90567f99si1676596pgb.690.2023.08.10.08.17.01; Thu, 10 Aug 2023 08:17:30 -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=@kernel.org header.s=k20201202 header.b=VyaKpQ2+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235403AbjHJOpB (ORCPT + 99 others); Thu, 10 Aug 2023 10:45:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235926AbjHJOo5 (ORCPT ); Thu, 10 Aug 2023 10:44:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD3E92703; Thu, 10 Aug 2023 07:44:55 -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 45B8665EB1; Thu, 10 Aug 2023 14:44:55 +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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230810085632.xzonkmse27mu4yew@intel.intel> 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 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