From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Fri, 21 Sep 2012 16:18:11 -0600 Subject: [U-Boot] [PATCH] disk: make get_partition_info() always available to disk.c In-Reply-To: <1348265104-1337-1-git-send-email-swarren@wwwdotorg.org> References: <1348265104-1337-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <505CE7A3.4080708@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 09/21/2012 04:05 PM, Stephen Warren wrote: > From: Stephen Warren > > Now that get_device_and_partition() always calls get_partition_info() > when disk.c is compiled, we must always compile the function, rather > than ifdef it away. > > Technically, this change is required before Rob's "disk/part: introduce > get_device_and_partition" patch. However, at least when the compiler > optimizer is turned on, it isn't required before then in practice, > since get_device_and_partition() calls get_dev(), which is stubbed out > in disk.c under exactly the same conditions that get_partition_info() > is not compiled, and hence the compiler never generates code for the > call to the missing function. However, in my later patch "disk: > get_device_and_partition() "auto" partition and cleanup", the optimizer > doesn't succeed at this, and may attempt to reference the undefined > function. Uggh. Even this isn't quite enough; e.g. CONFIG_DOS_PARTITION can be enabled but not the defines that part_dos.c uses to ifdef out compilation of get_partition_info_dos(). That seems illegal to me, but anyway. I'll send another one once MAKEALL -a arm actually gets all the way to the end...