Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755557AbdC1L0Y (ORCPT ); Tue, 28 Mar 2017 07:26:24 -0400 Received: from mail1.bemta6.messagelabs.com ([193.109.254.114]:47741 "EHLO mail1.bemta6.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755092AbdC1L0D (ORCPT ); Tue, 28 Mar 2017 07:26:03 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIJsWRWlGSWpSXmKPExsUSt3Opse4791s RBhvvSFlMffiEzWL+kXOsFocXvWC0mH/lGqvFs1t7mSyOXZ/IbHH/61FGi29XOpgsbn76xmpx edccNovPvUcYLW6s28du8WThGSaLV82P2CyWXr/IZNG69whQ7GEfm8WtGS9YHYQ87u9l91gzb w2jx85Zd9k9rm0W81i85yWTx6ZVnWwed67tYfM4dLgDKPm9gd3j8ya5AK4o1sy8pPyKBNaMts WP2QveilbcuzSFqYHxhGgXIxeHkMBSRonNve+Zuxg5OdgEDCXmvXnP2MXIwSEioCsx5ycTSA2 zwHlWiUN9X5lAaoQFLCV+PPrKCGKLCFhJdC3oZoWwwyT+nN0BFmcRUJWY8QAizisQIPFn1Q42 iGW9zBIzO1eCLeAUCJT4ukQHpIZRQFbiS+NqsBuYBcQlbj2ZD7ZLQkBAYsme88wQtqjEy8f/W CFseYm1v55Axe0lXt97xwIyUkJAX6KvsRgibCixatoBFgjbXOL/g3esICXMApoS63fpQ2xSlJ jS/ZAd4kpBiZMzn7BMYBSfheSIWQgds5B0zELSsYCRZRWjenFqUVlqka6pXlJRZnpGSW5iZo6 uoYGZXm5qcXFiempOYlKxXnJ+7iZGYFJhAIIdjNMv+x9ilORgUhLlfWB/K0KILyk/pTIjsTgj vqg0J7X4EKMMB4eSBO8CV6CcYFFqempFWmYOML3BpCU4eJREeD+ApHmLCxJzizPTIVKnGBWlx HkvgyQEQBIZpXlwbbCUeolRVkqYlxHoECGegtSi3MwSVPlXjOIcjErCvFluQFN4MvNK4Ka/Al rMBLRY3AZscUkiQkqqgVGwY8K8XxZnCusOHysx2ZDdvn9v59wE/R9/RA+w90v+jr2ou+PxK4P PYnEs/2Ruepo5V0me2bPyt+KTJXVbW9iT3hkeOn2qPtJk+VyfC58UpzxsmSXLaKdnpyeyysfu 4+G9BmJa+XedFawMDddkXDkmcn6Tpq3YT7/DuSVvPNa98Jn6+0P7TR4lluKMREMt5qLiRADcB rnEpAMAAA== X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-6.tower-194.messagelabs.com!1490700270!86568808!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked From: Steve Twiss To: Geert Uytterhoeven CC: Lee Jones , kbuild test robot , "kbuild-all@01.org" , LINUX-KERNEL , DEVICETREE , Dmitry Torokhov , Eduardo Valentin , Guenter Roeck , LINUX-INPUT , LINUX-PM , LINUX-WATCHDOG , Liam Girdwood , Mark Brown , Mark Rutland , Rob Herring , Support Opensource , Wim Van Sebroeck , Zhang Rui Subject: RE: [PATCH V6 4/7] mfd: da9061: MFD core support Thread-Topic: [PATCH V6 4/7] mfd: da9061: MFD core support Thread-Index: AQHSpuEdWMPV5xErkU+Bn+ir7CQouaGotLkAgAElaICAAAQ0gIAAMOZw///0j4CAABHRYA== Date: Tue, 28 Mar 2017 11:24:29 +0000 Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7018CD6A1E1@SW-EX-MBX02.diasemi.com> References: <539b8756120ab3558c906f7457e65f94dbe37425.1490608293.git.stwiss.opensource@diasemi.com> <201703272258.hWlipe1g%fengguang.wu@intel.com> <20170328082141.u2rgnhei5yhhzxdn@dell> <6ED8E3B22081A4459DAC7699F3695FB7018CD69ECA@SW-EX-MBX02.diasemi.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.26.77] x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-serverinfo: sw-ex-cashub01.diasemi.com, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 28/03/2017 07:44:00 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v2SBRRGk014845 Content-Length: 2018 Lines: 50 On 28 March 2017 11:51, Geert Uytterhoeven wrote: > Hi Steve, > > On Tue, Mar 28, 2017 at 12:42 PM, Steve Twiss wrote: > > On 28 March 2017 09:37, Geert Uytterhoeven wrote: > >> Subject: Re: [PATCH V6 4/7] mfd: da9061: MFD core support > >> On Tue, Mar 28, 2017 at 10:21 AM, Lee Jones wrote: > >> >> [auto build test WARNING on ljones-mfd/for-mfd-next] > >> >> [also build test WARNING on v4.11-rc4 next-20170327] > >> >> base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next > >> >> config: x86_64-randconfig-x009-201713 (attached as .config) > >> >> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > >> >> reproduce: > >> >> # save the attached .config to linux build tree > >> >> make ARCH=x86_64 > >> >> > >> >> All warnings (new ones prefixed by >>): > >> >> > >> >> drivers//mfd/da9062-core.c: In function 'da9062_i2c_probe': > >> >> >> drivers//mfd/da9062-core.c:845:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] > >> >> chip->chip_type = (int)match->data; > >> >> ^ > >> > > >> > Please use longs or enums. > >> > >> Enums would still give a warning on 64-bit. > >> The simple fix is change the cast from (int) to (uintptr_t). > > > > Hi Lee and Geert, > > > > How about this? Fix by redefining the enum chip_type to be an int. > > Then, just use substitution: > > #define COMPAT_TYPE_DA9061 1 > > #define COMPAT_TYPE_DA9062 2 > > > > That would be simple. > > Are there any reasons this would not be acceptable? > > I don't see how that can help. > The warning is caused by casting the "void *" (which is either 32-bit or > 64-bit) in of_device_if.data to an integer or enum (which is always 32-bit). > > The right fix is to cast it to uintptr_t intead of int, like other drivers do. Thanks Geert, Um. Of course. Thanks, and my apologies. It would have helped if I had compile tested the right file :( I'll follow the convention and cast (uintptr_t). Thanks, Steve