From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311AbbFXHQa (ORCPT ); Wed, 24 Jun 2015 03:16:30 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:54351 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbbFXHQW (ORCPT ); Wed, 24 Jun 2015 03:16:22 -0400 From: Arnd Bergmann To: Joe Perches Cc: nick , Kuninori Morimoto , ulf.hansson@linaro.org, ben.dooks@codethink.co.uk, ykaneko0929@gmail.com, laurent.pinchart+renesas@ideasonboard.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2] mmc:Add pointer cast to uintptr_t for slave_id_rx and tx in the function, sh_mmcif_request_dma_one Date: Wed, 24 Jun 2015 09:16:11 +0200 Message-ID: <7719575.AWrtW5tPaL@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1435107273.2504.43.camel@perches.com> References: <1431366550-22045-1-git-send-email-xerofoify@gmail.com> <5589FD65.7040807@gmail.com> <1435107273.2504.43.camel@perches.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Rxt4dhMB9ZxQK5/Kudn+UpL3nPrK5XhE6Z3TRe9Hhthxa+oxawL 7hGVmKw2JDZnH12Qm5bsl4G/5B5L1oQGyz/CHrWk6xHwBhmUp0S4ubFvM1cr0y8LaTKgSvs lQvhNG30fv3LJ3JAUH45mlx/j93Dq9z2p04T0asK8EGWjy7b+W4FjU3Km0wUlZhyy1ysafY ikYgv6LSv5heeoY/O6MRw== X-UI-Out-Filterresults: notjunk:1;V01:K0:0cRjbRZn+JI=:Ft7SDA3SSkq+Cj06I+CIcO zF/2C5HiBhOIkyBhpdfj5KnprrX8ImesL8rUpdToTt8O/TphMJuiD+YTdxnmDyO0G+54ySU13 BUbEgflg+nYIxvr8kLXD/l0tPNEc7vEqChbWlMzRzwsbYpDh/YYmigGq6n59D2FydS3Pti2t8 RfVSl/RHnUanQ30CmbbN9jT2JlS/HwKkb4q5yFbL5OGwTaZJoH3sONQFxBBZlQEfWEcTyFgtV MGauUS1FLaOt1MCBxMOT9p1L2L29UygJlXi+xRE53JHPjGp1tP0fzytGqzqZM1u3wq/XajYKe zT0onOKp6xEihgJn2/JqrIz3zMtzeEAxgNSuouohJEQxCj5FWGVEoCA0N3Qjjo3R6EV5fwyFb YfdjDz4qcoL6rcrxFxSuX9seCwpzfczg1SsxKxhyTicTY1U7zE0om7+IRq7hAR4zp91SvVRnZ nugsGJiyT41Schuvi9GH5RQwJ06K/L1bNRuVUCE5CgWma+CmYzaLq9bRV2Qvr00lZEkIY7YeJ 27iPYelnFcJbdzpKVf9KCqzNt1hYHdFuvc1n27uciZNztKMG07usnCeWC2DaRUYIzd+RpXb5E BX2uWt0WUBAkkeD25ooOXv2x4zAcaVp5ODBRuVdqQKBVFNa9W649/jn+fmVjZMT+mWWsUHM92 Ma6CQpwMXnyf7m7L6H8+OO2j4hYo97hrlQtDOGGnlQeAGCw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 23 June 2015 17:54:33 Joe Perches wrote: > On Tue, 2015-06-23 at 20:44 -0400, nick wrote: > > On 2015-06-23 08:40 PM, Joe Perches wrote: > > > On Wed, 2015-06-24 at 00:24 +0000, Kuninori Morimoto wrote: > > >>>> > > >>>> It's far more common (~10:1) in the kernel to cast using > > >>>> ( *)(unsigned long) > > >>>> than > > >>>> ( *)(uintptr_t) > > >>>> > > >>> Joe, > > >>> I agree it's more common in the kernel but one of the maintainers when I sent > > >>> this patch a month ago requested I use uintpr_t instead of unsigned long for > > >>> the casting. Otherwise I would have done the cast to fix the build warning > > >>> with unsigned long instead. > > >> > > >> This mail > > >> http://thread.gmane.org/gmane.linux.kernel.mmc/32304 > > > > > > uintptr_t was introduced to avoid ptrdiff_t misuse in > > > commit 142956af5250 ("fix abuses of ptrdiff_t") by Al Viro. > > > > > > unsigned long is preponderant, long is used about 1/4 as > > > often as unsigned long, uintptr_t is relatively uncommon. > > > > > > If someone wants to go and convert the 800 or so casts to > > > long or unsigned long to uintptr_t so that's the style most > > > frequently used, that'd be different. I'm not going to > > > submit any patches for that. > > > > > > > > I am not disagreeing it was just easier to listen to the maintainer rather > > then get in a technical argument over which type is better for the cast. > > Laurent has authored a couple patches to that file and he gave > you his opinion about using uintptr_t. > > I'm giving an opinion too, just with a little statistics. > > I think it's better to use the style that the kernel generally > uses. > > I'll stop replying now. Instead of debating the type of cast that is used here, it would be nicer to do a patch that avoids the cast in the driver entirely, by changing the pdata to contain a void* type from the start, and to pass the shdma_chan_filter function pointer along with it from platform code. That would make the sh_mmcif driver independent of the underlying dma driver. Arnd