From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 03 Jul 2012 17:07:04 -0600 Subject: [U-Boot] [PATCH 4/7] dfu: MMC specific routines for DFU operation In-Reply-To: <20120703223343.GD15962@bill-the-cat> References: <1341308291-14663-1-git-send-email-l.majewski@samsung.com> <201207040001.27997.marex@denx.de> <20120703220654.GC15962@bill-the-cat> <201207040031.14737.marex@denx.de> <20120703223343.GD15962@bill-the-cat> Message-ID: <4FF37B18.4030209@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07/03/2012 04:33 PM, Tom Rini wrote: > On Wed, Jul 04, 2012 at 12:31:14AM +0200, Marek Vasut wrote: >> Dear Tom Rini, >> >> [...] >> >>>>>>> + debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf); >>>>>>> + run_command(cmd_buf, 0); >>>>>> >>>>>> Holy Moly ... can we not make this into simple calls to those >>>>>> subsystems ? Instead invoking command is crazy ;-) >>>>> >>>>> Are they really simple? There's a few other places we do this, and so >>>>> long as it's documented that DFU depends on CONFIG_FAT_WRITE for >>>>> writing to fat and so forth. >>>> >>>> Well ain't it easier to call fat_write() or similar? >>> >>> Assuming that most of the logic in do_fat_fswrite is needed, no. And I >>> think a good portion of it is, at first glance at least. >> >> Abstracting it out into a function won't cut it? > > My inclination would be to say that seems a bit sillier than just using > run_command(...) to call the existing command. Abstracting into a function definitely means the compiler will be able to type-check all the arguments to the function. Is the same true using run_command; I assume everything gets serialized to an array of strings and hence any validation is deferred until run-time then?