Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2608241rwr; Fri, 28 Apr 2023 12:54:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56XA7DKUA7VTsS9L/ujnmXYrNG2MAZVlun6spJdc6jUPvaRsNhadDPPzZC0Peo9O2rJZTY X-Received: by 2002:a17:903:124b:b0:1a2:8c7e:f315 with SMTP id u11-20020a170903124b00b001a28c7ef315mr7219426plh.21.1682711660951; Fri, 28 Apr 2023 12:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682711660; cv=none; d=google.com; s=arc-20160816; b=j4TIZDFIyntFRc8ibEqfN8rvDNwvilvJ8EPG0XOLltpJ71Dr5QgEtPzEZq+VMyTwD/ 4P/Z03rWBp/yE9vnJZSnm/KlsgbKnb1FZJRdlbZeJ3AN4fPBUCrOrEKWsyQiH9IJA2jU kpwNj6dGu/GkoTmdJ/xnWaqdHWamF58Uq44sPfOLjZPHw4Nh21ImOCMcxlEQiTzsWc9k N185HBhOMpjmGyXY1IVmTUxXjzR+HuGJH+TbSZPILYn9StJ1HkVSC4WVilEr1SCWz7yw TI2uwalx/s4bS4MyGaqS4SANehv0Pd8emRWQKY6GallaDXXy0X27hs+BA2SuiKH8IzFX zBxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=t6juQwA15NUCSEex4/GXlT1BJpoxPwqFx7XKlO4+Bj8=; b=frQXPUGQls7Lpm7QOO2mM97gcVme+1Ha21Sak8sa78OSY6g0uDtbySqUeuVLepjzsd lor86rcPz6GGhGu+0GzSvdG93iYPuLp9OEC0An6o8pBaTZFHOsOGILxgssbzbSPPwv3y btO+z++dL6ovxjMY0b6TNJ980f9hzzLldxi5os7lYa4YDHoNzWE+xMa2I3L6b3nMZ+sB TnNcPVZ9OiAYdDPXsmLslYShEBYiAC8DuZuuhtNju+Xi9+If3kQ+c8GqHwE845wqo0Cu NOtRC9GHxBvXkuXsg712slOfOC8zlRR4yWiH+pKekK3ZGcrP7EIX7i0iGCUm3/IMPWRR F2eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=fCHjj3fy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a170902e88c00b001a656596b9esi23610253plg.608.2023.04.28.12.54.04; Fri, 28 Apr 2023 12:54:20 -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=@gmail.com header.s=20221208 header.b=fCHjj3fy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbjD1Tda (ORCPT + 99 others); Fri, 28 Apr 2023 15:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjD1Td3 (ORCPT ); Fri, 28 Apr 2023 15:33:29 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DEB12D5A; Fri, 28 Apr 2023 12:33:27 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-517c840f181so90265a12.3; Fri, 28 Apr 2023 12:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682710406; x=1685302406; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=t6juQwA15NUCSEex4/GXlT1BJpoxPwqFx7XKlO4+Bj8=; b=fCHjj3fybunvRiPgY0lHTYbwv7QUavKsqGLbhd+i0UTBPnaK91MbeISe+9MaSyUDxr qe9h5BsjSZEr16yr2xTLUVgd6N2pUzMFk+PVBSkMODWsQgwy9P+8CU+B/8aLbPZN6cGQ yl93JSNL/I3e6caxvX0iUAgFIcLzCCVGjeIVm2UWA9j6LymBluwVn3g3AYqoYe7rJ2y+ unZzjroEDZr4PsY0sEQ6ACVNKT754y2lj4Z6tLrdkl4KjUh+U2mUuxUiHq0JnpFPgkOq vsAmqSH4A/NsXL1n7Pm/VJAiVwuNEm59WtbNChcTvvygo+DKgUeFGxFkS1dC7qJ5dLKJ jlfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682710406; x=1685302406; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t6juQwA15NUCSEex4/GXlT1BJpoxPwqFx7XKlO4+Bj8=; b=WbZrApt3A0GHy3tqtCdJkmcudIfwDm6Lvqdrjcu2y6kK9RmMTTZGUjH/aihm3Vv1gd RiLYxXClLDdTpKto+jAgBthdyIbD28ALrfaGIhC1TqdLEQkbukKj8DCUTNM0fCLq8wAH VBNr9/ApVkXOMW01L3WXZ9rh02rpG1MK6+7H4IM9WovO1Kq0499Hel8L6Pjm+e5m5uW5 KoCFo18pDJyRY+aVjyrOtBU25UTRwZPDu81Ozop51qkiTJv7ltR6k/Mx3K8Om1kLI1oW 67R/s7Rk99/BDDQvgga456rMO+hfbP5bZjNaSpCBI05bGbD/a6jTfM9WVRgoJJKcLWU5 FCOQ== X-Gm-Message-State: AC+VfDyQ9pBVzunDc34IcZHf69VooP5lMQqSor+7poqe7tXeu/ub5RVN 1mRC/XJ2kvwbR1GaGKeuY5X7LaCb/Ag= X-Received: by 2002:a17:90b:4aca:b0:24b:7550:d3b4 with SMTP id mh10-20020a17090b4aca00b0024b7550d3b4mr6558916pjb.10.1682710406161; Fri, 28 Apr 2023 12:33:26 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d15-20020a17090ac24f00b0024779068491sm1815912pjx.26.2023.04.28.12.33.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Apr 2023 12:33:25 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Fri, 28 Apr 2023 12:33:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] hwmon: (oxp-sensors) Add AYANEO 2 and Geek models Content-Language: en-US To: Joaquin Aramendia Cc: derekjohn.clark@gmail.com, jdelvare@suse.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230426184420.99945-1-samsagax@gmail.com> <720c2b48-ca48-4ee3-9158-f453e48cb012@roeck-us.net> From: Guenter Roeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 4/28/23 12:15, Joaquin Aramendia wrote: >>> I don't know why but the compiler would complain with the casting from >>> enum to void*. >> >> Really ? I tried with both 32 bit and 64 bit targets, and the above worked >> just fine (with W=1). I tried with gcc 10.3 as well as 11.3. What is >> your compiler version, what exactly is the warning/error message you >> observed, and how exactly did your code look like ? > > Said something about an invalid cast of an lvalue? I can´t remember exactly Like this, maybe ? drivers/hwmon/oxp-sensors.c:63:26: error: lvalue required as unary ‘&’ operand That would have been something along the line of .driver_data = (void *)&aok_zoe_a1, or driver_data = &aok_zoe_a1, > and couldn't reproduce it again. Will change all to your form after > this patch gets > merged if you like, just to keep things atomic. > Please do. Thanks, Guenter >> >>> Found out that explicitly casting the enum literal before casting it >>> to void* works and >>> the compiler stopped complaining so I went with it. >>> >> >> You are not casting the enum literal, but a pointer to it. > > Yes. I'm taking an enum literal and taking its pointer to cast it to a void*. > A little cumbersome, but maybe it can be avoided by using your proposed > form directly and after making sure it works. >