Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2423673rdg; Mon, 14 Aug 2023 01:53:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCaA7tHy5mhlUF+ng5fEh6Ez08I1muDYm8qmQPgFhSdiuMYWToSTOsGHwwZ6qOpfx/O9EX X-Received: by 2002:aca:b02:0:b0:3a7:4889:79fe with SMTP id 2-20020aca0b02000000b003a7488979femr9264690oil.20.1692003180454; Mon, 14 Aug 2023 01:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692003180; cv=none; d=google.com; s=arc-20160816; b=HGvC5Q0rtEul/nzQAzhzqsTvU7gYv5cmnMPTCz+X4+v3uMWG6sdeRY+FgnScdJ7AwA Xj3eI/lfy4posidjaf9Sl/RpF84miEty+0ztrjAarf5DeTSZxYfkWX+/hwP0utSyBAEb g/c/l7IBzVY/jzBOfgoQF4gHH5njHDooZJRbtma/9o/azyZ6xmar8PUv3ikqBDqz+6+Y hhTvGIDH5nOWMDia4DMKRa5XH9Hr7SgrP95cArSGJsU7maBMeHq0NbI0PM1tpZhf/nEo jWJZ3lV8PEfFwu7pyJQ3kq+VnY1DkpF1QgmUUV+GqUtp+MQmzbx54Vd2jRawS6AYG+bo Jhvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=FZMgp9Z9tue7PfmNuI1NzyXvV7p4F0lq663HE+3sb+A=; fh=m5/C2QCImk/8y38G/I5XJg0+DLhKyZf3e0F6LKahly0=; b=KIZGVOzY0wM4/lbK5tzNmJdGNdbkvj0BDAmmgpwnVhT30l4PKrsjUiKUbbU/sjz67S X+XmWC0o06kKJJnj+ghD+nXs3oueAoWlIRZG6cmO4z5EfUuCdd1YuTltMkjWMzCMF1sM hZm7F7y7hfIVEvl4VRSlUQCe1V0M6/vdx6MJIqukPXjfGUuaLxfrReOpfcbsUQmwl5ZX UTfdBsKXab2KnLhqh0M+xl7wpsjpghU4/2HcI/vTevAWZ+bTlRlzhKppb51/dIhJdU3j FEpzKo0gQHW7FAQDkdhoUYnnvfz9TWSc0grTvQH5V7uBOKyOZebXr9zrxK6RT5fjcu5G MYRw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i67-20020a636d46000000b005646f8a9506si7794992pgc.426.2023.08.14.01.52.48; Mon, 14 Aug 2023 01:53:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233944AbjHNIeS convert rfc822-to-8bit (ORCPT + 99 others); Mon, 14 Aug 2023 04:34:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233173AbjHNIeI (ORCPT ); Mon, 14 Aug 2023 04:34:08 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2B74BF for ; Mon, 14 Aug 2023 01:34:05 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-148-mMDgg5w-NhK19ckygkrlbg-1; Mon, 14 Aug 2023 09:34:03 +0100 X-MC-Unique: mMDgg5w-NhK19ckygkrlbg-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 14 Aug 2023 09:33:31 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Mon, 14 Aug 2023 09:33:31 +0100 From: David Laight To: 'Krzysztof Kozlowski' , Jean Delvare , Guenter Roeck , Eric Tremblay , "linux-hwmon@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Andi Shyti Subject: RE: [PATCH 04/15] hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warning Thread-Topic: [PATCH 04/15] hwmon: (ina2xx) fix Wvoid-pointer-to-enum-cast warning Thread-Index: AQHZy22PDAQ6/HNzf0aAlEc1QR4MGa/pfLdA Date: Mon, 14 Aug 2023 08:33:31 +0000 Message-ID: References: <20230810093157.94244-1-krzysztof.kozlowski@linaro.org> <20230810093157.94244-4-krzysztof.kozlowski@linaro.org> In-Reply-To: <20230810093157.94244-4-krzysztof.kozlowski@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 From: Krzysztof Kozlowski > Sent: 10 August 2023 10:32 > > 'chip' is an enum, thus cast of pointer on 64-bit compile test with W=1 > causes: > > ina2xx.c:627:10: error: cast to smaller integer type 'enum ina2xx_ids' from 'const void *' [- > Werror,-Wvoid-pointer-to-enum-cast] > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/hwmon/ina2xx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c > index a47973e2d606..d8415d1f21fc 100644 > --- a/drivers/hwmon/ina2xx.c > +++ b/drivers/hwmon/ina2xx.c > @@ -624,7 +624,7 @@ static int ina2xx_probe(struct i2c_client *client) > enum ina2xx_ids chip; > > if (client->dev.of_node) > -chip = (enum ina2xx_ids)of_device_get_match_data(&client->dev); > +chip = (uintptr_t)of_device_get_match_data(&client->dev); The kernel type would be 'long' not uintptr_t. But this all looks like something horrid is being done. (And you've clearly lost all the tabs) David > else > chip = i2c_match_id(ina2xx_id, client)->driver_data; > > -- > 2.34.1 > - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)