From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Wed, 10 Oct 2018 11:49:09 +0900 Subject: [U-Boot] [PATCH 1/2] mmc: tmio: Pass full address to tmio_sd_addr_is_dmaable() In-Reply-To: <767dcaca-bd42-86f7-3b06-441caf1d93ea@gmail.com> References: <20181009112351.17256-1-marek.vasut+renesas@gmail.com> <494e0151-f2ee-ccdc-8e42-f198765fc1cf@gmail.com> <767dcaca-bd42-86f7-3b06-441caf1d93ea@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Oct 10, 2018 at 1:17 AM Marek Vasut wrote: > > On 10/09/2018 05:35 PM, Masahiro Yamada wrote: > > On Tue, Oct 9, 2018 at 11:55 PM Marek Vasut wrote: > >> > >> On 10/09/2018 02:24 PM, Masahiro Yamada wrote: > >>> Hi Marek, > >> > >> Hi, > >> > >>> On Tue, Oct 9, 2018 at 8:26 PM Marek Vasut wrote: > >>>> > >>>> Pass the entire source data pointer to tmio_sd_addr_is_dmaable() > >>> > >>> > >>> This statement sounds like > >>> the current code is passing the pointer address only partially. > >>> Is it right? > >> > >> With this change it is. > > > > > > Is anything wrong with my code? > > Don't think so. > > > How about your patch title > > "mmc: tmio: Pass full address to tmio_sd_addr_is_dmaable()" ? > > > > Does it mean my code is not passing full address? > > Could use a rephrasing, yeah > > >>>> so we don't have to apply casts throughout the code. > >>> > >>> I do not understand this either > >>> since I see a cast in your code too. > >> > >> There is a cast, but it's isolated to this function. > >> > >>> In the previous code, the caller casts src->address > >>> when it passes it to tmio_sd_addr_is_dmaable(). > >>> > >>> In the new code, 'src' is casted > >>> in tmio_sd_addr_is_dmaable(). > >>> > >>> To me, you just moved the location of casting. > >>> What is the difference (i.e. benefit)? > >> > >> I moved the cast from the code into the function, which I think is cleaner. > > > > I do not think so. > > So would you prefer to see stuff like > > function foo(long bar) > {...} > > foo((cast)baz); > > ... > > foo((cast)quux); > > In the code :) It is a hypothetical situation. If there were multiple function calls, I would agree with you. -- Best Regards Masahiro Yamada